diff options
author | David Howells <dhowells@redhat.com> | 2008-11-13 18:38:44 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2008-11-13 18:38:44 -0500 |
commit | f8b9d53a31dca2c1185232c5fe2731d99cc963c8 (patch) | |
tree | 7725eafec2f04595e439feb94c3b5ae04cf478c6 | |
parent | cd80ca8a03fd712b046028c1f66e10f3aec43eee (diff) |
CRED: Wrap task credential accesses in 9P2000 filesystem
Wrap access to task credentials so that they can be separated more easily from
the task_struct during the introduction of COW creds.
Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().
Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more
sense to use RCU directly rather than a convenient wrapper; these will be
addressed by later patches.
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Reviewed-by: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Ron Minnich <rminnich@sandia.gov>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Cc: v9fs-developer@lists.sourceforge.net
Signed-off-by: James Morris <jmorris@namei.org>
-rw-r--r-- | fs/9p/fid.c | 2 | ||||
-rw-r--r-- | fs/9p/vfs_inode.c | 4 | ||||
-rw-r--r-- | fs/9p/vfs_super.c | 4 | ||||
-rw-r--r-- | net/9p/client.c | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/fs/9p/fid.c b/fs/9p/fid.c index 3031e3233dd6..a43e4ab7c6c3 100644 --- a/fs/9p/fid.c +++ b/fs/9p/fid.c | |||
@@ -120,7 +120,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry) | |||
120 | switch (access) { | 120 | switch (access) { |
121 | case V9FS_ACCESS_SINGLE: | 121 | case V9FS_ACCESS_SINGLE: |
122 | case V9FS_ACCESS_USER: | 122 | case V9FS_ACCESS_USER: |
123 | uid = current->fsuid; | 123 | uid = current_fsuid(); |
124 | any = 0; | 124 | any = 0; |
125 | break; | 125 | break; |
126 | 126 | ||
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 8314d3f43b71..8fddfe86a0dc 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -215,8 +215,8 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode) | |||
215 | inode = new_inode(sb); | 215 | inode = new_inode(sb); |
216 | if (inode) { | 216 | if (inode) { |
217 | inode->i_mode = mode; | 217 | inode->i_mode = mode; |
218 | inode->i_uid = current->fsuid; | 218 | inode->i_uid = current_fsuid(); |
219 | inode->i_gid = current->fsgid; | 219 | inode->i_gid = current_fsgid(); |
220 | inode->i_blocks = 0; | 220 | inode->i_blocks = 0; |
221 | inode->i_rdev = 0; | 221 | inode->i_rdev = 0; |
222 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 222 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index d6cb1a0ca724..93212e40221a 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c | |||
@@ -113,8 +113,8 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags, | |||
113 | struct v9fs_session_info *v9ses = NULL; | 113 | struct v9fs_session_info *v9ses = NULL; |
114 | struct p9_wstat *st = NULL; | 114 | struct p9_wstat *st = NULL; |
115 | int mode = S_IRWXUGO | S_ISVTX; | 115 | int mode = S_IRWXUGO | S_ISVTX; |
116 | uid_t uid = current->fsuid; | 116 | uid_t uid = current_fsuid(); |
117 | gid_t gid = current->fsgid; | 117 | gid_t gid = current_fsgid(); |
118 | struct p9_fid *fid; | 118 | struct p9_fid *fid; |
119 | int retval = 0; | 119 | int retval = 0; |
120 | 120 | ||
diff --git a/net/9p/client.c b/net/9p/client.c index 67717f69412e..c3fb6f8bfa92 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -628,7 +628,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt) | |||
628 | memset(&fid->qid, 0, sizeof(struct p9_qid)); | 628 | memset(&fid->qid, 0, sizeof(struct p9_qid)); |
629 | fid->mode = -1; | 629 | fid->mode = -1; |
630 | fid->rdir_fpos = 0; | 630 | fid->rdir_fpos = 0; |
631 | fid->uid = current->fsuid; | 631 | fid->uid = current_fsuid(); |
632 | fid->clnt = clnt; | 632 | fid->clnt = clnt; |
633 | fid->aux = NULL; | 633 | fid->aux = NULL; |
634 | 634 | ||