From: Rui Xiang <rui.xiang@huawei.com>
To: linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk
Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
linux-rdma@vger.kernel.org, linux-usb@vger.kernel.org,
v9fs-developer@lists.sourceforge.net, linux-mm@kvack.org,
cgroups@vger.kernel.org, netdev@vger.kernel.org,
Rui Xiang <rui.xiang@huawei.com>
Subject: [PATCH 1/2] fs: implement inode uid/gid setting function
Date: Fri, 23 Aug 2013 10:48:37 +0800 [thread overview]
Message-ID: <1377226118-43756-2-git-send-email-rui.xiang@huawei.com> (raw)
In-Reply-To: <1377226118-43756-1-git-send-email-rui.xiang@huawei.com>
Supply a interface inode_set_user to set uid/gid of inode
structs.
Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
---
fs/inode.c | 7 +++++++
include/linux/fs.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/fs/inode.c b/fs/inode.c
index e315c0a..3f90499 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -343,6 +343,13 @@ void inc_nlink(struct inode *inode)
}
EXPORT_SYMBOL(inc_nlink);
+void inode_set_user(struct inode *inode, kuid_t uid, kgid_t gid)
+{
+ inode->i_uid = uid;
+ inode->i_gid = gid;
+}
+EXPORT_SYMBOL(inode_set_user);
+
void address_space_init_once(struct address_space *mapping)
{
memset(mapping, 0, sizeof(*mapping));
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 729e81b..36ac51b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2619,6 +2619,7 @@ void __inode_sub_bytes(struct inode *inode, loff_t bytes);
void inode_sub_bytes(struct inode *inode, loff_t bytes);
loff_t inode_get_bytes(struct inode *inode);
void inode_set_bytes(struct inode *inode, loff_t bytes);
+void inode_set_user(struct inode *inode, kuid_t uid, kgid_t gid);
extern int vfs_readdir(struct file *, filldir_t, void *);
extern int iterate_dir(struct file *, struct dir_context *);
--
1.8.2.2
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2013-08-23 2:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-23 2:48 [PATCH 0/2] fs: supply inode uid/gid setting interface Rui Xiang
2013-08-23 2:48 ` Rui Xiang [this message]
2013-08-23 2:48 ` [PATCH 2/2] fs: use inode_set_user to set uid/gid of inode Rui Xiang
2013-08-23 5:21 ` David Miller
2013-08-23 4:10 ` [PATCH 0/2] fs: supply inode uid/gid setting interface Greg KH
2013-08-23 7:32 ` Rui Xiang
2013-08-27 9:20 ` David Laight
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=1377226118-43756-2-git-send-email-rui.xiang@huawei.com \
--to=rui.xiang@huawei.com \
--cc=cgroups@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=v9fs-developer@lists.sourceforge.net \
--cc=viro@zeniv.linux.org.uk \
/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