aboutsummaryrefslogtreecommitdiffstats
path: root/fs/file_table.c
diff options
context:
space:
mode:
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;