linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: linux-fsdevel@vger.kernel.org
Cc: Dmitry Monakhov <dmonakhov@openvz.org>
Subject: [PATCH 04/19] btrfs: replace inode uid,gid,mode initialization with helper function
Date: Thu,  4 Mar 2010 17:31:47 +0300	[thread overview]
Message-ID: <1267713111-9228-2-git-send-email-dmonakhov@openvz.org> (raw)
In-Reply-To: <1267712897-9088-1-git-send-email-dmonakhov@openvz.org>

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 fs/btrfs/inode.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index c41db6d..a54561f 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4145,16 +4145,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
 	if (ret != 0)
 		goto fail;
 
-	inode->i_uid = current_fsuid();
-
-	if (dir && (dir->i_mode & S_ISGID)) {
-		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 = objectid;
 	inode_set_bytes(inode, 0);
 	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
-- 
1.6.6


  parent reply	other threads:[~2010-03-04 14:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04 14:28 [PATCH 00/19] fs cleanup: remove duplicated code on inode init v2 Dmitry Monakhov
2010-03-04 14:29 ` [PATCH 01/19] vfs: Add inode uid,gid,mode init helper v2 Dmitry Monakhov
2010-03-04 14:30 ` [PATCH 02/19] 9p: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-03-04 14:30 ` [PATCH 09/19] jfs: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-03-04 14:31 ` [PATCH 03/19] bfs: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-03-04 14:31 ` Dmitry Monakhov [this message]
2010-03-04 14:31 ` [PATCH 05/19] exofs: " Dmitry Monakhov
2010-03-04 14:31 ` [PATCH 06/19] ext2: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-03-04 14:31 ` [PATCH 07/19] ext3: " Dmitry Monakhov
2010-03-04 14:31 ` [PATCH 08/19] ext4: " Dmitry Monakhov
2010-03-04 14:32 ` [PATCH 10/19] minix: replace inode uid,gid,mode init with helper Dmitry Monakhov
2010-03-04 14:32 ` [PATCH 11/19] nilfs2: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-03-04 14:32 ` [PATCH 12/19] ocfs2: " Dmitry Monakhov
2010-03-04 14:32 ` [PATCH 13/19] omfs: " Dmitry Monakhov
2010-03-04 14:32 ` [PATCH 14/19] ramfs: " Dmitry Monakhov
2010-03-04 14:32 ` [PATCH 15/19] reiserfs: " Dmitry Monakhov
2010-03-04 14:32 ` [PATCH 16/19] sysv: " Dmitry Monakhov
2010-03-04 14:32 ` [PATCH 17/19] ubifs: " Dmitry Monakhov
2010-03-04 14:32 ` [PATCH 18/19] udf: replace inode uid,gid,mode init with helper v3 Dmitry Monakhov
2010-03-04 14:32 ` [PATCH 19/19] ufs: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
  -- strict thread matches above, loose matches on Subject: below --
2010-02-17 18:29 [PATCH 00/19] fs cleanup: remove duplicated code on inode init Dmitry Monakhov
2010-02-17 18:38 ` [PATCH 04/19] btrfs: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1267713111-9228-2-git-send-email-dmonakhov@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).