summaryrefslogtreecommitdiff
path: root/fs/ramfs/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/ramfs/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/ramfs/inode.c')
-rw-r--r--fs/ramfs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 889d558b4e05..37fcd10866c3 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -145,7 +145,7 @@ static const struct inode_operations ramfs_dir_inode_operations = {
.mkdir = ramfs_mkdir,
.rmdir = simple_rmdir,
.mknod = ramfs_mknod,
- .rename = simple_rename,
+ .rename2 = simple_rename,
};
static const struct super_operations ramfs_ops = {