mirror of
https://github.com/versity/scoutfs.git
synced 2026-06-09 05:02:35 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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, \
|
||||
|
||||
Reference in New Issue
Block a user