summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/free-space-cache.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2022-09-14 17:06:32 +0200
committerDavid Sterba <dsterba@suse.com>2022-12-05 18:00:37 +0100
commit390d89ccf672ec79b84037d4af834b2275ff7cb9 (patch)
tree982d38d7c47812540c007405f57bab1ca690dcac /fs/btrfs/free-space-cache.h
parentbtrfs: move BTRFS_MAX_MIRRORS into scrub.c (diff)
downloadlinux-390d89ccf672ec79b84037d4af834b2275ff7cb9.tar.xz
linux-390d89ccf672ec79b84037d4af834b2275ff7cb9.zip
btrfs: move discard stat defs to free-space-cache.h
These definitions are used for discard statistics, move them out of ctree.h and put them in free-space-cache.h. Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/free-space-cache.h')
-rw-r--r--fs/btrfs/free-space-cache.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/free-space-cache.h b/fs/btrfs/free-space-cache.h
index 6d419ba53e95..eaf30f6444dd 100644
--- a/fs/btrfs/free-space-cache.h
+++ b/fs/btrfs/free-space-cache.h
@@ -43,6 +43,15 @@ static inline bool btrfs_free_space_trimming_bitmap(
return (info->trim_state == BTRFS_TRIM_STATE_TRIMMING);
}
+/*
+ * Deltas are an effective way to populate global statistics. Give macro names
+ * to make it clear what we're doing. An example is discard_extents in
+ * btrfs_free_space_ctl.
+ */
+#define BTRFS_STAT_NR_ENTRIES 2
+#define BTRFS_STAT_CURR 0
+#define BTRFS_STAT_PREV 1
+
struct btrfs_free_space_ctl {
spinlock_t tree_lock;
struct rb_root free_space_offset;