Print the new inode data_version field

We've added a data_version field to the inode for tracking changes to
the file's data.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2016-11-15 15:51:29 -08:00
parent f1d8955303
commit c2cfb0227f
2 changed files with 7 additions and 1 deletions

View File

@@ -200,6 +200,10 @@ struct scoutfs_timespec {
} __packed;
/*
* @data_version: incremented every time the contents of a file could
* have changed. It is exposed via an ioctl and is then provided as an
* argument to data functions to protect racing modification.
*
* XXX
* - otime?
* - compat flags?
@@ -211,6 +215,7 @@ struct scoutfs_inode {
__le64 size;
__le64 blocks;
__le64 link_counter;
__le64 data_version;
__le32 nlink;
__le32 uid;
__le32 gid;

View File

@@ -61,7 +61,7 @@ static void print_inode(struct scoutfs_inode *inode)
{
printf(" inode: size: %llu blocks: %llu lctr: %llu nlink: %u\n"
" uid: %u gid: %u mode: 0%o rdev: 0x%x\n"
" salt: 0x%x\n"
" salt: 0x%x data_version %llu\n"
" atime: %llu.%08u ctime: %llu.%08u\n"
" mtime: %llu.%08u\n",
le64_to_cpu(inode->size), le64_to_cpu(inode->blocks),
@@ -69,6 +69,7 @@ static void print_inode(struct scoutfs_inode *inode)
le32_to_cpu(inode->nlink), le32_to_cpu(inode->uid),
le32_to_cpu(inode->gid), le32_to_cpu(inode->mode),
le32_to_cpu(inode->rdev), le32_to_cpu(inode->salt),
le64_to_cpu(inode->data_version),
le64_to_cpu(inode->atime.sec),
le32_to_cpu(inode->atime.nsec),
le64_to_cpu(inode->ctime.sec),