summaryrefslogtreecommitdiff
path: root/fs/debugfs/inode.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-09-27 11:03:57 +0200
committerLuK1337 <priv.luk@gmail.com>2023-11-01 17:13:14 +0100
commit3261ee8bbcf9314d2209af409d31fec5241539fb (patch)
treea9f81fa47493419dc8e1c071a8d0a9cd66ab3850 /fs/debugfs/inode.c
parent78a6bccb2dae3abb2a2ae3509fb7c67951af58a4 (diff)
libfs: support RENAME_NOREPLACE in simple_rename()
This is trivial to do: - add flags argument to simple_rename() - check if flags doesn't have any other than RENAME_NOREPLACE - assign simple_rename() to .rename2 instead of .rename Filesystems converted: hugetlbfs, ramfs, bpf. Debugfs uses simple_rename() to implement debugfs_rename(), which is for debugfs instances to rename files internally, not for userspace filesystem access. For this case pass zero flags to simple_rename(). Change-Id: I1a46ece3b40b05c9f18fd13b98062d2a959b76a0 Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'fs/debugfs/inode.c')
-rw-r--r--fs/debugfs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index d7111b8ce36a..3590c5c5eb6a 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -699,7 +699,7 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
take_dentry_name_snapshot(&old_name, old_dentry);
error = simple_rename(d_inode(old_dir), old_dentry, d_inode(new_dir),
- dentry);
+ dentry, 0);
if (error) {
release_dentry_name_snapshot(&old_name);
goto exit;