On Wed, Aug 03, 2016 at 08:56:01PM +0100, Graham Cobb wrote: > Are there any btrfs commands (or APIs) to allow a script to create a > list of all the extents referred to within a particular (mounted) > subvolume? And is it a reasonably efficient process (i.e. doesn't > involve backrefs and, preferably, doesn't involve following directory > trees)? Since the size of your output is linear to the number of extents which is between the number of files and sum of their sizes, I see no gain in trying to avoid following the directory tree. And that can be done with FIEMAP on any filesystem, not just btrfs. > I am not looking to relate the extents to files/inodes/paths. My > particular need, at the moment, is to work out how much of two snapshots > is shared data, but I can think of other uses for the information. Thus, unlike the question you asked above, you're not interested in _all_ extents, merely those which changed. You may want to look at "btrfs subv find-new" and "btrfs send --no-data". Meow! -- An imaginary friend squared is a real enemy. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
