From: Oren Laadan <orenl@cs.columbia.edu>
To: Matt Helsley <matthltc@us.ibm.com>
Cc: 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>
Subject: Re: [PATCH 2/6] [RFC] Create the .relink file_operation
Date: Wed, 29 Sep 2010 16:19:31 -0400 [thread overview]
Message-ID: <4CA39F53.6040506@cs.columbia.edu> (raw)
In-Reply-To: <d91e3660266d3a2956c4d1aebc9cb618081b21ef.1285278339.git.matthltc@us.ibm.com>
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().
Oren.
> mutex_unlock(&inode->i_mutex);
> if (!error)
> fsnotify_link(dir, inode, new_dentry);
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index ee725ff..d932eb7 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1528,6 +1528,7 @@ struct inode_operations {
> int (*create) (struct inode *,struct dentry *,int, struct nameidata *);
> struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
> int (*link) (struct dentry *,struct inode *,struct dentry *);
> + int (*relink) (struct dentry *,struct inode *,struct dentry *);
> int (*unlink) (struct inode *,struct dentry *);
> int (*symlink) (struct inode *,struct dentry *,const char *);
> int (*mkdir) (struct inode *,struct dentry *,int);
next prev parent reply other threads:[~2010-09-29 20:19 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-23 21:53 [PATCH 0/6] Relink unlinked files for checkpoint/restart support Matt Helsley
[not found] ` <1285278812-16972-1-git-send-email-matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-09-23 21:53 ` [PATCH 1/6] Move sys-wrappers Matt Helsley
2010-09-23 21:53 ` [PATCH 2/6] [RFC] Create the .relink file_operation Matt Helsley
[not found] ` <d91e3660266d3a2956c4d1aebc9cb618081b21ef.1285278339.git.matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-09-26 19:08 ` Brad Boyer
2010-09-27 19:16 ` Matt Helsley
2010-09-27 22:03 ` Brad Boyer
2010-09-29 20:16 ` Oren Laadan
[not found] ` <20100927220346.GA30726-gUHvAUm18WIVF38mYka5EQ@public.gmane.org>
2010-09-29 20:16 ` Oren Laadan
[not found] ` <20100927191628.GN23839-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>
2010-09-27 22:03 ` Brad Boyer
[not found] ` <20100926190837.GA9308-gUHvAUm18WIVF38mYka5EQ@public.gmane.org>
2010-09-27 19:16 ` Matt Helsley
2010-09-29 20:19 ` Oren Laadan
2010-09-29 20:19 ` Oren Laadan [this message]
2010-09-29 23:07 ` Matt Helsley
[not found] ` <4CA39F53.6040506-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-09-29 23:07 ` 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
[not found] ` <9eade1f1ec10c23dae296feda8af9fe87085e843.1285278339.git.matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-09-29 20:28 ` Oren Laadan
[not found] ` <6987185123220ec2034677299859c5a63eaf2aed.1285278339.git.matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
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-23 21:53 ` [PATCH 6/6] [RFC] Enable c/r of unlinked fifos Matt Helsley
2010-09-23 21:53 ` [PATCH 5/6] [RFC] Checkpoint/restart unlinked files Matt Helsley
[not found] ` <7da8a050193a91b69ecb3899ce2eda541ecd2473.1285278339.git.matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-09-29 22:22 ` Oren Laadan
2010-10-22 23:43 ` Sukadev Bhattiprolu
2010-09-29 22:22 ` Oren Laadan
[not found] ` <4CA3BC2D.8010001-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-09-30 1:17 ` Matt Helsley
2010-09-30 1:17 ` Matt Helsley
2010-09-30 15:45 ` Oren Laadan
[not found] ` <20100930011711.GT23839-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>
2010-09-30 15:45 ` Oren Laadan
2010-10-22 23:43 ` Sukadev Bhattiprolu
2010-11-01 16:38 ` [PATCH 0/6] Relink unlinked files for checkpoint/restart support Oren Laadan
[not found] ` <4CCEECFF.9010909-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-11-01 20:43 ` Matt Helsley
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=4CA39F53.6040506@cs.columbia.edu \
--to=orenl@cs.columbia.edu \
--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=matthltc@us.ibm.com \
--cc=tytso@mit.edu \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.