Whamcloud - gitweb
filefrag: Lustre changes to filefrag FIEMAP handling
authorAndreas Dilger <andreas.dilger@intel.com>
Thu, 12 Apr 2012 21:31:35 +0000 (15:31 -0600)
committerLi Dongyang <dongyangli@ddn.com>
Fri, 28 Apr 2023 00:48:33 +0000 (10:48 +1000)
commit4b2752258d78b9b83fa6dfd24f3dba0c96e4a912
tree1c7093e76e028732cac5ad76031dbf74267e4885
parent6ea6727b19303c10a7a905d18926775e0babcb9d
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.

Lustre uses the high 16bits of fiemap_extent:fe_device to record
the absolute stripe number being processed, so that next fiemap
call continues from that stripe, which allows files that have
multiple objects on the same device to work properly (FLR, PFL).
Older filefrag will print the stripe number with the OST index.

Change-Id: Ifb40cc159ddc61d2296c494f0e899ac11bf88b60
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
lib/ext2fs/fiemap.h
misc/filefrag.8.in
misc/filefrag.c