aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/namei.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-09-27 05:03:57 -0400
committerMiklos Szeredi <mszeredi@redhat.com>2016-09-27 05:03:57 -0400
commitf03b8ad8d38634d13e802165cc15917481b47835 (patch)
tree4dc9c060684f242d1e6c07d28d1ff625db63fd6c /fs/jfs/namei.c
parent9a232de4999666b2e8ea6775b2b0e3e4feb09b7a (diff)
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>
Diffstat (limited to 'fs/jfs/namei.c')
-rw-r--r--fs/jfs/namei.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 814b0c58016c..ee1aa32f7c24 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -1078,7 +1078,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
1078 * FUNCTION: rename a file or directory 1078 * FUNCTION: rename a file or directory
1079 */ 1079 */
1080static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, 1080static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1081 struct inode *new_dir, struct dentry *new_dentry) 1081 struct inode *new_dir, struct dentry *new_dentry,
1082 unsigned int flags)
1082{ 1083{
1083 struct btstack btstack; 1084 struct btstack btstack;
1084 ino_t ino; 1085 ino_t ino;
@@ -1097,6 +1098,8 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1097 s64 new_size = 0; 1098 s64 new_size = 0;
1098 int commit_flag; 1099 int commit_flag;
1099 1100
1101 if (flags & ~RENAME_NOREPLACE)
1102 return -EINVAL;
1100 1103
1101 jfs_info("jfs_rename: %pd %pd", old_dentry, new_dentry); 1104 jfs_info("jfs_rename: %pd %pd", old_dentry, new_dentry);
1102 1105
@@ -1536,7 +1539,7 @@ const struct inode_operations jfs_dir_inode_operations = {
1536 .mkdir = jfs_mkdir, 1539 .mkdir = jfs_mkdir,
1537 .rmdir = jfs_rmdir, 1540 .rmdir = jfs_rmdir,
1538 .mknod = jfs_mknod, 1541 .mknod = jfs_mknod,
1539 .rename = jfs_rename, 1542 .rename2 = jfs_rename,
1540 .setxattr = generic_setxattr, 1543 .setxattr = generic_setxattr,
1541 .getxattr = generic_getxattr, 1544 .getxattr = generic_getxattr,
1542 .listxattr = jfs_listxattr, 1545 .listxattr = jfs_listxattr,