aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-05-08 05:09:30 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-05-08 05:23:21 -0400
commit70ff5dfeb6913cc434d42c7e0cbff16b99d9ae15 (patch)
tree57397a26f3212b946e989c94cf7839c9648b11f4
parentadf8d90b6a949dc80e827263fccb31f8eb08a55d (diff)
f2fs: use inode_init_owner() to simplify codes
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>
-rw-r--r--fs/f2fs/namei.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index a9409d19dfd4..9138c32aa698 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -41,18 +41,9 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
41 } 41 }
42 f2fs_unlock_op(sbi); 42 f2fs_unlock_op(sbi);
43 43
44 inode->i_uid = current_fsuid(); 44 inode_init_owner(inode, dir, mode);
45
46 if (dir->i_mode & S_ISGID) {
47 inode->i_gid = dir->i_gid;
48 if (S_ISDIR(mode))
49 mode |= S_ISGID;
50 } else {
51 inode->i_gid = current_fsgid();
52 }
53 45
54 inode->i_ino = ino; 46 inode->i_ino = ino;
55 inode->i_mode = mode;
56 inode->i_blocks = 0; 47 inode->i_blocks = 0;
57 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 48 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
58 inode->i_generation = sbi->s_next_generation++; 49 inode->i_generation = sbi->s_next_generation++;