]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
btrfs: add a helpers for read repair testing
authorChristoph Hellwig <hch@lst.de>
Fri, 27 May 2022 08:19:06 +0000 (10:19 +0200)
committerZorro Lang <zlang@kernel.org>
Sat, 28 May 2022 07:10:11 +0000 (15:10 +0800)
commit68da7b2ab8049e7bd2de2fb81a76a560f66dbd1e
tree3c10dbe7d498c42b63977803144c6a72a56cfddf
parenta8812199578bcfebb80b66dcad7b0ff5919aa4b6
btrfs: add a helpers for read repair testing

Add a few helpers to consolidate code for btrfs read repair testing:

 - _btrfs_get_first_logical() gets the btrfs logical address for the
   first extent in a file
 - _btrfs_get_device_path and _btrfs_get_physical use the
   btrfs-map-logical tool to find the device path and physical address
   for btrfs logical address for a specific mirror
 - _btrfs_direct_read_on_mirror and _btrfs_buffered_read_on_mirror
   read the data from a specific mirror

These will be used to consolidate the read repair tests and avoid
duplication for new tests.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/btrfs
common/config