From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [RFC] lustre treatment of dentry->d_name Date: Tue, 21 Oct 2014 03:55:47 +0100 Message-ID: <20141021025547.GQ7996@ZenIV.linux.org.uk> References: <20141021011346.GP7996@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, Andreas Dilger To: Oleg Drokin Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:56154 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754158AbaJUCzu (ORCPT ); Mon, 20 Oct 2014 22:55:50 -0400 Content-Disposition: inline In-Reply-To: <20141021011346.GP7996@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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?