Re: [RFC] lustre treatment of dentry->d_name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux