diff options
author | David Howells <dhowells@redhat.com> | 2008-11-13 18:39:18 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2008-11-13 18:39:18 -0500 |
commit | 86a264abe542cfececb4df129bc45a0338d8cdb9 (patch) | |
tree | 30152f04ba847f311028d5ca697f864c16c7ebb3 /fs/hugetlbfs/inode.c | |
parent | f1752eec6145c97163dbce62d17cf5d928e28a27 (diff) |
CRED: Wrap current->cred and a few other accessors
Wrap current->cred and a few other accessors to hide their actual
implementation.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'fs/hugetlbfs/inode.c')
-rw-r--r-- | fs/hugetlbfs/inode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 870a721b8bd2..7d479ce3aceb 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -951,6 +951,7 @@ struct file *hugetlb_file_setup(const char *name, size_t size) | |||
951 | struct inode *inode; | 951 | struct inode *inode; |
952 | struct dentry *dentry, *root; | 952 | struct dentry *dentry, *root; |
953 | struct qstr quick_string; | 953 | struct qstr quick_string; |
954 | struct user_struct *user = current_user(); | ||
954 | 955 | ||
955 | if (!hugetlbfs_vfsmount) | 956 | if (!hugetlbfs_vfsmount) |
956 | return ERR_PTR(-ENOENT); | 957 | return ERR_PTR(-ENOENT); |
@@ -958,7 +959,7 @@ struct file *hugetlb_file_setup(const char *name, size_t size) | |||
958 | if (!can_do_hugetlb_shm()) | 959 | if (!can_do_hugetlb_shm()) |
959 | return ERR_PTR(-EPERM); | 960 | return ERR_PTR(-EPERM); |
960 | 961 | ||
961 | if (!user_shm_lock(size, current->cred->user)) | 962 | if (!user_shm_lock(size, user)) |
962 | return ERR_PTR(-ENOMEM); | 963 | return ERR_PTR(-ENOMEM); |
963 | 964 | ||
964 | root = hugetlbfs_vfsmount->mnt_root; | 965 | root = hugetlbfs_vfsmount->mnt_root; |
@@ -998,7 +999,7 @@ out_inode: | |||
998 | out_dentry: | 999 | out_dentry: |
999 | dput(dentry); | 1000 | dput(dentry); |
1000 | out_shm_unlock: | 1001 | out_shm_unlock: |
1001 | user_shm_unlock(size, current->cred->user); | 1002 | user_shm_unlock(size, user); |
1002 | return ERR_PTR(error); | 1003 | return ERR_PTR(error); |
1003 | } | 1004 | } |
1004 | 1005 | ||