aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2009-09-11 16:11:20 -0400
committerChris Mason <chris.mason@oracle.com>2009-09-21 19:23:50 -0400
commit1b2da372b0324b5c604fc8790e70a7efbeacb0b6 (patch)
tree13d7ba24660c865efd184a25b7b0ac8830a6d7f1 /fs/btrfs/ctree.h
parent25891f796d8d30f2b86b1e84d78721b44d573d70 (diff)
Btrfs: account for space used by the super mirrors
As we get closer to proper -ENOSPC handling in btrfs, we need more accurate space accounting for the space info's. Currently we exclude the free space for the super mirrors, but the space they take up isn't accounted for in any of the counters. This patch introduces bytes_super, which keeps track of the amount of bytes used for a super mirror in the block group cache and space info. This makes sure that our free space caclucations will be completely accurate. Signed-off-by: Josef Bacik <jbacik@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 2b15fb97d23f..80599b4e42bd 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -674,6 +674,7 @@ struct btrfs_space_info {
674 u64 bytes_reserved; /* total bytes the allocator has reserved for 674 u64 bytes_reserved; /* total bytes the allocator has reserved for
675 current allocations */ 675 current allocations */
676 u64 bytes_readonly; /* total bytes that are read only */ 676 u64 bytes_readonly; /* total bytes that are read only */
677 u64 bytes_super; /* total bytes reserved for the super blocks */
677 678
678 /* delalloc accounting */ 679 /* delalloc accounting */
679 u64 bytes_delalloc; /* number of bytes reserved for allocation, 680 u64 bytes_delalloc; /* number of bytes reserved for allocation,
@@ -746,6 +747,7 @@ struct btrfs_block_group_cache {
746 spinlock_t lock; 747 spinlock_t lock;
747 u64 pinned; 748 u64 pinned;
748 u64 reserved; 749 u64 reserved;
750 u64 bytes_super;
749 u64 flags; 751 u64 flags;
750 u64 sectorsize; 752 u64 sectorsize;
751 int extents_thresh; 753 int extents_thresh;