From: Chuck Ebbert <cebbert.lkml@gmail.com>
To: John de la Garza <john@jjdev.com>
Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: use kfree_rcu instead of i_callback
Date: Sun, 5 Oct 2014 05:24:38 -0500 [thread overview]
Message-ID: <20141005052438.289cc37f@as> (raw)
In-Reply-To: <20141005030040.GA830@vega.jjdev.com>
On Sat, 4 Oct 2014 23:00:42 -0400
John de la Garza <john@jjdev.com> wrote:
> 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 <john@jjdev.com>
> ---
> 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);
Your description says "use kfree_rcu()" but that is kfree(). This won't
even compile.
And as Al pointed out, kfree() is not the same as kmem_cache_free().
So you'd need to invent kmem_cache_free_rcu() also. Not sure that
would have any value elsewhere.
> }
>
> /**
prev parent reply other threads:[~2014-10-05 10:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-05 3:00 [PATCH] fs: use kfree_rcu instead of i_callback John de la Garza
2014-10-05 3:48 ` Al Viro
2014-10-05 10:24 ` Chuck Ebbert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141005052438.289cc37f@as \
--to=cebbert.lkml@gmail.com \
--cc=john@jjdev.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).