]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
VFS: change old_dir and new_dir in struct renamedata to dentrys
authorNeilBrown <neil@brown.name>
Thu, 12 Jun 2025 23:28:10 +0000 (09:28 +1000)
committerChristian Brauner <brauner@kernel.org>
Mon, 16 Jun 2025 14:30:45 +0000 (16:30 +0200)
commitbc9241367aac08de44633fd957b2452a6da8e6d4
tree0db3cb65984cc50ca63db9cf168780fd233621af
parentb5ba648a7dd2b42725ae2d07335f0551111437a2
VFS: change old_dir and new_dir in struct renamedata to dentrys

all users of 'struct renamedata' have the dentry for the old and new
directories, and often have no use for the inode except to store it in
the renamedata.

This patch changes struct renamedata to hold the dentry, rather than
the inode, for the old and new directories, and changes callers to
match.  The names are also changed from a _dir suffix to _parent.  This
is consistent with other usage in namei.c and elsewhere.

This results in the removal of several local variables and several
dereferences of ->d_inode at the cost of adding ->d_inode dereferences
to vfs_rename().

Acked-by: Miklos Szeredi <miklos@szeredi.hu>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://lore.kernel.org/174977089072.608730.4244531834577097454@noble.neil.brown.name
Signed-off-by: Christian Brauner <brauner@kernel.org>
12 files changed:
fs/cachefiles/namei.c
fs/ecryptfs/inode.c
fs/namei.c
fs/nfsd/vfs.c
fs/overlayfs/copy_up.c
fs/overlayfs/dir.c
fs/overlayfs/overlayfs.h
fs/overlayfs/readdir.c
fs/overlayfs/super.c
fs/overlayfs/util.c
fs/smb/server/vfs.c
include/linux/fs.h