diff options
author | Josef Bacik <josef@redhat.com> | 2010-06-21 14:48:16 -0400 |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2010-10-28 15:59:09 -0400 |
commit | 0af3d00bad38d3bb9912a60928ad0669f17bdb76 (patch) | |
tree | abbf4c773138a33dcde483ac60f016c4b5e55dcc /fs/btrfs/free-space-cache.h | |
parent | f6f94e2ab1b33f0082ac22d71f66385a60d8157f (diff) |
Btrfs: create special free space cache inode
In order to save free space cache, we need an inode to hold the data, and we
need a special item to point at the right inode for the right block group. So
first, create a special item that will point to the right inode, and the number
of extent entries we will have and the number of bitmaps we will have. We
truncate and pre-allocate space everytime to make sure it's uptodate.
This feature will be turned on as soon as you mount with -o space_cache, however
it is safe to boot into old kernels, they will just generate the cache the old
fashion way. When you boot back into a newer kernel we will notice that we
modified and not the cache and automatically discard the cache.
Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/free-space-cache.h')
-rw-r--r-- | fs/btrfs/free-space-cache.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/btrfs/free-space-cache.h b/fs/btrfs/free-space-cache.h index 890a8e79011b..45be29e5f01e 100644 --- a/fs/btrfs/free-space-cache.h +++ b/fs/btrfs/free-space-cache.h | |||
@@ -27,6 +27,17 @@ struct btrfs_free_space { | |||
27 | struct list_head list; | 27 | struct list_head list; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | struct inode *lookup_free_space_inode(struct btrfs_root *root, | ||
31 | struct btrfs_block_group_cache | ||
32 | *block_group, struct btrfs_path *path); | ||
33 | int create_free_space_inode(struct btrfs_root *root, | ||
34 | struct btrfs_trans_handle *trans, | ||
35 | struct btrfs_block_group_cache *block_group, | ||
36 | struct btrfs_path *path); | ||
37 | int btrfs_truncate_free_space_cache(struct btrfs_root *root, | ||
38 | struct btrfs_trans_handle *trans, | ||
39 | struct btrfs_path *path, | ||
40 | struct inode *inode); | ||
30 | int btrfs_add_free_space(struct btrfs_block_group_cache *block_group, | 41 | int btrfs_add_free_space(struct btrfs_block_group_cache *block_group, |
31 | u64 bytenr, u64 size); | 42 | u64 bytenr, u64 size); |
32 | int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group, | 43 | int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group, |