mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 11:57:46 +00:00
ocfs2: convert ocfs2_readpage_inline() to take a folio
Save a couple of calls to compound_head() by using a folio throughout this function. Link: https://lkml.kernel.org/r/20241205171653.3179945-8-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:
parent
a1a3696875
commit
7a33060bff
@ -252,12 +252,12 @@ int ocfs2_read_inline_data(struct inode *inode, struct page *page,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ocfs2_readpage_inline(struct inode *inode, struct page *page)
|
||||
static int ocfs2_readpage_inline(struct inode *inode, struct folio *folio)
|
||||
{
|
||||
int ret;
|
||||
struct buffer_head *di_bh = NULL;
|
||||
|
||||
BUG_ON(!PageLocked(page));
|
||||
BUG_ON(!folio_test_locked(folio));
|
||||
BUG_ON(!(OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL));
|
||||
|
||||
ret = ocfs2_read_inode_block(inode, &di_bh);
|
||||
@ -266,9 +266,9 @@ static int ocfs2_readpage_inline(struct inode *inode, struct page *page)
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = ocfs2_read_inline_data(inode, page, di_bh);
|
||||
ret = ocfs2_read_inline_data(inode, &folio->page, di_bh);
|
||||
out:
|
||||
unlock_page(page);
|
||||
folio_unlock(folio);
|
||||
|
||||
brelse(di_bh);
|
||||
return ret;
|
||||
@ -322,7 +322,7 @@ static int ocfs2_read_folio(struct file *file, struct folio *folio)
|
||||
}
|
||||
|
||||
if (oi->ip_dyn_features & OCFS2_INLINE_DATA_FL)
|
||||
ret = ocfs2_readpage_inline(inode, &folio->page);
|
||||
ret = ocfs2_readpage_inline(inode, folio);
|
||||
else
|
||||
ret = block_read_full_folio(folio, ocfs2_get_block);
|
||||
unlock = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user