@@ -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));
@@ -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 *);
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(+)