Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:45490 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732277AbeGKCYD (ORCPT ); Tue, 10 Jul 2018 22:24:03 -0400 From: Al Viro To: Linus Torvalds Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Miklos Szeredi Subject: [RFC][PATCH 05/42] fold security_file_free() into file_free() Date: Wed, 11 Jul 2018 03:21:29 +0100 Message-Id: <20180711022206.12571-5-viro@ZenIV.linux.org.uk> In-Reply-To: <20180711022206.12571-1-viro@ZenIV.linux.org.uk> References: <20180711021136.GN30522@ZenIV.linux.org.uk> <20180711022206.12571-1-viro@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: Al Viro Signed-off-by: Al Viro --- fs/file_table.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/file_table.c b/fs/file_table.c index 1f14b80a4e67..eee7cf629e52 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -51,6 +51,7 @@ static void file_free_rcu(struct rcu_head *head) static inline void file_free(struct file *f) { + security_file_free(f); percpu_counter_dec(&nr_files); call_rcu(&f->f_u.fu_rcuhead, file_free_rcu); } @@ -207,7 +208,6 @@ static void __fput(struct file *file) } if (file->f_op->release) file->f_op->release(inode, file); - security_file_free(file); if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL && !(file->f_mode & FMODE_PATH))) { cdev_put(inode->i_cdev); @@ -302,10 +302,8 @@ EXPORT_SYMBOL(fput); void put_filp(struct file *file) { - if (atomic_long_dec_and_test(&file->f_count)) { - security_file_free(file); + if (atomic_long_dec_and_test(&file->f_count)) file_free(file); - } } void __init files_init(void) -- 2.11.0