summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-09-27 11:03:57 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2016-09-27 11:03:57 +0200
commite0e0be8a835520e2f7c89f214dfda570922a1b90 (patch)
tree42033a89a20c26dc0f19e9119803885b1f7a06c6 /kernel
parentf03b8ad8d38634d13e802165cc15917481b47835 (diff)
downloadop-kernel-dev-e0e0be8a835520e2f7c89f214dfda570922a1b90.zip
op-kernel-dev-e0e0be8a835520e2f7c89f214dfda570922a1b90.tar.gz
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(). 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 'kernel')
-rw-r--r--kernel/bpf/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c
index 5967b87..c92fd89 100644
--- a/kernel/bpf/inode.c
+++ b/kernel/bpf/inode.c
@@ -189,7 +189,7 @@ static const struct inode_operations bpf_dir_iops = {
.mknod = bpf_mkobj,
.mkdir = bpf_mkdir,
.rmdir = simple_rmdir,
- .rename = simple_rename,
+ .rename2 = simple_rename,
.link = simple_link,
.unlink = simple_unlink,
};
OpenPOWER on IntegriCloud