Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1470134

Re: [PATCH 2/7] fs: support RENAME_NOREPLACE for local filesystems

From Bob Copeland <me@bobcopeland.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/7] fs: support RENAME_NOREPLACE for local filesystems
Date 2016-08-25 15:20 +0200
Message-ID <sa2JA-1qu-21@gated-at.bofh.it> (permalink)
References <s9kyS-52F-33@gated-at.bofh.it> <s9kIy-563-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Aug 23, 2016 at 04:05:27PM +0200, Miklos Szeredi wrote:
omfs/dir.c b/fs/omfs/dir.c
> index c8cbf3b60645..417511bbe362 100644
> --- a/fs/omfs/dir.c
> +++ b/fs/omfs/dir.c
> @@ -371,12 +371,16 @@ static bool omfs_fill_chain(struct inode *dir, struct dir_context *ctx,
>  }
>  
>  static int omfs_rename(struct inode *old_dir, struct dentry *old_dentry,
> -		struct inode *new_dir, struct dentry *new_dentry)
> +		       struct inode *new_dir, struct dentry *new_dentry,
> +		       unsigned int flags)
>  {
>  	struct inode *new_inode = d_inode(new_dentry);
>  	struct inode *old_inode = d_inode(old_dentry);
>  	int err;
>  
> +	if (flags & ~RENAME_NOREPLACE)
> +		return -EINVAL;
> +
>  	if (new_inode) {
>  		/* overwriting existing file/dir */
>  		err = omfs_remove(new_dir, new_dentry);
> @@ -444,7 +448,7 @@ static int omfs_readdir(struct file *file, struct dir_context *ctx)

omfs changes look fine.

Acked-by: Bob Copeland <me@bobcopeland.com>

-- 
Bob Copeland %% http://bobcopeland.com/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/7] vfs: finish rename -> rename2 conversion Miklos Szeredi <mszeredi@redhat.com> - 2016-08-23 16:20 +0200
  [PATCH 2/7] fs: support RENAME_NOREPLACE for local filesystems Miklos Szeredi <mszeredi@redhat.com> - 2016-08-23 16:20 +0200
    Re: [PATCH 2/7] fs: support RENAME_NOREPLACE for local filesystems Richard Weinberger <richard@nod.at> - 2016-08-23 23:50 +0200
    Re: [PATCH 2/7] fs: support RENAME_NOREPLACE for local filesystems Bob Copeland <me@bobcopeland.com> - 2016-08-25 15:20 +0200
    Re: [PATCH 2/7] fs: support RENAME_NOREPLACE for local filesystems Jan Kara <jack@suse.cz> - 2016-09-08 16:00 +0200
  [PATCH 1/7] ncpfs: fix unused variable warning Miklos Szeredi <mszeredi@redhat.com> - 2016-08-23 16:20 +0200

csiph-web