From: Jeff Layton <jlayton@kernel.org>
To: Luis Chamberlain <mcgrof@kernel.org>, Xiubo Li <xiubli@redhat.com>
Cc: idryomov@gmail.com, viro@zeniv.linux.org.uk, willy@infradead.org,
vshankar@redhat.com, ceph-devel@vger.kernel.org, arnd@arndb.de,
akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/2] fs/dcache: add d_compare() helper support
Date: Mon, 23 May 2022 14:09:26 -0400 [thread overview]
Message-ID: <cb6bcf221e28deb8dcaf5c02fba6c2257586363e.camel@kernel.org> (raw)
In-Reply-To: <YovK86vEmOUUoBn6@bombadil.infradead.org>
On Mon, 2022-05-23 at 10:57 -0700, Luis Chamberlain wrote:
> On Thu, May 19, 2022 at 06:18:45PM +0800, Xiubo Li wrote:
> > Reviewed-by: Jeff Layton <jlayton@kernel.org>
> > Signed-off-by: Xiubo Li <xiubli@redhat.com>
> > ---
> > fs/dcache.c | 15 +++++++++++++++
> > include/linux/dcache.h | 2 ++
> > 2 files changed, 17 insertions(+)
> >
> > diff --git a/fs/dcache.c b/fs/dcache.c
> > index 93f4f5ee07bf..95a72f92a94b 100644
> > --- a/fs/dcache.c
> > +++ b/fs/dcache.c
> > @@ -2262,6 +2262,21 @@ static inline bool d_same_name(const struct dentry *dentry,
> > name) == 0;
> > }
> >
> > +/**
> > + * d_compare - compare dentry name with case-exact name
> > + * @parent: parent dentry
> > + * @dentry: the negative dentry that was passed to the parent's lookup func
> > + * @name: the case-exact name to be associated with the returned dentry
> > + *
> > + * Return: 0 if names are same, or 1
> > + */
> > +bool d_compare(const struct dentry *parent, const struct dentry *dentry,
> > + const struct qstr *name)
> > +{
> > + return !d_same_name(dentry, parent, name);
>
> What's wrong with d_same_name()? Why introduce a whole new operation
> and export it when you the same prototype except first and second
> argument moved with an even more confusing name?
>
Agreed. That would be better.
> > +}
> > +EXPORT_SYMBOL(d_compare);
>
> New symbols should go with EXPORT_SYMBOL_GPL() instead.
>
> Luis
In the past, Al has pushed back against that since EXPORT_SYMBOL_GPL has
no clear legal meaning. He may have changed his opinion since, but I
haven't heard that that was the case.
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2022-05-23 18:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-19 10:18 [PATCH v5 0/2] ceph: wait async unlink to finish Xiubo Li
2022-05-19 10:18 ` [PATCH v5 1/2] fs/dcache: add d_compare() helper support Xiubo Li
2022-05-23 17:57 ` Luis Chamberlain
2022-05-23 18:09 ` Jeff Layton [this message]
2022-05-24 1:46 ` Xiubo Li
2022-05-23 20:11 ` Matthew Wilcox
2022-05-24 1:32 ` Xiubo Li
2022-05-19 10:18 ` [PATCH v5 2/2] ceph: wait the first reply of inflight async unlink Xiubo Li
2022-05-19 11:30 ` Jeff Layton
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=cb6bcf221e28deb8dcaf5c02fba6c2257586363e.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=vshankar@redhat.com \
--cc=willy@infradead.org \
--cc=xiubli@redhat.com \
/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).