xfs: create a sparse load xfarray function
authorDarrick J. Wong <djwong@kernel.org>
Thu, 22 Feb 2024 20:30:54 +0000 (12:30 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 22 Feb 2024 20:30:54 +0000 (12:30 -0800)
commit5a3ab5849583217090e29299c7bee88b827c12d8
tree27895c5804fdfdf1fd4d9163a4c9964bb644185c
parentebd610fe82c1d2a94c6fe27cd04d5cf911b5e171
xfs: create a sparse load xfarray function

Create a new method to load an xfarray element from the xfile, but with
a twist.  If we've never stored to the array index, zero the caller's
buffer.  This will facilitate RMWs updates of records in a sparse array
without fuss, since the sparse xfarray convention is that uninitialized
array elements default to zeroes.

This is a separate patch to reduce the size of the upcoming quotacheck
patch.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/xfarray.h