aboutsummaryrefslogtreecommitdiffstats
path: root/fs/file_table.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-11-13 18:39:18 -0500
committerJames Morris <jmorris@namei.org>2008-11-13 18:39:18 -0500
commit86a264abe542cfececb4df129bc45a0338d8cdb9 (patch)
tree30152f04ba847f311028d5ca697f864c16c7ebb3 /fs/file_table.c
parentf1752eec6145c97163dbce62d17cf5d928e28a27 (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/file_table.c')
-rw-r--r--fs/file_table.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/file_table.c b/fs/file_table.c
index 3152b53cfab0..bc4563fe791d 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -94,7 +94,7 @@ int proc_nr_files(ctl_table *table, int write, struct file *filp,
94 */ 94 */
95struct file *get_empty_filp(void) 95struct file *get_empty_filp(void)
96{ 96{
97 struct task_struct *tsk; 97 const struct cred *cred = current_cred();
98 static int old_max; 98 static int old_max;
99 struct file * f; 99 struct file * f;
100 100
@@ -118,12 +118,11 @@ struct file *get_empty_filp(void)
118 if (security_file_alloc(f)) 118 if (security_file_alloc(f))
119 goto fail_sec; 119 goto fail_sec;
120 120
121 tsk = current;
122 INIT_LIST_HEAD(&f->f_u.fu_list); 121 INIT_LIST_HEAD(&f->f_u.fu_list);
123 atomic_long_set(&f->f_count, 1); 122 atomic_long_set(&f->f_count, 1);
124 rwlock_init(&f->f_owner.lock); 123 rwlock_init(&f->f_owner.lock);
125 f->f_uid = tsk->cred->fsuid; 124 f->f_uid = cred->fsuid;
126 f->f_gid = tsk->cred->fsgid; 125 f->f_gid = cred->fsgid;
127 eventpoll_init_file(f); 126 eventpoll_init_file(f);
128 /* f->f_version: 0 */ 127 /* f->f_version: 0 */
129 return f; 128 return f;