diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-10-18 23:06:41 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-11-03 16:07:34 -0800 |
commit | 062a3e7ba7eebcd7d44e49e9510135f901f93f48 (patch) | |
tree | d3796be4f5bfe0169f182be8c3c83822926a7012 /fs/f2fs/inline.c | |
parent | 7b3cd7d6f026784b1a2a74b6e207b26253d9d780 (diff) | |
download | linux-stable-062a3e7ba7eebcd7d44e49e9510135f901f93f48.tar.gz linux-stable-062a3e7ba7eebcd7d44e49e9510135f901f93f48.tar.bz2 linux-stable-062a3e7ba7eebcd7d44e49e9510135f901f93f48.zip |
f2fs: reuse make_empty_dir code for inline_dentry
This patch introduces do_make_empty_dir to mitigate code redundancy
for inline_dentry.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inline.c')
-rw-r--r-- | fs/f2fs/inline.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index 445e99d6f6ee..a30984505f16 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -314,26 +314,12 @@ int make_empty_inline_dir(struct inode *inode, struct inode *parent, struct page *ipage) { struct f2fs_inline_dentry *dentry_blk; - struct f2fs_dir_entry *de; + struct f2fs_dentry_ptr d; dentry_blk = inline_data_addr(ipage); - de = &dentry_blk->dentry[0]; - de->name_len = cpu_to_le16(1); - de->hash_code = 0; - de->ino = cpu_to_le32(inode->i_ino); - memcpy(dentry_blk->filename[0], ".", 1); - set_de_type(de, inode); - - de = &dentry_blk->dentry[1]; - de->hash_code = 0; - de->name_len = cpu_to_le16(2); - de->ino = cpu_to_le32(parent->i_ino); - memcpy(dentry_blk->filename[1], "..", 2); - set_de_type(de, inode); - - test_and_set_bit_le(0, &dentry_blk->dentry_bitmap); - test_and_set_bit_le(1, &dentry_blk->dentry_bitmap); + make_dentry_ptr(&d, (void *)dentry_blk, 2); + do_make_empty_dir(inode, parent, &d); set_page_dirty(ipage); |