]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: create a hashname function for parent pointers
authorDarrick J. Wong <djwong@kernel.org>
Mon, 29 Jul 2024 23:22:47 +0000 (16:22 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:01:02 +0000 (17:01 -0700)
commit9f45ce92fc17ed012d0d1fe30d7e9aca1308412d
tree3c9e69735ed80f2a93e31c0b85c26b4af27d8ccf
parent22e2e5e5a3b3b2ab24cc01290b2d0a12be9a0741
xfs: create a hashname function for parent pointers

Source kernel commit: fb102fe7fe02e70f8a49cc7f74bc0769cdab2912

Although directory entry and parent pointer recordsets look very similar
(name -> ino), there's one major difference between them: a file can be
hardlinked from multiple parent directories with the same filename.
This is common in shared container environments where a base directory
tree might be hardlink-copied multiple times.  IOWs the same 'ls'
program might be hardlinked to multiple /srv/*/bin/ls paths.

We don't want parent pointer operations to bog down on hash collisions
between the same dirent name, so create a special hash function that
mixes in the parent directory inode number.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/libxfs_priv.h
libxfs/xfs_attr.c
libxfs/xfs_parent.c
libxfs/xfs_parent.h