diff --git a/kmod/src/ioctl.c b/kmod/src/ioctl.c index fc35dd34..2bff5c48 100644 --- a/kmod/src/ioctl.c +++ b/kmod/src/ioctl.c @@ -846,6 +846,7 @@ static long scoutfs_ioc_statfs_more(struct file *file, unsigned long arg) struct scoutfs_sb_info *sbi = SCOUTFS_SB(sb); struct scoutfs_super_block *super = &sbi->super; struct scoutfs_ioctl_statfs_more sfm; + int ret; if (get_user(sfm.valid_bytes, (__u64 __user *)arg)) return -EFAULT; @@ -855,6 +856,10 @@ static long scoutfs_ioc_statfs_more(struct file *file, unsigned long arg) sfm.fsid = le64_to_cpu(super->hdr.fsid); sfm.rid = sbi->rid; + ret = scoutfs_client_get_last_seq(sb, &sfm.committed_seq); + if (ret) + return ret; + if (copy_to_user((void __user *)arg, &sfm, sfm.valid_bytes)) return -EFAULT; diff --git a/kmod/src/ioctl.h b/kmod/src/ioctl.h index 2f861a4d..1ef0aa36 100644 --- a/kmod/src/ioctl.h +++ b/kmod/src/ioctl.h @@ -358,12 +358,17 @@ struct scoutfs_ioctl_search_xattrs { * field is set if all of its bytes are within the valid_bytes that the * kernel set on return. * + * @committed_seq: All seqs up to and including this seq have been + * committed. Can be compared with meta_seq and data_seq from inodes in + * stat_more to discover if changes have been committed to disk. + * * New fields are only added to the end of the struct. */ struct scoutfs_ioctl_statfs_more { __u64 valid_bytes; __u64 fsid; __u64 rid; + __u64 committed_seq; } __packed; #define SCOUTFS_IOC_STATFS_MORE _IOR(SCOUTFS_IOCTL_MAGIC, 10, \