Skip to content

Commit af7628d

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
fs: convert error_remove_page to error_remove_folio
There were already assertions that we were not passing a tail page to error_remove_page(), so make the compiler enforce that by converting everything to pass and use a folio. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Naoya Horiguchi <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent e130b65 commit af7628d

File tree

23 files changed

+44
-44
lines changed

23 files changed

+44
-44
lines changed

Documentation/filesystems/locking.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ prototypes::
261261
struct folio *src, enum migrate_mode);
262262
int (*launder_folio)(struct folio *);
263263
bool (*is_partially_uptodate)(struct folio *, size_t from, size_t count);
264-
int (*error_remove_page)(struct address_space *, struct page *);
264+
int (*error_remove_folio)(struct address_space *, struct folio *);
265265
int (*swap_activate)(struct swap_info_struct *sis, struct file *f, sector_t *span)
266266
int (*swap_deactivate)(struct file *);
267267
int (*swap_rw)(struct kiocb *iocb, struct iov_iter *iter);
@@ -287,7 +287,7 @@ direct_IO:
287287
migrate_folio: yes (both)
288288
launder_folio: yes
289289
is_partially_uptodate: yes
290-
error_remove_page: yes
290+
error_remove_folio: yes
291291
swap_activate: no
292292
swap_deactivate: no
293293
swap_rw: yes, unlocks

Documentation/filesystems/vfs.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ cache in your filesystem. The following members are defined:
823823
bool (*is_partially_uptodate) (struct folio *, size_t from,
824824
size_t count);
825825
void (*is_dirty_writeback)(struct folio *, bool *, bool *);
826-
int (*error_remove_page) (struct mapping *mapping, struct page *page);
826+
int (*error_remove_folio)(struct mapping *mapping, struct folio *);
827827
int (*swap_activate)(struct swap_info_struct *sis, struct file *f, sector_t *span)
828828
int (*swap_deactivate)(struct file *);
829829
int (*swap_rw)(struct kiocb *iocb, struct iov_iter *iter);
@@ -1034,8 +1034,8 @@ cache in your filesystem. The following members are defined:
10341034
VM if a folio should be treated as dirty or writeback for the
10351035
purposes of stalling.
10361036

1037-
``error_remove_page``
1038-
normally set to generic_error_remove_page if truncation is ok
1037+
``error_remove_folio``
1038+
normally set to generic_error_remove_folio if truncation is ok
10391039
for this address space. Used for memory failure handling.
10401040
Setting this implies you deal with pages going away under you,
10411041
unless you have them locked or reference counts increased.

block/fops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ const struct address_space_operations def_blk_aops = {
500500
.readahead = blkdev_readahead,
501501
.writepages = blkdev_writepages,
502502
.is_partially_uptodate = iomap_is_partially_uptodate,
503-
.error_remove_page = generic_error_remove_page,
503+
.error_remove_folio = generic_error_remove_folio,
504504
.migrate_folio = filemap_migrate_folio,
505505
};
506506
#endif /* CONFIG_BUFFER_HEAD */

fs/afs/write.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static void afs_kill_pages(struct address_space *mapping,
242242
folio_clear_uptodate(folio);
243243
folio_end_writeback(folio);
244244
folio_lock(folio);
245-
generic_error_remove_page(mapping, &folio->page);
245+
generic_error_remove_folio(mapping, folio);
246246
folio_unlock(folio);
247247
folio_put(folio);
248248

fs/bcachefs/fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ static const struct address_space_operations bch_address_space_operations = {
11031103
#ifdef CONFIG_MIGRATION
11041104
.migrate_folio = filemap_migrate_folio,
11051105
#endif
1106-
.error_remove_page = generic_error_remove_page,
1106+
.error_remove_folio = generic_error_remove_folio,
11071107
};
11081108

11091109
struct bcachefs_fid {

fs/btrfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10930,7 +10930,7 @@ static const struct address_space_operations btrfs_aops = {
1093010930
.release_folio = btrfs_release_folio,
1093110931
.migrate_folio = btrfs_migrate_folio,
1093210932
.dirty_folio = filemap_dirty_folio,
10933-
.error_remove_page = generic_error_remove_page,
10933+
.error_remove_folio = generic_error_remove_folio,
1093410934
.swap_activate = btrfs_swap_activate,
1093510935
.swap_deactivate = btrfs_swap_deactivate,
1093610936
};

fs/ceph/addr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,8 @@ static void writepages_finish(struct ceph_osd_request *req)
907907
doutc(cl, "unlocking %p\n", page);
908908

909909
if (remove_page)
910-
generic_error_remove_page(inode->i_mapping,
911-
page);
910+
generic_error_remove_folio(inode->i_mapping,
911+
page_folio(page));
912912

913913
unlock_page(page);
914914
}

fs/ext2/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ const struct address_space_operations ext2_aops = {
969969
.writepages = ext2_writepages,
970970
.migrate_folio = buffer_migrate_folio,
971971
.is_partially_uptodate = block_is_partially_uptodate,
972-
.error_remove_page = generic_error_remove_page,
972+
.error_remove_folio = generic_error_remove_folio,
973973
};
974974

975975
static const struct address_space_operations ext2_dax_aops = {

fs/ext4/inode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3564,7 +3564,7 @@ static const struct address_space_operations ext4_aops = {
35643564
.direct_IO = noop_direct_IO,
35653565
.migrate_folio = buffer_migrate_folio,
35663566
.is_partially_uptodate = block_is_partially_uptodate,
3567-
.error_remove_page = generic_error_remove_page,
3567+
.error_remove_folio = generic_error_remove_folio,
35683568
.swap_activate = ext4_iomap_swap_activate,
35693569
};
35703570

@@ -3581,7 +3581,7 @@ static const struct address_space_operations ext4_journalled_aops = {
35813581
.direct_IO = noop_direct_IO,
35823582
.migrate_folio = buffer_migrate_folio_norefs,
35833583
.is_partially_uptodate = block_is_partially_uptodate,
3584-
.error_remove_page = generic_error_remove_page,
3584+
.error_remove_folio = generic_error_remove_folio,
35853585
.swap_activate = ext4_iomap_swap_activate,
35863586
};
35873587

@@ -3598,7 +3598,7 @@ static const struct address_space_operations ext4_da_aops = {
35983598
.direct_IO = noop_direct_IO,
35993599
.migrate_folio = buffer_migrate_folio,
36003600
.is_partially_uptodate = block_is_partially_uptodate,
3601-
.error_remove_page = generic_error_remove_page,
3601+
.error_remove_folio = generic_error_remove_folio,
36023602
.swap_activate = ext4_iomap_swap_activate,
36033603
};
36043604

fs/f2fs/compress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ void f2fs_invalidate_compress_pages(struct f2fs_sb_info *sbi, nid_t ino)
19441944
continue;
19451945
}
19461946

1947-
generic_error_remove_page(mapping, &folio->page);
1947+
generic_error_remove_folio(mapping, folio);
19481948
folio_unlock(folio);
19491949
}
19501950
folio_batch_release(&fbatch);

0 commit comments

Comments
 (0)