From: Dmitry Monakhov <dmonakhov@openvz.org>
To: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Cc: linux-fsdevel@vger.kernel.org, jfs-discussion@lists.sourceforge.net
Subject: [PATCH 09/19] jfs: replace inode uid,gid,mode init with helper v2
Date: Thu, 18 Feb 2010 10:12:13 +0300 [thread overview]
Message-ID: <87fx4z9fw2.fsf_-_@openvz.org> (raw)
In-Reply-To: <1266443832.10249.18.camel@norville.austin.ibm.com> (Dave Kleikamp's message of "Wed, 17 Feb 2010 15:57:12 -0600")
[-- Attachment #1: Type: text/plain, Size: 421 bytes --]
Dave Kleikamp <shaggy@linux.vnet.ibm.com> writes:
> Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
>
> One minor nit though. jfs maintains jfs_inode->mode2 which is a
> superset of inode->i_mode. Since inode_init_owner() may set S_ISGID,
> the following change should also be made. (I don't think these
> duplicate bits in mode2 are really important, but we may as well be
> consistent.)
Folded in to one patch.
[-- Attachment #2: 0009-jfs-replace-inode-uid-gid-mode-init-with-helper-v2.patch --]
[-- Type: text/plain, Size: 1499 bytes --]
>From fae29b54bd3735a9723499bc6110c533089b79fe Mon Sep 17 00:00:00 2001
From: Dmitry Monakhov <dmonakhov@openvz.org>
Date: Thu, 18 Feb 2010 09:43:31 +0300
Subject: [PATCH 09/19] jfs: replace inode uid,gid,mode init with helper v2
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
fs/jfs/jfs_inode.c | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/fs/jfs/jfs_inode.c b/fs/jfs/jfs_inode.c
index dc0e021..705646d 100644
--- a/fs/jfs/jfs_inode.c
+++ b/fs/jfs/jfs_inode.c
@@ -98,14 +98,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode)
goto fail_unlock;
}
- inode->i_uid = current_fsuid();
- if (parent->i_mode & S_ISGID) {
- inode->i_gid = parent->i_gid;
- if (S_ISDIR(mode))
- mode |= S_ISGID;
- } else
- inode->i_gid = current_fsgid();
-
+ inode_init_owner(inode, parent, mode);
/*
* New inodes need to save sane values on disk when
* uid & gid mount options are used
@@ -121,7 +114,6 @@ struct inode *ialloc(struct inode *parent, umode_t mode)
goto fail_drop;
}
- inode->i_mode = mode;
/* inherit flags from parent */
jfs_inode->mode2 = JFS_IP(parent)->mode2 & JFS_FL_INHERIT;
@@ -134,7 +126,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode)
if (S_ISLNK(mode))
jfs_inode->mode2 &= ~(JFS_IMMUTABLE_FL|JFS_APPEND_FL);
}
- jfs_inode->mode2 |= mode;
+ jfs_inode->mode2 |= inode->i_mode;
inode->i_blocks = 0;
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
--
1.6.6
next prev parent reply other threads:[~2010-02-18 7:12 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-17 18:29 [PATCH 00/19] fs cleanup: remove duplicated code on inode init Dmitry Monakhov
2010-02-17 18:34 ` [PATCH 01/19] vfs: Add inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 23:03 ` James Morris
2010-02-18 6:57 ` [PATCH 01/19] vfs: Add inode uid,gid,mode init helper v2 Dmitry Monakhov
2010-02-17 18:36 ` [PATCH 02/19] 9p: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 18:37 ` [PATCH 03/19] bfs: " Dmitry Monakhov
2010-02-17 18:38 ` [PATCH 04/19] btrfs: " Dmitry Monakhov
2010-02-17 18:39 ` [PATCH 05/19] exofs: " Dmitry Monakhov
2010-02-20 0:15 ` Boaz Harrosh
2010-02-17 18:40 ` [PATCH 06/19] ext2: " Dmitry Monakhov
2010-02-18 1:21 ` Jan Kara
2010-02-18 7:00 ` [PATCH 06/19] ext2: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-02-18 18:49 ` Jan Kara
2010-02-17 18:40 ` [PATCH 07/19] ext3: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-18 7:02 ` [PATCH 07/19] ext3: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-02-17 18:40 ` [PATCH 08/19] ext4: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 23:39 ` Andreas Dilger
2010-02-18 7:09 ` [PATCH 08/19] ext4: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-02-18 20:52 ` [PATCH 08/19] ext4: replace inode uid,gid,mode initialization with helper function tytso
2010-02-19 10:30 ` Dmitry Monakhov
2010-02-19 14:39 ` [PATCH] ext4: deprecate obsoleted mount options Dmitry Monakhov
2010-02-23 0:28 ` Andreas Dilger
2010-02-23 19:23 ` [PATCH] ext4: deprecate obsoleted mount options v2 Dmitry Monakhov
2010-02-23 20:13 ` tytso
2010-02-24 18:12 ` [PATCH] ext4: deprecate obsoleted mount options v3 Dmitry Monakhov
2010-03-02 3:43 ` tytso
2010-02-17 18:41 ` [PATCH 09/19] jfs: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 21:57 ` Dave Kleikamp
2010-02-18 7:12 ` Dmitry Monakhov [this message]
2010-02-17 18:41 ` [PATCH 10/19] minix: " Dmitry Monakhov
2010-02-17 18:42 ` [PATCH 11/19] nilfs2: " Dmitry Monakhov
2010-02-18 1:28 ` Ryusuke Konishi
2010-02-17 18:43 ` [PATCH 12/19] ocfs2: " Dmitry Monakhov
2010-02-18 4:07 ` Joel Becker
2010-02-17 18:44 ` [PATCH 13/19] omfs: " Dmitry Monakhov
2010-02-17 18:44 ` [PATCH 14/19] ramfs: " Dmitry Monakhov
2010-02-17 18:45 ` [PATCH 15/19] reiserfs: " Dmitry Monakhov
2010-02-17 18:45 ` [PATCH 16/19] sysv: " Dmitry Monakhov
2010-02-17 18:46 ` [PATCH 17/19] ubifs: " Dmitry Monakhov
2010-02-18 10:54 ` Artem Bityutskiy
2010-02-17 18:47 ` [PATCH 18/19] udf: " Dmitry Monakhov
2010-02-17 23:43 ` Jan Kara
2010-02-18 7:18 ` [PATCH 18/19] udf: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-02-18 18:53 ` Jan Kara
2010-02-18 19:55 ` [PATCH 18/19] udf: replace inode uid,gid,mode init with helper v3 Dmitry Monakhov
2010-02-19 10:56 ` Jan Kara
2010-02-17 18:47 ` [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-03-04 14:28 [PATCH 00/19] fs cleanup: remove duplicated code on inode init v2 Dmitry Monakhov
2010-03-04 14:30 ` [PATCH 09/19] jfs: replace inode uid,gid,mode init with helper v2 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=87fx4z9fw2.fsf_-_@openvz.org \
--to=dmonakhov@openvz.org \
--cc=jfs-discussion@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=shaggy@linux.vnet.ibm.com \
/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).