Merge tag 'pptrs-6.10_2024-04-23' of https://git./linux/kernel/git/djwong/xfs-linux into xfs-6.10-mergeC
xfs: Parent Pointers
This is the latest parent pointer attributes for xfs. The goal of this
patch set is to add a parent pointer attribute to each inode. The
attribute name containing the parent inode, generation, and directory
offset, while the attribute value contains the file name. This feature
will enable future optimizations for online scrub, shrink, nfs handles,
verity, or any other feature that could make use of quickly deriving an
inodes path from the mount point.
Directory parent pointers are stored as namespaced extended attributes
of a file. Because parent pointers are an indivisible tuple of
(dirent_name, parent_ino, parent_gen) we cannot use the usual attr name
lookup functions to find a parent pointer. This is solvable by
introducing a new lookup mode that checks both the name and the value of
the xattr.
Therefore, introduce this new name-value lookup mode that's gated on the
XFS_ATTR_PARENT namespace. This requires the introduction of new
opcodes for the extended attribute update log intent items, which
actually means that parent pointers (itself an INCOMPAT feature) does
not depend on the LOGGED_XATTRS log incompat feature bit.
To reduce collisions on the dirent names of parent pointers, introduce a
new attr hash mode that is the dir2 namehash of the dirent name xor'd
with the parent inode number.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
* tag 'pptrs-6.10_2024-04-23' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
xfs: enable parent pointers
xfs: drop compatibility minimum log size computations for reflink
xfs: fix unit conversion error in xfs_log_calc_max_attrsetm_res
xfs: add a incompat feature bit for parent pointers
xfs: don't remove the attr fork when parent pointers are enabled
xfs: add parent pointer ioctls
xfs: split out handle management helpers a bit
xfs: move handle ioctl code to xfs_handle.c
xfs: pass the attr value to put_listent when possible
xfs: don't return XFS_ATTR_PARENT attributes via listxattr
xfs: Add parent pointers to xfs_cross_rename
xfs: Add parent pointers to rename
xfs: remove parent pointers in unlink
xfs: add parent attributes to symlink
xfs: add parent attributes to link
xfs: parent pointer attribute creation
xfs: create a hashname function for parent pointers
xfs: extend transaction reservations for parent attributes
xfs: add parent pointer validator functions
xfs: Expose init_xattrs in xfs_create_tmpfile
xfs: record inode generation in xattr update log intent items
xfs: create attr log item opcodes and formats for parent pointers
xfs: refactor xfs_is_using_logged_xattrs checks in attr item recovery
xfs: allow xattr matching on name and value for parent pointers
xfs: define parent pointer ondisk extended attribute format
xfs: add parent pointer support to attribute code
xfs: create a separate hashname function for extended attributes
xfs: move xfs_attr_defer_add to xfs_attr_item.c
xfs: check the flags earlier in xfs_attr_match
xfs: rearrange xfs_attr_match parameters