aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf
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/udf
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/udf')
-rw-r--r--fs/udf/namei.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index c3e5c9679371..ca2ec0061802 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -1093,7 +1093,8 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir,
1093 * higher-level routines. 1093 * higher-level routines.
1094 */ 1094 */
1095static int udf_rename(struct inode *old_dir, struct dentry *old_dentry, 1095static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,
1096 struct inode *new_dir, struct dentry *new_dentry) 1096 struct inode *new_dir, struct dentry *new_dentry,
1097 unsigned int flags)
1097{ 1098{
1098 struct inode *old_inode = d_inode(old_dentry); 1099 struct inode *old_inode = d_inode(old_dentry);
1099 struct inode *new_inode = d_inode(new_dentry); 1100 struct inode *new_inode = d_inode(new_dentry);
@@ -1105,6 +1106,9 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,
1105 struct kernel_lb_addr tloc; 1106 struct kernel_lb_addr tloc;
1106 struct udf_inode_info *old_iinfo = UDF_I(old_inode); 1107 struct udf_inode_info *old_iinfo = UDF_I(old_inode);
1107 1108
1109 if (flags & ~RENAME_NOREPLACE)
1110 return -EINVAL;
1111
1108 ofi = udf_find_entry(old_dir, &old_dentry->d_name, &ofibh, &ocfi); 1112 ofi = udf_find_entry(old_dir, &old_dentry->d_name, &ofibh, &ocfi);
1109 if (IS_ERR(ofi)) { 1113 if (IS_ERR(ofi)) {
1110 retval = PTR_ERR(ofi); 1114 retval = PTR_ERR(ofi);
@@ -1353,6 +1357,6 @@ const struct inode_operations udf_dir_inode_operations = {
1353 .mkdir = udf_mkdir, 1357 .mkdir = udf_mkdir,
1354 .rmdir = udf_rmdir, 1358 .rmdir = udf_rmdir,
1355 .mknod = udf_mknod, 1359 .mknod = udf_mknod,
1356 .rename = udf_rename, 1360 .rename2 = udf_rename,
1357 .tmpfile = udf_tmpfile, 1361 .tmpfile = udf_tmpfile,
1358}; 1362};