Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ocfs2: convert ocfs2_map_and_dirty_page() to ocfs2_map_and_dirty_folio()

All callers now have a folio, so skip the folio->page->folio conversion.

Link: https://lkml.kernel.org/r/20241205171653.3179945-19-willy@infradead.org
Signed-off-by: Mark Tinguely <mark.tinguely@oracle.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Mark Tinguely and committed by
Andrew Morton
602f206a 395ea2ab

+13 -15
+8 -9
fs/ocfs2/alloc.c
··· 6808 6808 return 0; 6809 6809 } 6810 6810 6811 - void ocfs2_map_and_dirty_page(struct inode *inode, handle_t *handle, 6812 - unsigned int from, unsigned int to, 6813 - struct page *page, int zero, u64 *phys) 6811 + void ocfs2_map_and_dirty_folio(struct inode *inode, handle_t *handle, 6812 + size_t from, size_t to, struct folio *folio, int zero, 6813 + u64 *phys) 6814 6814 { 6815 - struct folio *folio = page_folio(page); 6816 6815 int ret, partial = 0; 6817 6816 loff_t start_byte = folio_pos(folio) + from; 6818 6817 loff_t length = to - from; ··· 6870 6871 BUG_ON(from > PAGE_SIZE); 6871 6872 BUG_ON(to > PAGE_SIZE); 6872 6873 6873 - ocfs2_map_and_dirty_page(inode, handle, from, to, &folio->page, 1, 6874 - &phys); 6874 + ocfs2_map_and_dirty_folio(inode, handle, from, to, folio, 1, 6875 + &phys); 6875 6876 6876 6877 start = (folio->index + 1) << PAGE_SHIFT; 6877 6878 } ··· 7119 7120 7120 7121 /* 7121 7122 * Save two copies, one for insert, and one that can 7122 - * be changed by ocfs2_map_and_dirty_page() below. 7123 + * be changed by ocfs2_map_and_dirty_folio() below. 7123 7124 */ 7124 7125 block = phys = ocfs2_clusters_to_blocks(inode->i_sb, bit_off); 7125 7126 ··· 7142 7143 goto out_unlock; 7143 7144 } 7144 7145 7145 - ocfs2_map_and_dirty_page(inode, handle, 0, page_end, &folio->page, 0, 7146 - &phys); 7146 + ocfs2_map_and_dirty_folio(inode, handle, 0, page_end, folio, 0, 7147 + &phys); 7147 7148 } 7148 7149 7149 7150 spin_lock(&oi->ip_lock);
+3 -3
fs/ocfs2/alloc.h
··· 254 254 return !rec->e_leaf_clusters; 255 255 } 256 256 257 - void ocfs2_map_and_dirty_page(struct inode *inode, handle_t *handle, 258 - unsigned int from, unsigned int to, 259 - struct page *page, int zero, u64 *phys); 257 + void ocfs2_map_and_dirty_folio(struct inode *inode, handle_t *handle, 258 + size_t from, size_t to, struct folio *folio, int zero, 259 + u64 *phys); 260 260 /* 261 261 * Structures which describe a path through a btree, and functions to 262 262 * manipulate them.
+2 -3
fs/ocfs2/refcounttree.c
··· 2975 2975 } 2976 2976 } 2977 2977 2978 - ocfs2_map_and_dirty_page(inode, 2979 - handle, from, to, 2980 - &folio->page, 0, &new_block); 2978 + ocfs2_map_and_dirty_folio(inode, handle, from, to, 2979 + folio, 0, &new_block); 2981 2980 folio_mark_accessed(folio); 2982 2981 unlock: 2983 2982 folio_unlock(folio);