diff options
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index ccea0648e106..eee060f88113 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -126,7 +126,6 @@ struct btrfs_ordered_sum; | |||
126 | static int btrfs_csum_sizes[] = { 4, 0 }; | 126 | static int btrfs_csum_sizes[] = { 4, 0 }; |
127 | 127 | ||
128 | /* four bytes for CRC32 */ | 128 | /* four bytes for CRC32 */ |
129 | //#define BTRFS_CRC32_SIZE 4 | ||
130 | #define BTRFS_EMPTY_DIR_SIZE 0 | 129 | #define BTRFS_EMPTY_DIR_SIZE 0 |
131 | 130 | ||
132 | #define BTRFS_FT_UNKNOWN 0 | 131 | #define BTRFS_FT_UNKNOWN 0 |
@@ -283,8 +282,8 @@ struct btrfs_header { | |||
283 | } __attribute__ ((__packed__)); | 282 | } __attribute__ ((__packed__)); |
284 | 283 | ||
285 | #define BTRFS_NODEPTRS_PER_BLOCK(r) (((r)->nodesize - \ | 284 | #define BTRFS_NODEPTRS_PER_BLOCK(r) (((r)->nodesize - \ |
286 | sizeof(struct btrfs_header)) / \ | 285 | sizeof(struct btrfs_header)) / \ |
287 | sizeof(struct btrfs_key_ptr)) | 286 | sizeof(struct btrfs_key_ptr)) |
288 | #define __BTRFS_LEAF_DATA_SIZE(bs) ((bs) - sizeof(struct btrfs_header)) | 287 | #define __BTRFS_LEAF_DATA_SIZE(bs) ((bs) - sizeof(struct btrfs_header)) |
289 | #define BTRFS_LEAF_DATA_SIZE(r) (__BTRFS_LEAF_DATA_SIZE(r->leafsize)) | 288 | #define BTRFS_LEAF_DATA_SIZE(r) (__BTRFS_LEAF_DATA_SIZE(r->leafsize)) |
290 | #define BTRFS_MAX_INLINE_DATA_SIZE(r) (BTRFS_LEAF_DATA_SIZE(r) - \ | 289 | #define BTRFS_MAX_INLINE_DATA_SIZE(r) (BTRFS_LEAF_DATA_SIZE(r) - \ |
@@ -1512,7 +1511,7 @@ static inline struct btrfs_header *btrfs_buffer_header(struct extent_buffer *eb) | |||
1512 | 1511 | ||
1513 | static inline int btrfs_is_leaf(struct extent_buffer *eb) | 1512 | static inline int btrfs_is_leaf(struct extent_buffer *eb) |
1514 | { | 1513 | { |
1515 | return (btrfs_header_level(eb) == 0); | 1514 | return btrfs_header_level(eb) == 0; |
1516 | } | 1515 | } |
1517 | 1516 | ||
1518 | /* struct btrfs_root_item */ | 1517 | /* struct btrfs_root_item */ |
@@ -1597,8 +1596,8 @@ static inline unsigned long btrfs_leaf_data(struct extent_buffer *l) | |||
1597 | /* struct btrfs_file_extent_item */ | 1596 | /* struct btrfs_file_extent_item */ |
1598 | BTRFS_SETGET_FUNCS(file_extent_type, struct btrfs_file_extent_item, type, 8); | 1597 | BTRFS_SETGET_FUNCS(file_extent_type, struct btrfs_file_extent_item, type, 8); |
1599 | 1598 | ||
1600 | static inline unsigned long btrfs_file_extent_inline_start(struct | 1599 | static inline unsigned long |
1601 | btrfs_file_extent_item *e) | 1600 | btrfs_file_extent_inline_start(struct btrfs_file_extent_item *e) |
1602 | { | 1601 | { |
1603 | unsigned long offset = (unsigned long)e; | 1602 | unsigned long offset = (unsigned long)e; |
1604 | offset += offsetof(struct btrfs_file_extent_item, disk_bytenr); | 1603 | offset += offsetof(struct btrfs_file_extent_item, disk_bytenr); |
@@ -1660,20 +1659,20 @@ static inline int btrfs_set_root_name(struct btrfs_root *root, | |||
1660 | const char *name, int len) | 1659 | const char *name, int len) |
1661 | { | 1660 | { |
1662 | /* if we already have a name just free it */ | 1661 | /* if we already have a name just free it */ |
1663 | if (root->name) | 1662 | kfree(root->name); |
1664 | kfree(root->name); | ||
1665 | 1663 | ||
1666 | root->name = kmalloc(len+1, GFP_KERNEL); | 1664 | root->name = kmalloc(len+1, GFP_KERNEL); |
1667 | if (!root->name) | 1665 | if (!root->name) |
1668 | return -ENOMEM; | 1666 | return -ENOMEM; |
1669 | 1667 | ||
1670 | memcpy(root->name, name, len); | 1668 | memcpy(root->name, name, len); |
1671 | root->name[len] ='\0'; | 1669 | root->name[len] = '\0'; |
1672 | 1670 | ||
1673 | return 0; | 1671 | return 0; |
1674 | } | 1672 | } |
1675 | 1673 | ||
1676 | static inline u32 btrfs_level_size(struct btrfs_root *root, int level) { | 1674 | static inline u32 btrfs_level_size(struct btrfs_root *root, int level) |
1675 | { | ||
1677 | if (level == 0) | 1676 | if (level == 0) |
1678 | return root->leafsize; | 1677 | return root->leafsize; |
1679 | return root->nodesize; | 1678 | return root->nodesize; |
@@ -1707,9 +1706,9 @@ int btrfs_cross_ref_exist(struct btrfs_trans_handle *trans, | |||
1707 | int btrfs_extent_post_op(struct btrfs_trans_handle *trans, | 1706 | int btrfs_extent_post_op(struct btrfs_trans_handle *trans, |
1708 | struct btrfs_root *root); | 1707 | struct btrfs_root *root); |
1709 | int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy); | 1708 | int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy); |
1710 | struct btrfs_block_group_cache *btrfs_lookup_block_group(struct | 1709 | struct btrfs_block_group_cache *btrfs_lookup_block_group( |
1711 | btrfs_fs_info *info, | 1710 | struct btrfs_fs_info *info, |
1712 | u64 bytenr); | 1711 | u64 bytenr); |
1713 | u64 btrfs_find_block_group(struct btrfs_root *root, | 1712 | u64 btrfs_find_block_group(struct btrfs_root *root, |
1714 | u64 search_start, u64 search_hint, int owner); | 1713 | u64 search_start, u64 search_hint, int owner); |
1715 | struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, | 1714 | struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, |
@@ -1908,8 +1907,9 @@ int btrfs_search_root(struct btrfs_root *root, u64 search_start, | |||
1908 | int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid, | 1907 | int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid, |
1909 | struct btrfs_root *latest_root); | 1908 | struct btrfs_root *latest_root); |
1910 | /* dir-item.c */ | 1909 | /* dir-item.c */ |
1911 | int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root | 1910 | int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, |
1912 | *root, const char *name, int name_len, u64 dir, | 1911 | struct btrfs_root *root, const char *name, |
1912 | int name_len, u64 dir, | ||
1913 | struct btrfs_key *location, u8 type, u64 index); | 1913 | struct btrfs_key *location, u8 type, u64 index); |
1914 | struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, | 1914 | struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, |
1915 | struct btrfs_root *root, | 1915 | struct btrfs_root *root, |