Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chao Yu and committed by
Jaegeuk Kim
291bf80b 17a0ee55

+6 -16
+6 -16
fs/f2fs/dir.c
··· 341 341 void do_make_empty_dir(struct inode *inode, struct inode *parent, 342 342 struct f2fs_dentry_ptr *d) 343 343 { 344 - struct f2fs_dir_entry *de; 344 + struct qstr dot = QSTR_INIT(".", 1); 345 + struct qstr dotdot = QSTR_INIT("..", 2); 345 346 346 - de = &d->dentry[0]; 347 - de->name_len = cpu_to_le16(1); 348 - de->hash_code = 0; 349 - de->ino = cpu_to_le32(inode->i_ino); 350 - memcpy(d->filename[0], ".", 1); 351 - set_de_type(de, inode->i_mode); 347 + /* update dirent of "." */ 348 + f2fs_update_dentry(inode->i_ino, inode->i_mode, d, &dot, 0, 0); 352 349 353 - de = &d->dentry[1]; 354 - de->hash_code = 0; 355 - de->name_len = cpu_to_le16(2); 356 - de->ino = cpu_to_le32(parent->i_ino); 357 - memcpy(d->filename[1], "..", 2); 358 - set_de_type(de, parent->i_mode); 359 - 360 - test_and_set_bit_le(0, (void *)d->bitmap); 361 - test_and_set_bit_le(1, (void *)d->bitmap); 350 + /* update dirent of ".." */ 351 + f2fs_update_dentry(parent->i_ino, parent->i_mode, d, &dotdot, 0, 1); 362 352 } 363 353 364 354 static int make_empty_dir(struct inode *inode,