diff options
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 531db112c8bd..82491ba8fa40 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -43,11 +43,7 @@ struct btrfs_ordered_sum; | |||
43 | 43 | ||
44 | #define BTRFS_ACL_NOT_CACHED ((void *)-1) | 44 | #define BTRFS_ACL_NOT_CACHED ((void *)-1) |
45 | 45 | ||
46 | #ifdef CONFIG_LOCKDEP | 46 | #define BTRFS_MAX_LEVEL 8 |
47 | # define BTRFS_MAX_LEVEL 7 | ||
48 | #else | ||
49 | # define BTRFS_MAX_LEVEL 8 | ||
50 | #endif | ||
51 | 47 | ||
52 | /* holds pointers to all of the tree roots */ | 48 | /* holds pointers to all of the tree roots */ |
53 | #define BTRFS_ROOT_TREE_OBJECTID 1ULL | 49 | #define BTRFS_ROOT_TREE_OBJECTID 1ULL |
@@ -600,13 +596,27 @@ struct btrfs_block_group_item { | |||
600 | 596 | ||
601 | struct btrfs_space_info { | 597 | struct btrfs_space_info { |
602 | u64 flags; | 598 | u64 flags; |
603 | u64 total_bytes; | 599 | |
604 | u64 bytes_used; | 600 | u64 total_bytes; /* total bytes in the space */ |
605 | u64 bytes_pinned; | 601 | u64 bytes_used; /* total bytes used on disk */ |
606 | u64 bytes_reserved; | 602 | u64 bytes_pinned; /* total bytes pinned, will be freed when the |
607 | u64 bytes_readonly; | 603 | transaction finishes */ |
608 | int full; | 604 | u64 bytes_reserved; /* total bytes the allocator has reserved for |
609 | int force_alloc; | 605 | current allocations */ |
606 | u64 bytes_readonly; /* total bytes that are read only */ | ||
607 | |||
608 | /* delalloc accounting */ | ||
609 | u64 bytes_delalloc; /* number of bytes reserved for allocation, | ||
610 | this space is not necessarily reserved yet | ||
611 | by the allocator */ | ||
612 | u64 bytes_may_use; /* number of bytes that may be used for | ||
613 | delalloc */ | ||
614 | |||
615 | int full; /* indicates that we cannot allocate any more | ||
616 | chunks for this space */ | ||
617 | int force_alloc; /* set if we need to force a chunk alloc for | ||
618 | this space */ | ||
619 | |||
610 | struct list_head list; | 620 | struct list_head list; |
611 | 621 | ||
612 | /* for block groups in our same type */ | 622 | /* for block groups in our same type */ |
@@ -1715,7 +1725,8 @@ struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, | |||
1715 | u64 empty_size); | 1725 | u64 empty_size); |
1716 | struct extent_buffer *btrfs_init_new_buffer(struct btrfs_trans_handle *trans, | 1726 | struct extent_buffer *btrfs_init_new_buffer(struct btrfs_trans_handle *trans, |
1717 | struct btrfs_root *root, | 1727 | struct btrfs_root *root, |
1718 | u64 bytenr, u32 blocksize); | 1728 | u64 bytenr, u32 blocksize, |
1729 | int level); | ||
1719 | int btrfs_alloc_extent(struct btrfs_trans_handle *trans, | 1730 | int btrfs_alloc_extent(struct btrfs_trans_handle *trans, |
1720 | struct btrfs_root *root, | 1731 | struct btrfs_root *root, |
1721 | u64 num_bytes, u64 parent, u64 min_bytes, | 1732 | u64 num_bytes, u64 parent, u64 min_bytes, |
@@ -1785,6 +1796,16 @@ int btrfs_add_dead_reloc_root(struct btrfs_root *root); | |||
1785 | int btrfs_cleanup_reloc_trees(struct btrfs_root *root); | 1796 | int btrfs_cleanup_reloc_trees(struct btrfs_root *root); |
1786 | int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len); | 1797 | int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len); |
1787 | u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags); | 1798 | u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags); |
1799 | void btrfs_set_inode_space_info(struct btrfs_root *root, struct inode *ionde); | ||
1800 | int btrfs_check_metadata_free_space(struct btrfs_root *root); | ||
1801 | int btrfs_check_data_free_space(struct btrfs_root *root, struct inode *inode, | ||
1802 | u64 bytes); | ||
1803 | void btrfs_free_reserved_data_space(struct btrfs_root *root, | ||
1804 | struct inode *inode, u64 bytes); | ||
1805 | void btrfs_delalloc_reserve_space(struct btrfs_root *root, struct inode *inode, | ||
1806 | u64 bytes); | ||
1807 | void btrfs_delalloc_free_space(struct btrfs_root *root, struct inode *inode, | ||
1808 | u64 bytes); | ||
1788 | /* ctree.c */ | 1809 | /* ctree.c */ |
1789 | int btrfs_previous_item(struct btrfs_root *root, | 1810 | int btrfs_previous_item(struct btrfs_root *root, |
1790 | struct btrfs_path *path, u64 min_objectid, | 1811 | struct btrfs_path *path, u64 min_objectid, |
@@ -1834,9 +1855,7 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans, | |||
1834 | void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p); | 1855 | void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p); |
1835 | struct btrfs_path *btrfs_alloc_path(void); | 1856 | struct btrfs_path *btrfs_alloc_path(void); |
1836 | void btrfs_free_path(struct btrfs_path *p); | 1857 | void btrfs_free_path(struct btrfs_path *p); |
1837 | void btrfs_init_path(struct btrfs_path *p); | ||
1838 | void btrfs_set_path_blocking(struct btrfs_path *p); | 1858 | void btrfs_set_path_blocking(struct btrfs_path *p); |
1839 | void btrfs_clear_path_blocking(struct btrfs_path *p); | ||
1840 | void btrfs_unlock_up_safe(struct btrfs_path *p, int level); | 1859 | void btrfs_unlock_up_safe(struct btrfs_path *p, int level); |
1841 | 1860 | ||
1842 | int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, | 1861 | int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
@@ -2032,8 +2051,6 @@ int btrfs_merge_bio_hook(struct page *page, unsigned long offset, | |||
2032 | unsigned long btrfs_force_ra(struct address_space *mapping, | 2051 | unsigned long btrfs_force_ra(struct address_space *mapping, |
2033 | struct file_ra_state *ra, struct file *file, | 2052 | struct file_ra_state *ra, struct file *file, |
2034 | pgoff_t offset, pgoff_t last_index); | 2053 | pgoff_t offset, pgoff_t last_index); |
2035 | int btrfs_check_free_space(struct btrfs_root *root, u64 num_required, | ||
2036 | int for_del); | ||
2037 | int btrfs_page_mkwrite(struct vm_area_struct *vma, struct page *page); | 2054 | int btrfs_page_mkwrite(struct vm_area_struct *vma, struct page *page); |
2038 | int btrfs_readpage(struct file *file, struct page *page); | 2055 | int btrfs_readpage(struct file *file, struct page *page); |
2039 | void btrfs_delete_inode(struct inode *inode); | 2056 | void btrfs_delete_inode(struct inode *inode); |