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.
|