diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2016-09-27 12:03:57 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2016-09-27 12:03:57 +0300 |
commit | e0e0be8a835520e2f7c89f214dfda570922a1b90 (patch) | |
tree | 42033a89a20c26dc0f19e9119803885b1f7a06c6 /include/linux/fs.h | |
parent | f03b8ad8d38634d13e802165cc15917481b47835 (diff) | |
download | linux-e0e0be8a835520e2f7c89f214dfda570922a1b90.tar.xz |
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 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 901e25d495cc..2bd67545fdf8 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2950,7 +2950,8 @@ extern int simple_open(struct inode *inode, struct file *file); extern int simple_link(struct dentry *, struct inode *, struct dentry *); extern int simple_unlink(struct inode *, struct dentry *); extern int simple_rmdir(struct inode *, struct dentry *); -extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); +extern int simple_rename(struct inode *, struct dentry *, + struct inode *, struct dentry *, unsigned int); extern int noop_fsync(struct file *, loff_t, loff_t, int); extern int simple_empty(struct dentry *); extern int simple_readpage(struct file *file, struct page *page); |