From: Christoph Hellwig <hch@lst.de>
To: Barry Naujok <bnaujok@sgi.com>
Cc: Christoph Hellwig <hch@lst.de>, xfs@oss.sgi.com
Subject: Re: [PATCH 2/2] simplify xfs_lock_for_rename
Date: Fri, 11 Apr 2008 09:37:30 +0200 [thread overview]
Message-ID: <20080411073730.GA9236@lst.de> (raw)
In-Reply-To: <op.t9fi87c93jf8g2@pc-bnaujok.melbourne.sgi.com>
>
> 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.
next prev parent reply other threads:[~2008-04-11 7:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-10 18:44 [PATCH 2/2] simplify xfs_lock_for_rename Christoph Hellwig
2008-04-11 0:24 ` Barry Naujok
2008-04-11 4:40 ` Barry Naujok
2008-04-11 7:37 ` Christoph Hellwig [this message]
2008-04-11 8:40 ` Barry Naujok
2008-04-11 8:46 ` Christoph Hellwig
2008-04-11 9:11 ` [PATCH 2/2] remove manual lookup from xfs_rename and simplify locking Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080411073730.GA9236@lst.de \
--to=hch@lst.de \
--cc=bnaujok@sgi.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox