Skip to content

Commit e00117f

Browse files
Dmitry MonakhovAl Viro
authored andcommitted
exofs: replace inode uid,gid,mode initialization with helper function
Ack-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent ecc11fa commit e00117f

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

‎fs/exofs/inode.c‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,16 +1123,7 @@ struct inode *exofs_new_inode(struct inode *dir, int mode)
11231123
sbi = sb->s_fs_info;
11241124

11251125
sb->s_dirt = 1;
1126-
inode->i_uid = current->cred->fsuid;
1127-
if (dir->i_mode & S_ISGID) {
1128-
inode->i_gid = dir->i_gid;
1129-
if (S_ISDIR(mode))
1130-
mode |= S_ISGID;
1131-
} else {
1132-
inode->i_gid = current->cred->fsgid;
1133-
}
1134-
inode->i_mode = mode;
1135-
1126+
inode_init_owner(inode, dir, mode);
11361127
inode->i_ino = sbi->s_nextid++;
11371128
inode->i_blkbits = EXOFS_BLKSHIFT;
11381129
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;

0 commit comments

Comments
 (0)