diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-04-30 15:25:45 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-04-30 15:25:45 -0400 |
commit | 31f3c99b73483f7b738a886c552050cbd6128ff3 (patch) | |
tree | 35c961e01b8fe25525b9ac4a691fd931ac1dbe59 /fs/btrfs/ctree.h | |
parent | 308535a05e4c39d2be26e0aeee722682deeb6f77 (diff) |
Btrfs: allocator improvements, inode block groups
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index c432222d40e3..e6bf9919536a 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -174,6 +174,7 @@ struct btrfs_inode_item { | |||
174 | __le64 generation; | 174 | __le64 generation; |
175 | __le64 size; | 175 | __le64 size; |
176 | __le64 nblocks; | 176 | __le64 nblocks; |
177 | __le64 block_group; | ||
177 | __le32 nlink; | 178 | __le32 nlink; |
178 | __le32 uid; | 179 | __le32 uid; |
179 | __le32 gid; | 180 | __le32 gid; |
@@ -241,6 +242,7 @@ struct btrfs_device_item { | |||
241 | 242 | ||
242 | /* tag for the radix tree of block groups in ram */ | 243 | /* tag for the radix tree of block groups in ram */ |
243 | #define BTRFS_BLOCK_GROUP_DIRTY 0 | 244 | #define BTRFS_BLOCK_GROUP_DIRTY 0 |
245 | #define BTRFS_BLOCK_GROUP_AVAIL 1 | ||
244 | #define BTRFS_BLOCK_GROUP_HINTS 8 | 246 | #define BTRFS_BLOCK_GROUP_HINTS 8 |
245 | #define BTRFS_BLOCK_GROUP_SIZE (256 * 1024 * 1024) | 247 | #define BTRFS_BLOCK_GROUP_SIZE (256 * 1024 * 1024) |
246 | struct btrfs_block_group_item { | 248 | struct btrfs_block_group_item { |
@@ -410,6 +412,17 @@ static inline void btrfs_set_inode_nblocks(struct btrfs_inode_item *i, u64 val) | |||
410 | i->nblocks = cpu_to_le64(val); | 412 | i->nblocks = cpu_to_le64(val); |
411 | } | 413 | } |
412 | 414 | ||
415 | static inline u64 btrfs_inode_block_group(struct btrfs_inode_item *i) | ||
416 | { | ||
417 | return le64_to_cpu(i->block_group); | ||
418 | } | ||
419 | |||
420 | static inline void btrfs_set_inode_block_group(struct btrfs_inode_item *i, | ||
421 | u64 val) | ||
422 | { | ||
423 | i->block_group = cpu_to_le64(val); | ||
424 | } | ||
425 | |||
413 | static inline u32 btrfs_inode_nlink(struct btrfs_inode_item *i) | 426 | static inline u32 btrfs_inode_nlink(struct btrfs_inode_item *i) |
414 | { | 427 | { |
415 | return le32_to_cpu(i->nlink); | 428 | return le32_to_cpu(i->nlink); |
@@ -1054,10 +1067,13 @@ static inline void btrfs_mark_buffer_dirty(struct buffer_head *bh) | |||
1054 | btrfs_item_offset((leaf)->items + (slot)))) | 1067 | btrfs_item_offset((leaf)->items + (slot)))) |
1055 | 1068 | ||
1056 | /* extent-tree.c */ | 1069 | /* extent-tree.c */ |
1070 | struct btrfs_block_group_cache *btrfs_find_block_group(struct btrfs_root *root, | ||
1071 | struct btrfs_block_group_cache | ||
1072 | *hint, int data); | ||
1057 | int btrfs_inc_root_ref(struct btrfs_trans_handle *trans, | 1073 | int btrfs_inc_root_ref(struct btrfs_trans_handle *trans, |
1058 | struct btrfs_root *root); | 1074 | struct btrfs_root *root); |
1059 | struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, | 1075 | struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, |
1060 | struct btrfs_root *root); | 1076 | struct btrfs_root *root, u64 hint); |
1061 | int btrfs_alloc_extent(struct btrfs_trans_handle *trans, | 1077 | int btrfs_alloc_extent(struct btrfs_trans_handle *trans, |
1062 | struct btrfs_root *root, u64 owner, | 1078 | struct btrfs_root *root, u64 owner, |
1063 | u64 num_blocks, u64 search_start, | 1079 | u64 num_blocks, u64 search_start, |