fs: support RENAME_NOREPLACE for local filesystems
authorMiklos Szeredi <mszeredi@redhat.com>
Tue, 27 Sep 2016 09:03:57 +0000 (11:03 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 27 Sep 2016 09:03:57 +0000 (11:03 +0200)
commitf03b8ad8d38634d13e802165cc15917481b47835
tree4dc9c060684f242d1e6c07d28d1ff625db63fd6c
parent9a232de4999666b2e8ea6775b2b0e3e4feb09b7a
fs: support RENAME_NOREPLACE for local filesystems

This is trivial to do:

 - add flags argument to foo_rename()
 - check if flags doesn't have any other than RENAME_NOREPLACE
 - assign foo_rename() to .rename2 instead of .rename

Filesystems converted:

affs, bfs, exofs, ext2, hfs, hfsplus, jffs2, jfs, logfs, minix, msdos,
nilfs2, omfs, reiserfs, sysvfs, ubifs, udf, ufs, vfat.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Acked-by: Boaz Harrosh <ooo@electrozaur.com>
Acked-by: Richard Weinberger <richard@nod.at>
Acked-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Jan Kara <jack@suse.cz>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Dave Kleikamp <shaggy@kernel.org>
Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: Christoph Hellwig <hch@infradead.org>
22 files changed:
fs/affs/affs.h
fs/affs/dir.c
fs/affs/namei.c
fs/bfs/dir.c
fs/exofs/namei.c
fs/ext2/namei.c
fs/fat/namei_msdos.c
fs/fat/namei_vfat.c
fs/hfs/dir.c
fs/hfsplus/dir.c
fs/hpfs/namei.c
fs/jffs2/dir.c
fs/jfs/namei.c
fs/logfs/dir.c
fs/minix/namei.c
fs/nilfs2/namei.c
fs/omfs/dir.c
fs/reiserfs/namei.c
fs/sysv/namei.c
fs/ubifs/dir.c
fs/udf/namei.c
fs/ufs/namei.c