aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-10-19 01:52:52 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-11-03 19:07:34 -0500
commit7b3cd7d6f026784b1a2a74b6e207b26253d9d780 (patch)
tree25d134417cd0a8cedb380af01c252e8f127f4c8d /fs/f2fs/f2fs.h
parent5ab18570b85cf3071875a36b88bc5ed27d0b6ef7 (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/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h35
1 files changed, 30 insertions, 5 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 3b0f490646af..f7bbfc7d06b8 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -212,6 +212,32 @@ static inline bool __has_cursum_space(struct f2fs_summary_block *sum, int size,
212/* 212/*
213 * For INODE and NODE manager 213 * For INODE and NODE manager
214 */ 214 */
215/* for directory operations */
216struct f2fs_dentry_ptr {
217 const void *bitmap;
218 struct f2fs_dir_entry *dentry;
219 __u8 (*filename)[F2FS_SLOT_LEN];
220 int max;
221};
222
223static inline void make_dentry_ptr(struct f2fs_dentry_ptr *d,
224 void *src, int type)
225{
226 if (type == 1) {
227 struct f2fs_dentry_block *t = (struct f2fs_dentry_block *)src;
228 d->max = NR_DENTRY_IN_BLOCK;
229 d->bitmap = &t->dentry_bitmap;
230 d->dentry = t->dentry;
231 d->filename = t->filename;
232 } else {
233 struct f2fs_inline_dentry *t = (struct f2fs_inline_dentry *)src;
234 d->max = NR_INLINE_DENTRY;
235 d->bitmap = &t->dentry_bitmap;
236 d->dentry = t->dentry;
237 d->filename = t->filename;
238 }
239}
240
215/* 241/*
216 * XATTR_NODE_OFFSET stores xattrs to one node block per file keeping -1 242 * XATTR_NODE_OFFSET stores xattrs to one node block per file keeping -1
217 * as its node offset to distinguish from index node blocks. 243 * as its node offset to distinguish from index node blocks.
@@ -1245,11 +1271,10 @@ struct dentry *f2fs_get_parent(struct dentry *child);
1245 */ 1271 */
1246extern unsigned char f2fs_filetype_table[F2FS_FT_MAX]; 1272extern unsigned char f2fs_filetype_table[F2FS_FT_MAX];
1247void set_de_type(struct f2fs_dir_entry *, struct inode *); 1273void set_de_type(struct f2fs_dir_entry *, struct inode *);
1248struct f2fs_dir_entry *find_target_dentry(struct qstr *, int *, const void *, 1274struct f2fs_dir_entry *find_target_dentry(struct qstr *, int *,
1249 struct f2fs_dir_entry *, __u8 (*)[F2FS_SLOT_LEN]); 1275 struct f2fs_dentry_ptr *);
1250bool f2fs_fill_dentries(struct dir_context *, 1276bool f2fs_fill_dentries(struct dir_context *, struct f2fs_dentry_ptr *,
1251 const void *, struct f2fs_dir_entry *, 1277 unsigned int);
1252 __u8 (*)[F2FS_SLOT_LEN], int, unsigned int);
1253struct page *init_inode_metadata(struct inode *, struct inode *, 1278struct page *init_inode_metadata(struct inode *, struct inode *,
1254 const struct qstr *, struct page *); 1279 const struct qstr *, struct page *);
1255void update_parent_metadata(struct inode *, struct inode *, unsigned int); 1280void update_parent_metadata(struct inode *, struct inode *, unsigned int);