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>
last = 1;
fm_last = fm_ext[i];
n++;
- if (previous_device != (fm_ext[i].fe_device & 0xffff))
- previous_device = fm_ext[i].fe_device & 0xffff;
-
+ previous_device = fm_ext[i].fe_device & 0xffff;
}
/* For DEVICE_ORDER mappings, if EXTENT_LAST not yet found then
if (flags & FIEMAP_FLAG_DEVICE_ORDER) {
fm_ext[0].fe_logical = fm_ext[i - 1].fe_logical +
fm_ext[i - 1].fe_length;
- fm_ext[0].fe_device &= 0xffff0000;
- fm_ext[0].fe_device |= fm_ext[i - 1].fe_device & 0xffff;
+ fm_ext[0].fe_device = fm_ext[i - 1].fe_device;
+ fiemap->fm_start = 0;
} else {
fiemap->fm_start = fm_ext[i - 1].fe_logical +
fm_ext[i - 1].fe_length;