On Thu, Mar 14, 2024 at 08:03:34PM -0700, Darrick J. Wong wrote: > On Fri, Mar 08, 2024 at 01:03:17PM -0500, Sweet Tea Dorminy wrote: > > For many years, various btrfs users have written programs to discover > > the actual disk space used by files, using root-only interfaces. > > However, this information is a great fit for fiemap: it is inherently > > tied to extent information, all filesystems can use it, and the > > capabilities required for FIEMAP make sense for this additional > > information also. > > > > Hence, this patchset adds physical extent length information to fiemap, > > and extends btrfs to return it. This uses some of the reserved padding > > in the fiemap extent structure, so programs unaware of the new field > > will be unaffected by its presence. > > > > This is based on next-20240307. I've tested the btrfs part of this with > > the standard btrfs testing matrix locally, and verified that the physical extent > > information returned there is correct, but I'm still waiting on more > > tests. Please let me know what you think of the general idea! > > Seems useful! Any chance you'd be willing to pick up this old proposal > to report the dev_t through iomap? iirc the iomap wrappers for fiemap > can export that pretty easily. > > https://lore.kernel.org/linux-fsdevel/20190211094306.fjr6gfehcstm7eqq@xxxxxxxxxxxxxxxxxxxxxxxx/ I think this is not too useful for btrfs (in general) due to the block group profiles that store copies on multiple devices, we'd need more than one device identifier per extent.