From: Al Viro <viro@ZenIV.linux.org.uk>
To: Oleg Drokin <oleg.drokin@intel.com>
Cc: linux-fsdevel@vger.kernel.org, Andreas Dilger <andreas.dilger@intel.com>
Subject: Re: [RFC] lustre treatment of dentry->d_name
Date: Tue, 21 Oct 2014 03:55:47 +0100 [thread overview]
Message-ID: <20141021025547.GQ7996@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20141021011346.GP7996@ZenIV.linux.org.uk>
On Tue, Oct 21, 2014 at 02:13:46AM +0100, Al Viro wrote:
> Similar to that, where is ll_d_mountpoint() ever called with NULL dchild,
> why do you have
> if (unlikely(dchild))
> in there when it's true on every call and why does it exist in the first
> place? All its callers are reachable only from vfs_{unlink,rmdir,rename}
> and we *do* d_mountpoint() checks there.
Could somebody explain what this is for?
/* Try to find the child dentry by its name.
If found, put the result fid into @fid. */
static void ll_get_child_fid(struct inode * dir, struct qstr *name,
struct lu_fid *fid)
{
struct dentry *parent, *child;
parent = ll_d_hlist_entry(dir->i_dentry, struct dentry, d_alias);
child = d_lookup(parent, name);
if (child) {
if (child->d_inode)
*fid = *ll_inode2fid(child->d_inode);
dput(child);
}
}
The funny thing being, it's always called from ll_rmdir(), ll_unlink()
or ll_rename(), with name being equal to &dentry->d_name and dir -
dentry->d_parent->d_inode. IOW, that child is already known to caller.
What the hell?
Obvious jokes about exotic adenoidectomy technics aside, what's the story
with that file? Is that just a trimmed down dual-use code that is sometimes
called by VFS and sometimes lives in userland and called by hell knows what?
next prev parent reply other threads:[~2014-10-21 2:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-21 1:13 [RFC] lustre treatment of dentry->d_name Al Viro
2014-10-21 2:55 ` Al Viro [this message]
2014-10-21 3:55 ` Drokin, Oleg
2014-10-21 3:46 ` Drokin, Oleg
2014-10-21 4:02 ` Al Viro
2014-10-21 13:34 ` Drokin, Oleg
2014-10-21 21:17 ` Al Viro
2014-10-22 1:48 ` Drokin, Oleg
2014-10-22 2:50 ` Al Viro
2014-10-22 9:30 ` Drokin, Oleg
2014-10-21 19:30 ` Al Viro
2014-10-22 1:49 ` Drokin, Oleg
2014-10-21 20:07 ` Al Viro
2014-10-22 1:53 ` Drokin, Oleg
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=20141021025547.GQ7996@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=andreas.dilger@intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=oleg.drokin@intel.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).