f2fs: use inode_init_owner() to simplify codes
authorChao Yu <chao2.yu@samsung.com>
Thu, 8 May 2014 09:09:30 +0000 (17:09 +0800)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Thu, 8 May 2014 09:23:21 +0000 (18:23 +0900)
This patch uses exported inode_init_owner() to simplify codes in
f2fs_new_inode().

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/namei.c

index a9409d19dfd4815f38907b93f84ad3428383b07a..9138c32aa69864b3e2b1ee40f08135383b5918b1 100644 (file)
@@ -41,18 +41,9 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
        }
        f2fs_unlock_op(sbi);
 
-       inode->i_uid = current_fsuid();
-
-       if (dir->i_mode & S_ISGID) {
-               inode->i_gid = dir->i_gid;
-               if (S_ISDIR(mode))
-                       mode |= S_ISGID;
-       } else {
-               inode->i_gid = current_fsgid();
-       }
+       inode_init_owner(inode, dir, mode);
 
        inode->i_ino = ino;
-       inode->i_mode = mode;
        inode->i_blocks = 0;
        inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
        inode->i_generation = sbi->s_next_generation++;