Skip to content

Commit be8ded5

Browse files
Dmitry MonakhovAl Viro
authored andcommitted
ufs: replace inode uid,gid,mode initialization with helper function
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent a6c5a03 commit be8ded5

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

‎fs/ufs/ialloc.c‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,7 @@ struct inode * ufs_new_inode(struct inode * dir, int mode)
303303
sb->s_dirt = 1;
304304

305305
inode->i_ino = cg * uspi->s_ipg + bit;
306-
inode->i_mode = mode;
307-
inode->i_uid = current_fsuid();
308-
if (dir->i_mode & S_ISGID) {
309-
inode->i_gid = dir->i_gid;
310-
if (S_ISDIR(mode))
311-
inode->i_mode |= S_ISGID;
312-
} else
313-
inode->i_gid = current_fsgid();
314-
306+
inode_init_owner(inode, dir, mode);
315307
inode->i_blocks = 0;
316308
inode->i_generation = 0;
317309
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;

0 commit comments

Comments
 (0)