From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Monakhov Subject: [PATCH 07/19] ext3: replace inode uid,gid,mode init with helper v2 Date: Thu, 4 Mar 2010 17:31:50 +0300 Message-ID: <1267713111-9228-5-git-send-email-dmonakhov@openvz.org> References: <1267712897-9088-1-git-send-email-dmonakhov@openvz.org> Cc: Dmitry Monakhov To: linux-fsdevel@vger.kernel.org Return-path: Received: from mail-bw0-f209.google.com ([209.85.218.209]:58394 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752526Ab0CDOcF (ORCPT ); Thu, 4 Mar 2010 09:32:05 -0500 Received: by mail-bw0-f209.google.com with SMTP id 1so417045bwz.21 for ; Thu, 04 Mar 2010 06:32:04 -0800 (PST) In-Reply-To: <1267712897-9088-1-git-send-email-dmonakhov@openvz.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Acked-by: Jan Kara Signed-off-by: Dmitry Monakhov --- fs/ext3/ialloc.c | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c index b399912..1a48294 100644 --- a/fs/ext3/ialloc.c +++ b/fs/ext3/ialloc.c @@ -538,16 +538,13 @@ got: if (S_ISDIR(mode)) percpu_counter_inc(&sbi->s_dirs_counter); - inode->i_uid = current_fsuid(); - if (test_opt (sb, GRPID)) - inode->i_gid = dir->i_gid; - else if (dir->i_mode & S_ISGID) { + + if (test_opt(sb, GRPID)) { + inode->i_mode = mode; + inode->i_uid = current_fsuid(); inode->i_gid = dir->i_gid; - if (S_ISDIR(mode)) - mode |= S_ISGID; } else - inode->i_gid = current_fsgid(); - inode->i_mode = mode; + inode_init_owner(inode, dir, mode); inode->i_ino = ino; /* This is the optimal IO size (for stat), not the fs block size */ -- 1.6.6