diff options
author | David Sterba <dsterba@suse.com> | 2016-11-02 02:10:52 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-11-09 13:47:30 +0100 |
commit | 0f4ab474fe8b773249bcf090640e730ef725fa59 (patch) | |
tree | 04a07dd1ff89e557644baa8b79ef68b74b7f8d8b | |
parent | b74dbb86c0dd78a7d11835d1aa3bf4264249e085 (diff) |
btrfs-progs: add dev stats on-disk structure
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | ctree.h | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -919,6 +919,14 @@ struct btrfs_file_extent_item { } __attribute__ ((__packed__)); +struct btrfs_dev_stats_item { + /* + * grow this item struct at the end for future enhancements and keep + * the existing values unchanged + */ + __le64 values[BTRFS_DEV_STAT_VALUES_MAX]; +} __attribute__ ((__packed__)); + struct btrfs_csum_item { u8 csum; } __attribute__ ((__packed__)); @@ -2334,6 +2342,19 @@ static inline struct btrfs_disk_balance_args* btrfs_balance_item_sys( } /* + * btrfs_dev_stats_item helper, returns pointer to the raw array, do the + * endiannes conversion, @dsi is offset to eb data + */ +static inline __le64* btrfs_dev_stats_values(struct extent_buffer *eb, + struct btrfs_dev_stats_item *dsi) +{ + unsigned long offset = (unsigned long)dsi; + struct btrfs_dev_stats_item *p; + p = (struct btrfs_dev_stats_item *)(eb->data + offset); + return p->values; +} + +/* * this returns the number of bytes used by the item on disk, minus the * size of any extent headers. If a file is compressed on disk, this is * the compressed size |