mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
namei: introduce struct renamedata
In order to handle idmapped mounts we will extend the vfs rename helper to take two new arguments in follow up patches. Since this operations already takes a bunch of arguments add a simple struct renamedata and make the current helper use it before we extend it. Link: https://lore.kernel.org/r/20210121131959.646623-14-christian.brauner@ubuntu.com Cc: Christoph Hellwig <hch@lst.de> Cc: David Howells <dhowells@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: linux-fsdevel@vger.kernel.org Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
ba73d98745
commit
9fe6145097
6 changed files with 55 additions and 14 deletions
|
@ -590,6 +590,7 @@ ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|||
struct dentry *lower_new_dir_dentry;
|
||||
struct dentry *trap;
|
||||
struct inode *target_inode;
|
||||
struct renamedata rd = {};
|
||||
|
||||
if (flags)
|
||||
return -EINVAL;
|
||||
|
@ -619,9 +620,12 @@ ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|||
rc = -ENOTEMPTY;
|
||||
goto out_lock;
|
||||
}
|
||||
rc = vfs_rename(d_inode(lower_old_dir_dentry), lower_old_dentry,
|
||||
d_inode(lower_new_dir_dentry), lower_new_dentry,
|
||||
NULL, 0);
|
||||
|
||||
rd.old_dir = d_inode(lower_old_dir_dentry);
|
||||
rd.old_dentry = lower_old_dentry;
|
||||
rd.new_dir = d_inode(lower_new_dir_dentry);
|
||||
rd.new_dentry = lower_new_dentry;
|
||||
rc = vfs_rename(&rd);
|
||||
if (rc)
|
||||
goto out_lock;
|
||||
if (target_inode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue