diff options
author | Darrick J. Wong <djwong@kernel.org> | 2024-04-15 14:54:45 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2024-04-15 14:58:53 -0700 |
commit | e47dcf113ae348678143cc935a1183059c02c9ad (patch) | |
tree | 537f1ceeda6483a7cf9dbc85e2073d09eb25954d /fs/xfs/scrub/xfblob.c | |
parent | 629fdaf5f5b1b7f7107ed4de04e0991a99501ced (diff) | |
download | linux-stable-e47dcf113ae348678143cc935a1183059c02c9ad.tar.gz linux-stable-e47dcf113ae348678143cc935a1183059c02c9ad.tar.bz2 linux-stable-e47dcf113ae348678143cc935a1183059c02c9ad.zip |
xfs: repair extended attributes
If the extended attributes look bad, try to sift through the rubble to
find whatever keys/values we can, stage a new attribute structure in a
temporary file and use the atomic extent swapping mechanism to commit
the results in bulk.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/scrub/xfblob.c')
-rw-r--r-- | fs/xfs/scrub/xfblob.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/xfs/scrub/xfblob.c b/fs/xfs/scrub/xfblob.c index cec668debce5..6ef2a9637f16 100644 --- a/fs/xfs/scrub/xfblob.c +++ b/fs/xfs/scrub/xfblob.c @@ -149,3 +149,20 @@ xfblob_free( xfile_discard(blob->xfile, cookie, sizeof(key) + key.xb_size); return 0; } + +/* How many bytes is this blob storage object consuming? */ +unsigned long long +xfblob_bytes( + struct xfblob *blob) +{ + return xfile_bytes(blob->xfile); +} + +/* Drop all the blobs. */ +void +xfblob_truncate( + struct xfblob *blob) +{ + xfile_discard(blob->xfile, PAGE_SIZE, MAX_LFS_FILESIZE - PAGE_SIZE); + blob->last_offset = PAGE_SIZE; +} |