aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Monakhov <dmonakhov@openvz.org>2010-03-04 09:31:49 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2010-05-21 18:31:24 -0400
commitffba102d75a2e79ac9754841c6cf4a6dd6892c42 (patch)
treeb7bb51be713a8b665ac97f53ec5872f9abaa9e9c
parente00117f14f68d9e54c8aa3d52ebdc76cdbbc4f87 (diff)
ext2: replace inode uid,gid,mode init with helper
Acked-by: Jan Kara <jack@suse.cz> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/ext2/ialloc.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index f0c5286f9342..938dbc739d00 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -549,16 +549,12 @@ got:
549 549
550 sb->s_dirt = 1; 550 sb->s_dirt = 1;
551 mark_buffer_dirty(bh2); 551 mark_buffer_dirty(bh2);
552 inode->i_uid = current_fsuid(); 552 if (test_opt(sb, GRPID)) {
553 if (test_opt (sb, GRPID)) 553 inode->i_mode = mode;
554 inode->i_uid = current_fsuid();
554 inode->i_gid = dir->i_gid; 555 inode->i_gid = dir->i_gid;
555 else if (dir->i_mode & S_ISGID) {
556 inode->i_gid = dir->i_gid;
557 if (S_ISDIR(mode))
558 mode |= S_ISGID;
559 } else 556 } else
560 inode->i_gid = current_fsgid(); 557 inode_init_owner(inode, dir, mode);
561 inode->i_mode = mode;
562 558
563 inode->i_ino = ino; 559 inode->i_ino = ino;
564 inode->i_blocks = 0; 560 inode->i_blocks = 0;