From: Matt Helsley <matthltc@us.ibm.com>
To: Oren Laadan <orenl@cs.columbia.edu>
Cc: Matt Helsley <matthltc@us.ibm.com>,
containers@lists.linux-foundation.org, Jan Kara <jack@suse.cz>,
Andreas Dilger <adilger.kernel@dilger.ca>,
linux-fsdevel@vger.kernel.org, "Theodore Ts'o" <tytso@mit.edu>,
linux-ext4@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
Valerie Aurora <vaurora@redhat.com>
Subject: Re: [PATCH 2/6] [RFC] Create the .relink file_operation
Date: Wed, 29 Sep 2010 16:07:03 -0700 [thread overview]
Message-ID: <20100929230703.GS23839@count0.beaverton.ibm.com> (raw)
In-Reply-To: <4CA39F53.6040506@cs.columbia.edu>
On Wed, Sep 29, 2010 at 04:19:31PM -0400, Oren Laadan wrote:
>
>
> On 09/23/2010 05:53 PM, Matt Helsley wrote:
> >Not all filesystems will necessarily be able to support relinking an
> >orphan inode back into the filesystem. Some offlist feedback suggested
> >that instead of overloading .link that relinking should be a separate
> >file operation for this reason.
> >
> >Since .relink is a superset of .link make the VFS call .relink where
> >possible and .link otherwise.
> >
> >The next commit will change ext3/4 to enable this operation.
> >
> >Signed-off-by: Matt Helsley<matthltc@us.ibm.com>
> >Cc: Theodore Ts'o<tytso@mit.edu>
> >Cc: Andreas Dilger<adilger.kernel@dilger.ca>
> >Cc: Jan Kara<jack@suse.cz>
> >Cc: linux-fsdevel@vger.kernel.org
> >Cc: linux-ext4@vger.kernel.org
> >Cc: Al Viro<viro@zeniv.linux.org.uk>
> >---
> > fs/namei.c | 5 ++++-
> > include/linux/fs.h | 1 +
> > 2 files changed, 5 insertions(+), 1 deletions(-)
> >
> >diff --git a/fs/namei.c b/fs/namei.c
> >index a7dce91..eb279e3 100644
> >--- a/fs/namei.c
> >+++ b/fs/namei.c
> >@@ -2446,7 +2446,10 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de
> > return error;
> >
> > mutex_lock(&inode->i_mutex);
> >- error = dir->i_op->link(old_dentry, dir, new_dentry);
> >+ if (dir->i_op->relink)
> >+ error = dir->i_op->relink(old_dentry, dir, new_dentry);
> >+ else
> >+ error = dir->i_op->link(old_dentry, dir, new_dentry);
>
> Can there be a scenario/filesystem in which .relink implementation
> is so much more complex (and expensive) than .link ?
>
> If the answer is "yes", then this we probably don't want to do
> this, and let vfs_link() call .link, and instead add a new helper
> vfs_relink().
OK, that makes some sense too. I thought the separation would
just be at the file operations layer but we can move it higher too.
I'll adjust the patches to do that and repost them.
Cheers,
-Matt
prev parent reply other threads:[~2010-09-29 23:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1285278812-16972-1-git-send-email-matthltc@us.ibm.com>
[not found] ` <6987185123220ec2034677299859c5a63eaf2aed.1285278339.git.matthltc@us.ibm.com>
2010-09-23 21:53 ` [PATCH 2/6] [RFC] Create the .relink file_operation Matt Helsley
2010-09-23 21:53 ` [PATCH 3/6] [RFC] ext3/4: Allow relinking to unlinked files Matt Helsley
2010-09-23 21:53 ` [PATCH 4/6] [RFC] Split do_linkat() out of sys_linkat Matt Helsley
2010-09-23 21:53 ` [PATCH 5/6] [RFC] Checkpoint/restart unlinked files Matt Helsley
2010-09-29 22:22 ` Oren Laadan
2010-09-30 1:17 ` Matt Helsley
2010-09-30 15:45 ` Oren Laadan
2010-10-22 23:43 ` Sukadev Bhattiprolu
[not found] ` <9eade1f1ec10c23dae296feda8af9fe87085e843.1285278339.git.matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-09-29 20:28 ` [PATCH 4/6] [RFC] Split do_linkat() out of sys_linkat Oren Laadan
[not found] ` <d91e3660266d3a2956c4d1aebc9cb618081b21ef.1285278339.git.matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-09-26 19:08 ` [PATCH 2/6] [RFC] Create the .relink file_operation Brad Boyer
2010-09-27 19:16 ` Matt Helsley
2010-09-27 22:03 ` Brad Boyer
2010-09-29 20:16 ` Oren Laadan
2010-09-29 20:19 ` Oren Laadan
2010-09-29 23:07 ` Matt Helsley [this message]
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=20100929230703.GS23839@count0.beaverton.ibm.com \
--to=matthltc@us.ibm.com \
--cc=adilger.kernel@dilger.ca \
--cc=containers@lists.linux-foundation.org \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=orenl@cs.columbia.edu \
--cc=tytso@mit.edu \
--cc=vaurora@redhat.com \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).