Commit 70ff5dfe authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

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: default avatarChao Yu <chao2.yu@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent adf8d90b
...@@ -41,18 +41,9 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode) ...@@ -41,18 +41,9 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
} }
f2fs_unlock_op(sbi); f2fs_unlock_op(sbi);
inode->i_uid = current_fsuid(); inode_init_owner(inode, dir, mode);
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->i_ino = ino; inode->i_ino = ino;
inode->i_mode = mode;
inode->i_blocks = 0; inode->i_blocks = 0;
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
inode->i_generation = sbi->s_next_generation++; inode->i_generation = sbi->s_next_generation++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment