summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorJosef Bacik2014-10-31 14:49:34 +0100
committerChris Mason2014-11-21 02:20:04 +0100
commit633c0aad4c0243a506a3e8590551085ad78af82d (patch)
tree8cf20fe74c74e70409d4e60c80b65aab1c7f97b5 /fs/btrfs/ctree.h
parentbtrfs: fix typos in btrfs_check_super_valid (diff)
downloadkernel-qcow2-linux-633c0aad4c0243a506a3e8590551085ad78af82d.tar.gz
kernel-qcow2-linux-633c0aad4c0243a506a3e8590551085ad78af82d.tar.xz
kernel-qcow2-linux-633c0aad4c0243a506a3e8590551085ad78af82d.zip
Btrfs: move read only block groups onto their own list V2
Our gluster boxes were spending lots of time in statfs because our fs'es are huge. The problem is statfs loops through all of the block groups looking for read only block groups, and when you have several terabytes worth of data that ends up being a lot of block groups. Move the read only block groups onto a read only list and only proces that list in btrfs_account_ro_block_groups_free_space to reduce the amount of churn. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com> Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index b72b35867a7f..fa14081e3383 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1170,6 +1170,7 @@ struct btrfs_space_info {
struct percpu_counter total_bytes_pinned;
struct list_head list;
+ struct list_head ro_bgs;
struct rw_semaphore groups_sem;
/* for block groups in our same type */
@@ -1305,6 +1306,9 @@ struct btrfs_block_group_cache {
/* For delayed block group creation or deletion of empty block groups */
struct list_head bg_list;
+
+ /* For read-only block groups */
+ struct list_head ro_list;
};
/* delayed seq elem */