aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h18
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)
246struct btrfs_block_group_item { 248struct 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
415static inline u64 btrfs_inode_block_group(struct btrfs_inode_item *i)
416{
417 return le64_to_cpu(i->block_group);
418}
419
420static 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
413static inline u32 btrfs_inode_nlink(struct btrfs_inode_item *i) 426static 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 */
1070struct btrfs_block_group_cache *btrfs_find_block_group(struct btrfs_root *root,
1071 struct btrfs_block_group_cache
1072 *hint, int data);
1057int btrfs_inc_root_ref(struct btrfs_trans_handle *trans, 1073int btrfs_inc_root_ref(struct btrfs_trans_handle *trans,
1058 struct btrfs_root *root); 1074 struct btrfs_root *root);
1059struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, 1075struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
1060 struct btrfs_root *root); 1076 struct btrfs_root *root, u64 hint);
1061int btrfs_alloc_extent(struct btrfs_trans_handle *trans, 1077int 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,