From mboxrd@z Thu Jan 1 00:00:00 1970 From: John de la Garza Subject: [PATCH] fs: use kfree_rcu instead of i_callback Date: Sat, 4 Oct 2014 23:00:42 -0400 Message-ID: <20141005030040.GA830@vega.jjdev.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: viro@zeniv.linux.org.uk Return-path: Received: from mail-qg0-f43.google.com ([209.85.192.43]:49704 "EHLO mail-qg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751010AbaJEDCy (ORCPT ); Sat, 4 Oct 2014 23:02:54 -0400 Received: by mail-qg0-f43.google.com with SMTP id j107so2515437qga.16 for ; Sat, 04 Oct 2014 20:02:53 -0700 (PDT) Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Since the callback is doing nothing more than calling kfree() we can use kfree_rcu() instead of having to use a callback. Signed-off-by: John de la Garza --- fs/inode.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 26753ba..51deccd 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -250,12 +250,6 @@ void __destroy_inode(struct inode *inode) } EXPORT_SYMBOL(__destroy_inode); -static void i_callback(struct rcu_head *head) -{ - struct inode *inode = container_of(head, struct inode, i_rcu); - kmem_cache_free(inode_cachep, inode); -} - static void destroy_inode(struct inode *inode) { BUG_ON(!list_empty(&inode->i_lru)); @@ -263,7 +257,7 @@ static void destroy_inode(struct inode *inode) if (inode->i_sb->s_op->destroy_inode) inode->i_sb->s_op->destroy_inode(inode); else - call_rcu(&inode->i_rcu, i_callback); + kfree(inode, i_rcu); } /** -- 2.1.0