scoutfs: add committed_seq to statfs_more

Add the committed_seq to statfs_more which gives the greatest seq which
has been committed.  This lets callers disocover that a seq for a change
they made has been committed.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2020-07-15 17:00:36 -07:00
committed by Zach Brown
parent 6356440073
commit 4b9c02ba32
2 changed files with 10 additions and 0 deletions

View File

@@ -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;

View File

@@ -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, \