scoutfs: track online and offline blocks

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2018-02-02 09:54:30 -08:00
committed by Zach Brown
parent e68a999ed5
commit d796fbf15e
3 changed files with 15 additions and 2 deletions

View File

@@ -449,6 +449,12 @@ struct scoutfs_timespec {
* have changed. It is exposed via an ioctl and is then provided as an
* argument to data functions to protect racing modification.
*
* @online_blocks: The number of fixed 4k blocks currently allocated and
* storing data in the volume.
*
* @offline_blocks: The number of fixed 4k blocks that could be made
* online by staging.
*
* XXX
* - otime?
* - compat flags?
@@ -462,6 +468,8 @@ struct scoutfs_inode {
__le64 meta_seq;
__le64 data_seq;
__le64 data_version;
__le64 online_blocks;
__le64 offline_blocks;
__le64 next_readdir_pos;
__le32 nlink;
__le32 uid;

View File

@@ -178,6 +178,8 @@ struct scoutfs_ioctl_stat_more {
__u64 meta_seq;
__u64 data_seq;
__u64 data_version;
__u64 online_blocks;
__u64 offline_blocks;
} __packed;
#define SCOUTFS_IOC_STAT_MORE _IOW(SCOUTFS_IOCTL_MAGIC, 7, \

View File

@@ -49,9 +49,12 @@ static int stat_more_cmd(int argc, char **argv)
} else {
printf(" File: '%s'\n"
" meta_seq: %-20llu data_seq %-20llu"
" data_version: %-20llu\n",
" data_version: %-20llu\n"
" online_blocks: %-20llu "
" offline_blocks: %-20llu\n",
path, stm.meta_seq, stm.data_seq,
stm.data_version);
stm.data_version, stm.online_blocks,
stm.offline_blocks);
}
close(fd);