From 0552f879d45cecc35d8e372a591fc5ed863bca58 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 16 Dec 2009 04:53:03 -0500 Subject: Untangling ima mess, part 1: alloc_file() There are 2 groups of alloc_file() callers: * ones that are followed by ima_counts_get * ones giving non-regular files So let's pull that ima_counts_get() into alloc_file(); it's a no-op in case of non-regular files. Signed-off-by: Al Viro --- fs/file_table.c | 2 ++ fs/hugetlbfs/inode.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'fs') diff --git a/fs/file_table.c b/fs/file_table.c index 361d76be829..17a55b81be2 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -190,6 +191,7 @@ struct file *alloc_file(struct path *path, fmode_t mode, error = mnt_clone_write(path->mnt); WARN_ON(error); } + ima_counts_get(file); return file; } diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 6bd41525cd7..a0bbd3d1b41 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -971,7 +970,6 @@ struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag, &hugetlbfs_file_operations); if (!file) goto out_dentry; /* inode is already attached */ - ima_counts_get(file); return file; -- cgit v1.2.3