diff options
author | Chris Mason <chris.mason@fusionio.com> | 2012-07-05 11:35:42 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2012-07-05 11:35:42 -0400 |
commit | 2588b4f8bedda4fc11379b079ac42fd47f34024f (patch) | |
tree | d4ac395f014c066cb6772682e57ff592f836bfea /ctree.h | |
parent | 06cf101a28d82183f562741184bfb61ba9347a57 (diff) | |
parent | 35d7b486b3e7655b812f67a7eec662dd31ffa302 (diff) |
Merge branch 'for-chris' of git://github.com/idryomov/btrfs-progs into 0.20
Diffstat (limited to 'ctree.h')
-rw-r--r-- | ctree.h | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -252,6 +252,13 @@ struct btrfs_chunk { /* additional stripes go here */ } __attribute__ ((__packed__)); +struct btrfs_free_space_header { + struct btrfs_disk_key location; + __le64 generation; + __le64 num_entries; + __le64 num_bitmaps; +} __attribute__ ((__packed__)); + static inline unsigned long btrfs_chunk_item_size(int num_stripes) { BUG_ON(num_stripes == 0); @@ -1427,6 +1434,8 @@ BTRFS_SETGET_FUNCS(dir_type, struct btrfs_dir_item, type, 8); BTRFS_SETGET_FUNCS(dir_name_len, struct btrfs_dir_item, name_len, 16); BTRFS_SETGET_FUNCS(dir_transid, struct btrfs_dir_item, transid, 64); +BTRFS_SETGET_STACK_FUNCS(stack_dir_name_len, struct btrfs_dir_item, name_len, 16); + static inline void btrfs_dir_item_key(struct extent_buffer *eb, struct btrfs_dir_item *item, struct btrfs_disk_key *key) @@ -1441,6 +1450,28 @@ static inline void btrfs_set_dir_item_key(struct extent_buffer *eb, write_eb_member(eb, item, struct btrfs_dir_item, location, key); } +/* struct btrfs_free_space_header */ +BTRFS_SETGET_FUNCS(free_space_entries, struct btrfs_free_space_header, + num_entries, 64); +BTRFS_SETGET_FUNCS(free_space_bitmaps, struct btrfs_free_space_header, + num_bitmaps, 64); +BTRFS_SETGET_FUNCS(free_space_generation, struct btrfs_free_space_header, + generation, 64); + +static inline void btrfs_free_space_key(struct extent_buffer *eb, + struct btrfs_free_space_header *h, + struct btrfs_disk_key *key) +{ + read_eb_member(eb, h, struct btrfs_free_space_header, location, key); +} + +static inline void btrfs_set_free_space_key(struct extent_buffer *eb, + struct btrfs_free_space_header *h, + struct btrfs_disk_key *key) +{ + write_eb_member(eb, h, struct btrfs_free_space_header, location, key); +} + /* struct btrfs_disk_key */ BTRFS_SETGET_STACK_FUNCS(disk_key_objectid, struct btrfs_disk_key, objectid, 64); |