From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Kent Subject: Re: [PATCH v3 1/1] dcache: Translating dentry into pathname without taking rename_lock Date: Sun, 08 Sep 2013 16:51:24 +0800 Message-ID: <1378630284.2642.10.camel@perseus.fritz.box> References: <1378483738-10129-2-git-send-email-Waiman.Long@hp.com> <20130906210546.GW13318@ZenIV.linux.org.uk> <20130907000044.GX13318@ZenIV.linux.org.uk> <20130907030110.GY13318@ZenIV.linux.org.uk> <20130907173243.GD13318@ZenIV.linux.org.uk> <1378613746.2642.8.camel@perseus.fritz.box> <20130908045814.GG13318@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Linus Torvalds , Waiman Long , linux-fsdevel , Linux Kernel Mailing List , "Chandramouleeswaran, Aswin" , "Norton, Scott J" , George Spelvin , John Stoffel , Sage Weil To: Al Viro Return-path: In-Reply-To: <20130908045814.GG13318@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sun, 2013-09-08 at 05:58 +0100, Al Viro wrote: > On Sun, Sep 08, 2013 at 12:15:46PM +0800, Ian Kent wrote: > > > and *name is never modified in it. Why not simply pass it by value? > > > Moreover, I'm not sure I understand what do we need sbi->fs_lock in > > > there. Other than that, it's very close to dentry_path() (well, that > > > and different calling conventions). Ian? > > > > Yes, it is close to dentry_path() but the path functions used to return > > the full path to the root, although I don't see where dentry_path() get > > the root, mmm ... > > dentry_path(), unlike d_path(), is relative to the root of filesystem > containing dentry in question. There are 3 of those suckers: > d_path(): vfsmount/dentry => path to current process' root > d_absolute_path(): ditto, but ignores chroot jails (goes to > the absolute root of namespace) > dentry_path(): dentry => path from root of fs containing that > dentry. > > IOW, if you have something mounted on /jail/mnt/foo and are chrooted into > /jail, passing vfsmount/dentry of /jail/mnt/foo/bar/baz to d_path() will > yield "/mnt/foo/bar/baz", to d_absolute_path() - "/jail/mnt/foo/bar/baz" and > passing the same dentry to dentry_path() - "/bar/baz". Right, so all I need to do is drop the leading "/" and I'll have what I need. I'll do that. Thanks Ian