Hi all, Create a new ioctl to report the number of owners of each disk block so that reflink-aware defraggers can make better decisions about which extents to target. If you're going to start using this code, I strongly recommend pulling from my git trees, which are linked below. This has been running on the djcloud for months with no problems. Enjoy! Comments and questions are, as always, welcome. --D kernel git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=report-refcounts xfsprogs git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=report-refcounts fstests git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=report-refcounts --- fs/xfs/Makefile | 1 fs/xfs/libxfs/xfs_fs_staging.h | 82 +++ fs/xfs/xfs_fsrefs.c | 970 ++++++++++++++++++++++++++++++++++++++++ fs/xfs/xfs_fsrefs.h | 34 + fs/xfs/xfs_ioctl.c | 135 ++++++ fs/xfs/xfs_trace.c | 1 fs/xfs/xfs_trace.h | 99 ++++ 7 files changed, 1322 insertions(+) create mode 100644 fs/xfs/xfs_fsrefs.c create mode 100644 fs/xfs/xfs_fsrefs.h