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)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 15 Dec 2022 18:49:57 +0000 (11:49 -0700)
commitc6e418af4d401e6f393db3548da6b8c16a322584
treedfc037f0d18767197a759dcd2dc0905d1853de20
parent446d388f6dc52b50f5fb50b12eec364a8d9e2adb
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