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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/file_table.c b/fs/file_table.c
index bbeeac6efa1a..54018fe48840 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -13,6 +13,7 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/fs.h> 14#include <linux/fs.h>
15#include <linux/security.h> 15#include <linux/security.h>
16#include <linux/ima.h>
16#include <linux/eventpoll.h> 17#include <linux/eventpoll.h>
17#include <linux/rcupdate.h> 18#include <linux/rcupdate.h>
18#include <linux/mount.h> 19#include <linux/mount.h>
@@ -127,6 +128,7 @@ struct file *get_empty_filp(void)
127 atomic_long_set(&f->f_count, 1); 128 atomic_long_set(&f->f_count, 1);
128 rwlock_init(&f->f_owner.lock); 129 rwlock_init(&f->f_owner.lock);
129 f->f_cred = get_cred(cred); 130 f->f_cred = get_cred(cred);
131 spin_lock_init(&f->f_lock);
130 eventpoll_init_file(f); 132 eventpoll_init_file(f);
131 /* f->f_version: 0 */ 133 /* f->f_version: 0 */
132 return f; 134 return f;
@@ -167,7 +169,6 @@ struct file *alloc_file(struct vfsmount *mnt, struct dentry *dentry,
167 fmode_t mode, const struct file_operations *fop) 169 fmode_t mode, const struct file_operations *fop)
168{ 170{
169 struct file *file; 171 struct file *file;
170 struct path;
171 172
172 file = get_empty_filp(); 173 file = get_empty_filp();
173 if (!file) 174 if (!file)
@@ -279,6 +280,7 @@ void __fput(struct file *file)
279 if (file->f_op && file->f_op->release) 280 if (file->f_op && file->f_op->release)
280 file->f_op->release(inode, file); 281 file->f_op->release(inode, file);
281 security_file_free(file); 282 security_file_free(file);
283 ima_file_free(file);
282 if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL)) 284 if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL))
283 cdev_put(inode->i_cdev); 285 cdev_put(inode->i_cdev);
284 fops_put(file->f_op); 286 fops_put(file->f_op);