xfs
[Top] [All Lists]

Re: [PATCH 2/2] simplify xfs_lock_for_rename

To: "Christoph Hellwig" <hch@xxxxxx>
Subject: Re: [PATCH 2/2] simplify xfs_lock_for_rename
From: "Barry Naujok" <bnaujok@xxxxxxx>
Date: Fri, 11 Apr 2008 18:40:53 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20080411073730.GA9236@xxxxxx>
Organization: SGI
References: <20080410184413.GB6771@xxxxxx> <op.t9fi87c93jf8g2@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20080411073730.GA9236@xxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Opera Mail/9.24 (Win32)
On Fri, 11 Apr 2008 17:37:30 +1000, Christoph Hellwig <hch@xxxxxx> wrote:


It seems that do_rename() in namei.c calls lookup_hash/__lookup_hash
which does an inode->i_op->lookup() to get the dentry. This will do
the xfs_lookup anyway, taking a refernence if the target exists.

        error = do_path_lookup(newdfd, newname, LOOKUP_PARENT, &newnd);
        ...
        new_dentry = lookup_hash(&newnd);
        ...
        error = vfs_rename(old_dir->d_inode, old_dentry,
                                   new_dir->d_inode, new_dentry);

Therefore, target_ip/ipp2 is already known then when xfs_rename/
xfs_lock_for_rename is called.

You're right.  Back to the drawing board to make rename even simpler.
None of the other patches I sent yesterday depends on this one so they
can go in independently.  And I'd especially like to see the lookup one
before lookup gets more complicated again for CI support.

I've already applied your patches to my workarea. Certainly makes my
CI code simpler.

Barry.


<Prev in Thread] Current Thread [Next in Thread>