From 1e2dc6c1df209ad22ed54b5e00f7d3f7eeb0dfa0 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 16 Jul 2020 11:38:41 -0700 Subject: [PATCH] scoutfs-utils: add committed_seq to statfs_more Signed-off-by: Zach Brown --- utils/src/ioctl.h | 5 +++++ utils/src/stat.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/utils/src/ioctl.h b/utils/src/ioctl.h index 2f861a4d..1ef0aa36 100644 --- a/utils/src/ioctl.h +++ b/utils/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, \ diff --git a/utils/src/stat.c b/utils/src/stat.c index 9187feb2..f2beb2ca 100644 --- a/utils/src/stat.c +++ b/utils/src/stat.c @@ -67,6 +67,7 @@ static void print_inode_field(void *st, size_t off) static struct stat_more_field fs_fields[] = { FS_FIELD(fsid), FS_FIELD(rid), + FS_FIELD(committed_seq), { NULL, } }; @@ -81,6 +82,9 @@ static void print_fs_field(void *st, size_t off) case FS_FIELD_OFF(rid): printf("%016llx", sfm->rid); break; + case FS_FIELD_OFF(committed_seq): + printf("%llu", sfm->committed_seq); + break; }; }