ocfs2: convert ocfs2_map_page_blocks() to ocfs2_map_folio_blocks()
All callers now have a folio, so pass it in instead of converting folio->page->folio. Link: https://lkml.kernel.org/r/20241205171653.3179945-15-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>
This commit is contained in:
committed by
Andrew Morton
parent
b04d305df1
commit
0313500d5d
+1
-1
@@ -6817,7 +6817,7 @@ void ocfs2_map_and_dirty_page(struct inode *inode, handle_t *handle,
|
||||
loff_t start_byte = folio_pos(folio) + from;
|
||||
loff_t length = to - from;
|
||||
|
||||
ret = ocfs2_map_page_blocks(page, phys, inode, from, to, 0);
|
||||
ret = ocfs2_map_folio_blocks(folio, phys, inode, from, to, 0);
|
||||
if (ret)
|
||||
mlog_errno(ret);
|
||||
|
||||
|
||||
+8
-10
@@ -560,7 +560,7 @@ static void ocfs2_clear_page_regions(struct page *page,
|
||||
/*
|
||||
* Nonsparse file systems fully allocate before we get to the write
|
||||
* code. This prevents ocfs2_write() from tagging the write as an
|
||||
* allocating one, which means ocfs2_map_page_blocks() might try to
|
||||
* allocating one, which means ocfs2_map_folio_blocks() might try to
|
||||
* read-in the blocks at the tail of our file. Avoid reading them by
|
||||
* testing i_size against each block offset.
|
||||
*/
|
||||
@@ -585,11 +585,10 @@ static int ocfs2_should_read_blk(struct inode *inode, struct folio *folio,
|
||||
*
|
||||
* This will also skip zeroing, which is handled externally.
|
||||
*/
|
||||
int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno,
|
||||
int ocfs2_map_folio_blocks(struct folio *folio, u64 *p_blkno,
|
||||
struct inode *inode, unsigned int from,
|
||||
unsigned int to, int new)
|
||||
{
|
||||
struct folio *folio = page_folio(page);
|
||||
int ret = 0;
|
||||
struct buffer_head *head, *bh, *wait[2], **wait_bh = wait;
|
||||
unsigned int block_end, block_start;
|
||||
@@ -971,12 +970,11 @@ static int ocfs2_prepare_folio_for_write(struct inode *inode, u64 *p_blkno,
|
||||
map_to = map_from + user_len;
|
||||
|
||||
if (new)
|
||||
ret = ocfs2_map_page_blocks(page, p_blkno, inode,
|
||||
cluster_start, cluster_end,
|
||||
new);
|
||||
ret = ocfs2_map_folio_blocks(folio, p_blkno, inode,
|
||||
cluster_start, cluster_end, new);
|
||||
else
|
||||
ret = ocfs2_map_page_blocks(page, p_blkno, inode,
|
||||
map_from, map_to, new);
|
||||
ret = ocfs2_map_folio_blocks(folio, p_blkno, inode,
|
||||
map_from, map_to, new);
|
||||
if (ret) {
|
||||
mlog_errno(ret);
|
||||
goto out;
|
||||
@@ -999,8 +997,8 @@ static int ocfs2_prepare_folio_for_write(struct inode *inode, u64 *p_blkno,
|
||||
map_from = cluster_start;
|
||||
map_to = cluster_end;
|
||||
|
||||
ret = ocfs2_map_page_blocks(page, p_blkno, inode,
|
||||
cluster_start, cluster_end, new);
|
||||
ret = ocfs2_map_folio_blocks(folio, p_blkno, inode,
|
||||
cluster_start, cluster_end, new);
|
||||
if (ret) {
|
||||
mlog_errno(ret);
|
||||
goto out;
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ handle_t *ocfs2_start_walk_page_trans(struct inode *inode,
|
||||
unsigned from,
|
||||
unsigned to);
|
||||
|
||||
int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno,
|
||||
int ocfs2_map_folio_blocks(struct folio *folio, u64 *p_blkno,
|
||||
struct inode *inode, unsigned int from,
|
||||
unsigned int to, int new);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user