diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-10-18 22:52:52 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-11-03 16:07:34 -0800 |
commit | 7b3cd7d6f026784b1a2a74b6e207b26253d9d780 (patch) | |
tree | 25d134417cd0a8cedb380af01c252e8f127f4c8d /fs/f2fs/inline.c | |
parent | 5ab18570b85cf3071875a36b88bc5ed27d0b6ef7 (diff) |
f2fs: introduce f2fs_dentry_ptr structure for code clean-up
This patch introduces f2fs_dentry_ptr structure for the use of a function
parameter in inline_dentry operations.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inline.c')
-rw-r--r-- | fs/f2fs/inline.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index 38a6aa792534..445e99d6f6ee 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -265,8 +265,8 @@ struct f2fs_dir_entry *find_in_inline_dir(struct inode *dir, struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb); struct f2fs_inline_dentry *inline_dentry; struct f2fs_dir_entry *de; + struct f2fs_dentry_ptr d; struct page *ipage; - int max_slots = NR_INLINE_DENTRY; ipage = get_node_page(sbi, dir->i_ino); if (IS_ERR(ipage)) @@ -274,9 +274,9 @@ struct f2fs_dir_entry *find_in_inline_dir(struct inode *dir, inline_dentry = inline_data_addr(ipage); - de = find_target_dentry(name, &max_slots, &inline_dentry->dentry_bitmap, - inline_dentry->dentry, - inline_dentry->filename); + make_dentry_ptr(&d, (void *)inline_dentry, 2); + de = find_target_dentry(name, NULL, &d); + unlock_page(ipage); if (de) *res_page = ipage; @@ -287,7 +287,7 @@ struct f2fs_dir_entry *find_in_inline_dir(struct inode *dir, * For the most part, it should be a bug when name_len is zero. * We stop here for figuring out where the bugs has occurred. */ - f2fs_bug_on(sbi, max_slots < 0); + f2fs_bug_on(sbi, d.max < 0); return de; } @@ -519,6 +519,7 @@ int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx) struct inode *inode = file_inode(file); struct f2fs_inline_dentry *inline_dentry = NULL; struct page *ipage = NULL; + struct f2fs_dentry_ptr d; if (ctx->pos == NR_INLINE_DENTRY) return 0; @@ -529,10 +530,9 @@ int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx) inline_dentry = inline_data_addr(ipage); - if (!f2fs_fill_dentries(ctx, &inline_dentry->dentry_bitmap, - inline_dentry->dentry, - inline_dentry->filename, - NR_INLINE_DENTRY, 0)) + make_dentry_ptr(&d, (void *)inline_dentry, 2); + + if (!f2fs_fill_dentries(ctx, &d, 0)) ctx->pos = NR_INLINE_DENTRY; f2fs_put_page(ipage, 1); |