aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2011-03-29 01:46:06 -0400
committerLi Zefan <lizf@cn.fujitsu.com>2011-04-25 04:46:03 -0400
commit34d52cb6c50b5a43901709998f59fb1c5a43dc4a (patch)
tree151c61795cceefc97e48e8209dc36303274fbe10 /fs/btrfs/ctree.h
parentf38b6e754d8cc4605ac21d9c1094d569d88b163b (diff)
Btrfs: Make free space cache code generic
So we can re-use the code to cache free inode numbers. The change is quite straightforward. Two new structures are introduced. - struct btrfs_free_space_ctl We move those variables that are used for caching free space from struct btrfs_block_group_cache to this new struct. - struct btrfs_free_space_op We do block group specific work (e.g. calculation of extents threshold) through functions registered in this struct. And then we can remove references to struct btrfs_block_group_cache. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 2e61fe1b6b8c..d17e4a3b8bf7 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -830,9 +830,6 @@ struct btrfs_block_group_cache {
830 u64 bytes_super; 830 u64 bytes_super;
831 u64 flags; 831 u64 flags;
832 u64 sectorsize; 832 u64 sectorsize;
833 int extents_thresh;
834 int free_extents;
835 int total_bitmaps;
836 unsigned int ro:1; 833 unsigned int ro:1;
837 unsigned int dirty:1; 834 unsigned int dirty:1;
838 unsigned int iref:1; 835 unsigned int iref:1;
@@ -847,9 +844,7 @@ struct btrfs_block_group_cache {
847 struct btrfs_space_info *space_info; 844 struct btrfs_space_info *space_info;
848 845
849 /* free space cache stuff */ 846 /* free space cache stuff */
850 spinlock_t tree_lock; 847 struct btrfs_free_space_ctl *free_space_ctl;
851 struct rb_root free_space_offset;
852 u64 free_space;
853 848
854 /* block group cache stuff */ 849 /* block group cache stuff */
855 struct rb_node cache_node; 850 struct rb_node cache_node;