summaryrefslogtreecommitdiffstats
path: root/fs/file_table.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2011-03-16 09:41:17 +1100
committerJames Morris <jmorris@namei.org>2011-03-16 09:41:17 +1100
commita002951c97ff8da49938c982a4c236bf2fafdc9f (patch)
treed43e7885ea7376df0a47a0fc8ceca66dc5bfa357 /fs/file_table.c
parent521cb40b0c44418a4fd36dc633f575813d59a43d (diff)
parentc151694b2c48d956ac8c8c59c6927f89cc29ef70 (diff)
downloadlinux-a002951c97ff8da49938c982a4c236bf2fafdc9f.tar.gz
linux-a002951c97ff8da49938c982a4c236bf2fafdc9f.tar.bz2
linux-a002951c97ff8da49938c982a4c236bf2fafdc9f.zip
Merge branch 'next' into for-linus
Diffstat (limited to 'fs/file_table.c')
-rw-r--r--fs/file_table.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/file_table.c b/fs/file_table.c
index eb36b6b17e26..cbeec70ee310 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -190,7 +190,8 @@ struct file *alloc_file(struct path *path, fmode_t mode,
file_take_write(file);
WARN_ON(mnt_clone_write(path->mnt));
}
- ima_counts_get(file);
+ if ((mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ)
+ i_readcount_inc(path->dentry->d_inode);
return file;
}
EXPORT_SYMBOL(alloc_file);
@@ -251,6 +252,8 @@ static void __fput(struct file *file)
fops_put(file->f_op);
put_pid(file->f_owner.pid);
file_sb_list_del(file);
+ if ((file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ)
+ i_readcount_dec(inode);
if (file->f_mode & FMODE_WRITE)
drop_file_write_access(file);
file->f_path.dentry = NULL;