aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2013-01-30 14:48:53 -0500
committerEric W. Biederman <ebiederm@xmission.com>2013-02-12 06:19:32 -0500
commitb464255699077c6b33ea58ee01db80f5729511ad (patch)
treea4ef7b3a8e80ccc17024c58a0bc5155a9123301a /fs/9p
parent447c50943fd008755122c7a62bac068e73c1cf2c (diff)
9p: Modify struct 9p_fid to use a kuid_t not a uid_t
Change struct 9p_fid and it's associated functions to use kuid_t's instead of uid_t. Cc: Eric Van Hensbergen <ericvh@gmail.com> Cc: Ron Minnich <rminnich@gmail.com> Cc: Latchesar Ionkov <lucho@ionkov.net> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/9p')
-rw-r--r--fs/9p/fid.c17
-rw-r--r--fs/9p/v9fs.c2
2 files changed, 10 insertions, 9 deletions
diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index da8eefbe830d..afd4724b2d92 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -74,19 +74,20 @@ int v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid)
74 * 74 *
75 */ 75 */
76 76
77static struct p9_fid *v9fs_fid_find(struct dentry *dentry, u32 uid, int any) 77static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any)
78{ 78{
79 struct v9fs_dentry *dent; 79 struct v9fs_dentry *dent;
80 struct p9_fid *fid, *ret; 80 struct p9_fid *fid, *ret;
81 81
82 p9_debug(P9_DEBUG_VFS, " dentry: %s (%p) uid %d any %d\n", 82 p9_debug(P9_DEBUG_VFS, " dentry: %s (%p) uid %d any %d\n",
83 dentry->d_name.name, dentry, uid, any); 83 dentry->d_name.name, dentry, from_kuid(&init_user_ns, uid),
84 any);
84 dent = (struct v9fs_dentry *) dentry->d_fsdata; 85 dent = (struct v9fs_dentry *) dentry->d_fsdata;
85 ret = NULL; 86 ret = NULL;
86 if (dent) { 87 if (dent) {
87 spin_lock(&dent->lock); 88 spin_lock(&dent->lock);
88 list_for_each_entry(fid, &dent->fidlist, dlist) { 89 list_for_each_entry(fid, &dent->fidlist, dlist) {
89 if (any || fid->uid == uid) { 90 if (any || uid_eq(fid->uid, uid)) {
90 ret = fid; 91 ret = fid;
91 break; 92 break;
92 } 93 }
@@ -126,7 +127,7 @@ err_out:
126} 127}
127 128
128static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry, 129static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry,
129 uid_t uid, int any) 130 kuid_t uid, int any)
130{ 131{
131 struct dentry *ds; 132 struct dentry *ds;
132 char **wnames, *uname; 133 char **wnames, *uname;
@@ -233,7 +234,7 @@ err_out:
233 234
234struct p9_fid *v9fs_fid_lookup(struct dentry *dentry) 235struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
235{ 236{
236 uid_t uid; 237 kuid_t uid;
237 int any, access; 238 int any, access;
238 struct v9fs_session_info *v9ses; 239 struct v9fs_session_info *v9ses;
239 240
@@ -253,7 +254,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
253 break; 254 break;
254 255
255 default: 256 default:
256 uid = ~0; 257 uid = INVALID_UID;
257 any = 0; 258 any = 0;
258 break; 259 break;
259 } 260 }
@@ -272,7 +273,7 @@ struct p9_fid *v9fs_fid_clone(struct dentry *dentry)
272 return ret; 273 return ret;
273} 274}
274 275
275static struct p9_fid *v9fs_fid_clone_with_uid(struct dentry *dentry, uid_t uid) 276static struct p9_fid *v9fs_fid_clone_with_uid(struct dentry *dentry, kuid_t uid)
276{ 277{
277 struct p9_fid *fid, *ret; 278 struct p9_fid *fid, *ret;
278 279
@@ -289,7 +290,7 @@ struct p9_fid *v9fs_writeback_fid(struct dentry *dentry)
289 int err; 290 int err;
290 struct p9_fid *fid; 291 struct p9_fid *fid;
291 292
292 fid = v9fs_fid_clone_with_uid(dentry, 0); 293 fid = v9fs_fid_clone_with_uid(dentry, GLOBAL_ROOT_UID);
293 if (IS_ERR(fid)) 294 if (IS_ERR(fid))
294 goto error_out; 295 goto error_out;
295 /* 296 /*
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 4e0bd9d62ed6..d64967cbd73e 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -387,7 +387,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
387 if ((v9ses->flags & V9FS_ACCESS_MASK) == V9FS_ACCESS_SINGLE) 387 if ((v9ses->flags & V9FS_ACCESS_MASK) == V9FS_ACCESS_SINGLE)
388 fid->uid = v9ses->uid; 388 fid->uid = v9ses->uid;
389 else 389 else
390 fid->uid = ~0; 390 fid->uid = INVALID_UID;
391 391
392#ifdef CONFIG_9P_FSCACHE 392#ifdef CONFIG_9P_FSCACHE
393 /* register the session for caching */ 393 /* register the session for caching */