aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2016-03-09 22:07:28 +0800
committerMister Oyster <oysterized@gmail.com>2017-04-13 12:33:13 +0200
commit0d85f2e9b77b5fe1c26e6b29f22810723f7710ed (patch)
treed42c0388e13046d413309a2f111d9bce0399571c
parentbc4529a33bf1ea46752dc3309603c9723186bd17 (diff)
downloadandroid_kernel_m2note-0d85f2e9b77b5fe1c26e6b29f22810723f7710ed.tar.gz
f2fs: clean up opened code with f2fs_update_dentry
Just clean up opened code with existing function, no logic change. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/dir.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index 9b01d6c49..c5ecdfac0 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -343,24 +343,14 @@ int update_dent_inode(struct inode *inode, struct inode *to,
void do_make_empty_dir(struct inode *inode, struct inode *parent,
struct f2fs_dentry_ptr *d)
{
- struct f2fs_dir_entry *de;
-
- de = &d->dentry[0];
- de->name_len = cpu_to_le16(1);
- de->hash_code = 0;
- de->ino = cpu_to_le32(inode->i_ino);
- memcpy(d->filename[0], ".", 1);
- set_de_type(de, inode->i_mode);
+ struct qstr dot = QSTR_INIT(".", 1);
+ struct qstr dotdot = QSTR_INIT("..", 2);
- de = &d->dentry[1];
- de->hash_code = 0;
- de->name_len = cpu_to_le16(2);
- de->ino = cpu_to_le32(parent->i_ino);
- memcpy(d->filename[1], "..", 2);
- set_de_type(de, parent->i_mode);
+ /* update dirent of "." */
+ f2fs_update_dentry(inode->i_ino, inode->i_mode, d, &dot, 0, 0);
- test_and_set_bit_le(0, (void *)d->bitmap);
- test_and_set_bit_le(1, (void *)d->bitmap);
+ /* update dirent of ".." */
+ f2fs_update_dentry(parent->i_ino, parent->i_mode, d, &dotdot, 0, 1);
}
static int make_empty_dir(struct inode *inode,