filefrag: Lustre changes to filefrag FIEMAP handling
Add support for multiple-device filesystems by defining a new
fe_device field in the fiemap_extent structure. This allows
printing the filesystem-relative or linux block device number
associated with each extent of a file. If a single filesystem
extent is mirrored to multiple block devices, the fe_device
field can be used to disambiguate the multiple copies.
If the "-l" (device-logical) option is given to filefrag, then
all extents for a particular device of a file are returned
before returning extents for the next device. This makes it
easier to see if extent allocation within a single device is
contiguous, instead of returning all of the blocks of a file
interleaved in file-logical-offset order.
filefrag: support PFL and FLR file
Add FIEMAP_EXTENT_DATA_MIRROR support FLR file, which is returned
from Lustre indicating that a new mirror will be processed, so we'd
reset the fm_start and fe_logical.
Change-Id: Ifa68d951ac68d9f141eae915e58c13d73833c8c9
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40765
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
LU-11848 filefrag: add -V option to print version
Add '-V' to filefrag to print the installed version of the tool.
If '-V' is used twice, print out the list of supported FIEMAP flags.
This can be used to check if filefrag understands a specific feature.
Change-Id: Ib126bdd70efa1775aef6db761f54e27a593ebbe5
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40873
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
LU-11848 filefrag: rework port PFL and FLR file
Lustre uses the high 16bits of fiemap_extent:fe_device to record
the absolute stripe number is under process, so that next fiemap
call continues from that stripe.
Fixes:
0b6718f5e22d ("filefrag: support PFL and FLR file")
Change-Id: I111bcb100307aebacbffed99109057accdc27f5b
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40889
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-11848 filefrag: further PFL and FLR fixes
Revert some of the changes from the earlier patches to bring the
filefrag functionality closer to the original behavior.
The kernel is instead changed to return the device number with
every extent. This allows the previous filefrag to work for PFL
and FLR files without any changes by just copying the fe_device
from the last returned extent to the next call. The only gap in
old filefrag is that it prints the stripe number with OST index.
Fixes:
d99d208e73cd ("LU-11848 filefrag: rework port PFL and FLR file")
Fixes:
0b6718f5e22d ("filefrag: support PFL and FLR file")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ie6a8d93ebceb1e70894b21f0dadc9655083ebbe5
Reviewed-on: https://review.whamcloud.com/40932
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Change-Id: Ifb40cc159ddc61d2296c494f0e899ac11bf88b60
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>