From d589881855a31bb85e456de29ad441811f963cd5 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 12 Oct 2020 13:24:29 -0700 Subject: [PATCH] scoutfs: add tot m/d device blocks to statfs_more The total_{meta,data}_blocks scoutfs_super_block fields initialized by mkfs aren't visible to userspace anywhere. Add them to statfs_more so that tools can get the totals (and use them for df, in this particular case). Signed-off-by: Zach Brown --- kmod/src/ioctl.c | 2 ++ kmod/src/ioctl.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/kmod/src/ioctl.c b/kmod/src/ioctl.c index 462619a0..34d75200 100644 --- a/kmod/src/ioctl.c +++ b/kmod/src/ioctl.c @@ -857,6 +857,8 @@ static long scoutfs_ioc_statfs_more(struct file *file, unsigned long arg) sizeof(struct scoutfs_ioctl_statfs_more)); sfm.fsid = le64_to_cpu(super->hdr.fsid); sfm.rid = sbi->rid; + sfm.total_meta_blocks = le64_to_cpu(super->total_meta_blocks); + sfm.total_data_blocks = le64_to_cpu(super->total_data_blocks); ret = scoutfs_client_get_last_seq(sb, &sfm.committed_seq); if (ret) diff --git a/kmod/src/ioctl.h b/kmod/src/ioctl.h index ec0875b7..f871d37e 100644 --- a/kmod/src/ioctl.h +++ b/kmod/src/ioctl.h @@ -369,6 +369,8 @@ struct scoutfs_ioctl_statfs_more { __u64 fsid; __u64 rid; __u64 committed_seq; + __u64 total_meta_blocks; + __u64 total_data_blocks; } __packed; #define SCOUTFS_IOC_STATFS_MORE _IOR(SCOUTFS_IOCTL_MAGIC, 10, \