mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-17 13:40:32 -05:00
f2fs: Use a folio in f2fs_read_inline_dir()
Remove two calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
committed by
Jaegeuk Kim
parent
08e83ca095
commit
f5ef723c17
@@ -755,7 +755,7 @@ int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx,
|
||||
struct fscrypt_str *fstr)
|
||||
{
|
||||
struct inode *inode = file_inode(file);
|
||||
struct page *ipage = NULL;
|
||||
struct folio *ifolio = NULL;
|
||||
struct f2fs_dentry_ptr d;
|
||||
void *inline_dentry = NULL;
|
||||
int err;
|
||||
@@ -765,17 +765,17 @@ int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx,
|
||||
if (ctx->pos == d.max)
|
||||
return 0;
|
||||
|
||||
ipage = f2fs_get_inode_page(F2FS_I_SB(inode), inode->i_ino);
|
||||
if (IS_ERR(ipage))
|
||||
return PTR_ERR(ipage);
|
||||
ifolio = f2fs_get_inode_folio(F2FS_I_SB(inode), inode->i_ino);
|
||||
if (IS_ERR(ifolio))
|
||||
return PTR_ERR(ifolio);
|
||||
|
||||
/*
|
||||
* f2fs_readdir was protected by inode.i_rwsem, it is safe to access
|
||||
* ipage without page's lock held.
|
||||
*/
|
||||
unlock_page(ipage);
|
||||
folio_unlock(ifolio);
|
||||
|
||||
inline_dentry = inline_data_addr(inode, ipage);
|
||||
inline_dentry = inline_data_addr(inode, &ifolio->page);
|
||||
|
||||
make_dentry_ptr_inline(inode, &d, inline_dentry);
|
||||
|
||||
@@ -783,7 +783,7 @@ int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx,
|
||||
if (!err)
|
||||
ctx->pos = d.max;
|
||||
|
||||
f2fs_put_page(ipage, 0);
|
||||
f2fs_folio_put(ifolio, false);
|
||||
return err < 0 ? err : 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user