summaryrefslogtreecommitdiff
path: root/include/linux/namei.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2023-03-16 07:34:34 +0900
committerAl Viro <viro@zeniv.linux.org.uk>2023-04-20 22:37:05 -0400
commit9bc37e04823b5280dd0f22b6680fc23fe81ca325 (patch)
tree1245ba4968615c26a692b4d294acac30dd66db81 /include/linux/namei.h
parent211db0ac9e3dc6c46f2dd53395b34d76af929faf (diff)
fs: introduce lock_rename_child() helper
Pass the dentry of a source file and the dentry of a destination directory to lock parent inodes for rename. As soon as this function returns, ->d_parent of the source file dentry is stable and inodes are properly locked for calling vfs-rename. This helper is needed for ksmbd server. rename request of SMB protocol has to rename an opened file, no matter which directory it's in. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/namei.h')
-rw-r--r--include/linux/namei.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/namei.h b/include/linux/namei.h
index ba9b32b4d1b0..5864e4d82e56 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -83,6 +83,7 @@ extern int follow_down(struct path *path, unsigned int flags);
extern int follow_up(struct path *);
extern struct dentry *lock_rename(struct dentry *, struct dentry *);
+extern struct dentry *lock_rename_child(struct dentry *, struct dentry *);
extern void unlock_rename(struct dentry *, struct dentry *);
extern int __must_check nd_jump_link(const struct path *path);