vfs: add cross-rename

If flags contain RENAME_EXCHANGE then exchange source and destination files.
There's no restriction on the type of the files; e.g. a directory can be
exchanged with a symlink.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
Miklos Szeredi
2014-04-01 17:08:43 +02:00
parent 4fd699ae3f
commit da1ce0670c
5 changed files with 131 additions and 41 deletions

View File

@@ -36,6 +36,7 @@
#define SEEK_MAX SEEK_HOLE
#define RENAME_NOREPLACE (1 << 0) /* Don't overwrite target */
#define RENAME_EXCHANGE (1 << 1) /* Exchange source and dest */
struct fstrim_range {
__u64 start;