Re: [PATCH 4/7] fs: make remaining filesystems use .rename2

From: David Howells
Date: Tue Aug 23 2016 - 11:40:00 EST


Miklos Szeredi <mszeredi@xxxxxxxxxx> wrote:

> This is trivial to do:
>
> - add flags argument to foo_rename()
> - check if flags is zero
> - assign foo_rename() to .rename2 instead of .rename
>
> This doesn't mean it's impossible to support RENAME_NOREPLACE for these
> filesystems, but it is not trivial, like for local filesystems.
> RENAME_NOREPLACE must guarantee atomicity (i.e. it shouldn't be possible
> for a file to be created on one host while it is overwritten by rename on
> another host).
>
> Filesystems converted:
>
> 9p, afs, ceph, coda, ecryptfs, exofs, kernfs, lustre, ncpfs, nfs, ocfs2,
> orangefs.
>
> After this, we can get rid of the duplicate interfaces for rename.
>
> Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxxxxx>
> Cc: Eric Van Hensbergen <ericvh@xxxxxxxxx>
> Cc: Ilya Dryomov <idryomov@xxxxxxxxx>
> Cc: Jan Harkes <jaharkes@xxxxxxxxxx>
> Cc: Tyler Hicks <tyhicks@xxxxxxxxxxxxx>
> Cc: Boaz Harrosh <ooo@xxxxxxxxxxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: Oleg Drokin <oleg.drokin@xxxxxxxxx>
> Cc: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>
> Cc: Mark Fasheh <mfasheh@xxxxxxxx>
> Cc: Mike Marshall <hubcap@xxxxxxxxxxxx>

Acked-by: David Howells <dhowells@xxxxxxxxxx> [AFS]