diff options
author | Christian Brauner <christian.brauner@ubuntu.com> | 2021-01-21 14:19:32 +0100 |
---|---|---|
committer | Christian Brauner <christian.brauner@ubuntu.com> | 2021-01-24 14:27:18 +0100 |
commit | 9fe61450972d3900bffb1dc26a17ebb9cdd92db2 (patch) | |
tree | 895d7d6485f03c01afa9f1b575e59878162f9373 /fs/cachefiles | |
parent | ba73d98745be1c10dc3cce68e8d7b95012d07d05 (diff) | |
download | linux-9fe61450972d3900bffb1dc26a17ebb9cdd92db2.tar.gz linux-9fe61450972d3900bffb1dc26a17ebb9cdd92db2.tar.bz2 linux-9fe61450972d3900bffb1dc26a17ebb9cdd92db2.zip |
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>
Diffstat (limited to 'fs/cachefiles')
-rw-r--r-- | fs/cachefiles/namei.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c index ecc8ecbbfa5a..7b987de0babe 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c @@ -412,9 +412,14 @@ try_again: if (ret < 0) { cachefiles_io_error(cache, "Rename security error %d", ret); } else { + struct renamedata rd = { + .old_dir = d_inode(dir), + .old_dentry = rep, + .new_dir = d_inode(cache->graveyard), + .new_dentry = grave, + }; trace_cachefiles_rename(object, rep, grave, why); - ret = vfs_rename(d_inode(dir), rep, - d_inode(cache->graveyard), grave, NULL, 0); + ret = vfs_rename(&rd); if (ret != 0 && ret != -ENOMEM) cachefiles_io_error(cache, "Rename failed with error %d", ret); |