hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/fs/afs/dir_edit.c
....@@ -1,12 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* AFS filesystem directory editing
23 *
34 * Copyright (C) 2018 Red Hat, Inc. All Rights Reserved.
45 * Written by David Howells (dhowells@redhat.com)
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public Licence
8
- * as published by the Free Software Foundation; either version
9
- * 2 of the Licence, or (at your option) any later version.
106 */
117
128 #include <linux/kernel.h>
....@@ -247,10 +243,8 @@
247243 index, gfp);
248244 if (!page)
249245 goto error;
250
- if (!PagePrivate(page)) {
251
- set_page_private(page, 1);
252
- SetPagePrivate(page);
253
- }
246
+ if (!PagePrivate(page))
247
+ attach_page_private(page, (void *)1);
254248 dir_page = kmap(page);
255249 }
256250
....@@ -270,7 +264,7 @@
270264 if (b == nr_blocks) {
271265 _debug("init %u", b);
272266 afs_edit_init_block(meta, block, b);
273
- i_size_write(&vnode->vfs_inode, (b + 1) * AFS_DIR_BLOCK_SIZE);
267
+ afs_set_i_size(vnode, (b + 1) * AFS_DIR_BLOCK_SIZE);
274268 }
275269
276270 /* Only lower dir pages have a counter in the header. */
....@@ -303,7 +297,7 @@
303297 new_directory:
304298 afs_edit_init_block(meta, meta, 0);
305299 i_size = AFS_DIR_BLOCK_SIZE;
306
- i_size_write(&vnode->vfs_inode, i_size);
300
+ afs_set_i_size(vnode, i_size);
307301 slot = AFS_DIR_RESV_BLOCKS0;
308302 page = page0;
309303 block = meta;