]> git.ipfire.org Git - thirdparty/linux.git/commit
xfs: add a method to replace shortform attrs
authorDarrick J. Wong <djwong@kernel.org>
Fri, 23 Jan 2026 17:27:36 +0000 (09:27 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 23 Jan 2026 17:27:36 +0000 (09:27 -0800)
commiteaec8aeff31d0679eadb27a13a62942ddbfd7b87
tree7e6b3afe4d124931335f4cc6ba9e6e91535a08ea
parentd693534513d8dcdaafcf855986d0fe0476a47462
xfs: add a method to replace shortform attrs

If we're trying to replace an xattr in a shortform attr structure and
the old entry fits the new entry, we can just memcpy and exit without
having to delete, compact, and re-add the entry (or worse use the attr
intent machinery).  For parent pointers this only advantages renaming
where the filename length stays the same (e.g. mv autoexec.bat
scandisk.exe) but for regular xattrs it might be useful for updating
security labels and the like.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_attr.c
fs/xfs/libxfs/xfs_attr_leaf.c
fs/xfs/libxfs/xfs_attr_leaf.h
fs/xfs/xfs_trace.h