Btrfs: Make free space cache code generic
authorLi Zefan <lizf@cn.fujitsu.com>
Tue, 29 Mar 2011 05:46:06 +0000 (13:46 +0800)
committerLi Zefan <lizf@cn.fujitsu.com>
Mon, 25 Apr 2011 08:46:03 +0000 (16:46 +0800)
commit34d52cb6c50b5a43901709998f59fb1c5a43dc4a
tree151c61795cceefc97e48e8209dc36303274fbe10
parentf38b6e754d8cc4605ac21d9c1094d569d88b163b
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>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/free-space-cache.c
fs/btrfs/free-space-cache.h