aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2014-04-01 17:08:43 +0200
committerAlex Shi <alex.shi@linaro.org>2015-04-17 15:39:11 +0800
commitc3ae3e8840e6b555949cda895d885ad91c5e3f24 (patch)
tree542cc75cc12523f7c11329559b4d69f34cab9ac9 /include
parent5371fcd46e9276f4216e329ba2714d595a384a1f (diff)
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> (cherry picked from commit da1ce0670c14d8380e423a3239e562a1dc15fa9e) Signed-off-by: Alex Shi <alex.shi@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/dcache.h1
-rw-r--r--include/uapi/linux/fs.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 3b50cac7ccb3..3b9bfdb83ba6 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -308,6 +308,7 @@ extern void dentry_update_name_case(struct dentry *, struct qstr *);
/* used for rename() and baskets */
extern void d_move(struct dentry *, struct dentry *);
+extern void d_exchange(struct dentry *, struct dentry *);
extern struct dentry *d_ancestor(struct dentry *, struct dentry *);
/* appendix may either be NULL or be used for transname suffixes */
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
index 9250f4dd7d96..ca1a11bb4443 100644
--- a/include/uapi/linux/fs.h
+++ b/include/uapi/linux/fs.h
@@ -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;