linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Mark Fasheh <mark.fasheh@oracle.com>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, hch@infradead.org,
	viro@ftp.linux.org.uk
Subject: Re: [PATCH] Allow file systems to manually d_move() inside of ->rename()
Date: Tue, 29 Aug 2006 20:35:52 -0400	[thread overview]
Message-ID: <1156898152.5610.32.camel@localhost> (raw)
In-Reply-To: <20060829215448.GO2874@ca-server1.us.oracle.com>

On Tue, 2006-08-29 at 14:54 -0700, Mark Fasheh wrote:
> diff --git a/fs/namei.c b/fs/namei.c
> index c784e8b..e5a8478 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -2353,7 +2353,8 @@ static int vfs_rename_dir(struct inode *
>  		dput(new_dentry);
>  	}
>  	if (!error)
> -		d_move(old_dentry,new_dentry);
> +		if (!(old_dir->i_sb->s_type->fs_flags & FS_RENAME_DOES_D_MOVE))
> +			d_move(old_dentry,new_dentry);
>  	return error;
>  }
>  
> @@ -2377,7 +2378,7 @@ static int vfs_rename_other(struct inode
>  		error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
>  	if (!error) {
>  		/* The following d_move() should become unconditional */
> -		if (!(old_dir->i_sb->s_type->fs_flags & FS_ODD_RENAME))
> +		if (!(old_dir->i_sb->s_type->fs_flags & (FS_ODD_RENAME|FS_RENAME_DOES_D_MOVE)))
>  			d_move(old_dentry, new_dentry);
>  	}
>  	if (target)
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index e04a5cf..8e9a7ca 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -87,6 +87,7 @@ #define SEL_EX		4
>  /* public flags for file_system_type */
>  #define FS_REQUIRES_DEV 1 
>  #define FS_BINARY_MOUNTDATA 2
> +#define FS_RENAME_DOES_D_MOVE 4
>  #define FS_REVAL_DOT	16384	/* Check the paths ".", ".." for staleness */
>  #define FS_ODD_RENAME	32768	/* Temporary stuff; will go away as soon
>  				  * as nfs_rename() will be cleaned up
> -

Why have 2 synonyms for the FS_ODD_RENAME stuff? Just fix up the NFS
client to do the d_move() unconditionally, and add a check for
FS_ODD_RENAME to vfs_rename_dir().

Cheers,
  Trond


  reply	other threads:[~2006-08-30  0:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-29 21:54 [PATCH] Allow file systems to manually d_move() inside of ->rename() Mark Fasheh
2006-08-30  0:35 ` Trond Myklebust [this message]
2006-08-30  2:17   ` Mark Fasheh

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=1156898152.5610.32.camel@localhost \
    --to=trond.myklebust@fys.uio.no \
    --cc=akpm@osdl.org \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.fasheh@oracle.com \
    --cc=viro@ftp.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).