From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Monakhov Subject: [PATCH 15/19] reiserfs: replace inode uid,gid,mode initialization with helper function Date: Thu, 4 Mar 2010 17:32:19 +0300 Message-ID: <1267713143-9258-6-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]:43695 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753626Ab0CDOcl (ORCPT ); Thu, 4 Mar 2010 09:32:41 -0500 Received: by mail-bw0-f209.google.com with SMTP id 1so417071bwz.21 for ; Thu, 04 Mar 2010 06:32:41 -0800 (PST) In-Reply-To: <1267712897-9088-1-git-send-email-dmonakhov@openvz.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Signed-off-by: Dmitry Monakhov --- fs/reiserfs/namei.c | 17 ++++------------- 1 files changed, 4 insertions(+), 13 deletions(-) diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index 9d4dcf0..e138e0a 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c @@ -561,22 +561,13 @@ static int drop_new_inode(struct inode *inode) static int new_inode_init(struct inode *inode, struct inode *dir, int mode) { - /* the quota init calls have to know who to charge the quota to, so - ** we have to set uid and gid here - */ - inode->i_uid = current_fsuid(); - inode->i_mode = mode; /* Make inode invalid - just in case we are going to drop it before * the initialization happens */ INODE_PKEY(inode)->k_objectid = 0; - - if (dir->i_mode & S_ISGID) { - inode->i_gid = dir->i_gid; - if (S_ISDIR(mode)) - inode->i_mode |= S_ISGID; - } else { - inode->i_gid = current_fsgid(); - } + /* the quota init calls have to know who to charge the quota to, so + ** we have to set uid and gid here + */ + inode_init_owner(inode, dir, mode); vfs_dq_init(inode); return 0; } -- 1.6.6