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.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index fe9287b06496..365c4e1dde04 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -755,6 +755,8 @@ struct btrfs_space_info {
755 chunks for this space */ 755 chunks for this space */
756 unsigned int chunk_alloc:1; /* set if we are allocating a chunk */ 756 unsigned int chunk_alloc:1; /* set if we are allocating a chunk */
757 757
758 unsigned int flush:1; /* set if we are trying to make space */
759
758 unsigned int force_alloc; /* set if we need to force a chunk 760 unsigned int force_alloc; /* set if we need to force a chunk
759 alloc for this space */ 761 alloc for this space */
760 762
@@ -764,7 +766,7 @@ struct btrfs_space_info {
764 struct list_head block_groups[BTRFS_NR_RAID_TYPES]; 766 struct list_head block_groups[BTRFS_NR_RAID_TYPES];
765 spinlock_t lock; 767 spinlock_t lock;
766 struct rw_semaphore groups_sem; 768 struct rw_semaphore groups_sem;
767 atomic_t caching_threads; 769 wait_queue_head_t wait;
768}; 770};
769 771
770struct btrfs_block_rsv { 772struct btrfs_block_rsv {
@@ -824,6 +826,7 @@ struct btrfs_caching_control {
824 struct list_head list; 826 struct list_head list;
825 struct mutex mutex; 827 struct mutex mutex;
826 wait_queue_head_t wait; 828 wait_queue_head_t wait;
829 struct btrfs_work work;
827 struct btrfs_block_group_cache *block_group; 830 struct btrfs_block_group_cache *block_group;
828 u64 progress; 831 u64 progress;
829 atomic_t count; 832 atomic_t count;
@@ -1032,6 +1035,8 @@ struct btrfs_fs_info {
1032 struct btrfs_workers endio_write_workers; 1035 struct btrfs_workers endio_write_workers;
1033 struct btrfs_workers endio_freespace_worker; 1036 struct btrfs_workers endio_freespace_worker;
1034 struct btrfs_workers submit_workers; 1037 struct btrfs_workers submit_workers;
1038 struct btrfs_workers caching_workers;
1039
1035 /* 1040 /*
1036 * fixup workers take dirty pages that didn't properly go through 1041 * fixup workers take dirty pages that didn't properly go through
1037 * the cow mechanism and make them safe to write. It happens 1042 * the cow mechanism and make them safe to write. It happens
@@ -2128,7 +2133,7 @@ static inline bool btrfs_mixed_space_info(struct btrfs_space_info *space_info)
2128 2133
2129/* extent-tree.c */ 2134/* extent-tree.c */
2130static inline u64 btrfs_calc_trans_metadata_size(struct btrfs_root *root, 2135static inline u64 btrfs_calc_trans_metadata_size(struct btrfs_root *root,
2131 int num_items) 2136 unsigned num_items)
2132{ 2137{
2133 return (root->leafsize + root->nodesize * (BTRFS_MAX_LEVEL - 1)) * 2138 return (root->leafsize + root->nodesize * (BTRFS_MAX_LEVEL - 1)) *
2134 3 * num_items; 2139 3 * num_items;
@@ -2222,9 +2227,6 @@ void btrfs_set_inode_space_info(struct btrfs_root *root, struct inode *ionde);
2222void btrfs_clear_space_info_full(struct btrfs_fs_info *info); 2227void btrfs_clear_space_info_full(struct btrfs_fs_info *info);
2223int btrfs_check_data_free_space(struct inode *inode, u64 bytes); 2228int btrfs_check_data_free_space(struct inode *inode, u64 bytes);
2224void btrfs_free_reserved_data_space(struct inode *inode, u64 bytes); 2229void btrfs_free_reserved_data_space(struct inode *inode, u64 bytes);
2225int btrfs_trans_reserve_metadata(struct btrfs_trans_handle *trans,
2226 struct btrfs_root *root,
2227 int num_items);
2228void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans, 2230void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans,
2229 struct btrfs_root *root); 2231 struct btrfs_root *root);
2230int btrfs_orphan_reserve_metadata(struct btrfs_trans_handle *trans, 2232int btrfs_orphan_reserve_metadata(struct btrfs_trans_handle *trans,
@@ -2330,7 +2332,7 @@ struct btrfs_path *btrfs_alloc_path(void);
2330void btrfs_free_path(struct btrfs_path *p); 2332void btrfs_free_path(struct btrfs_path *p);
2331void btrfs_set_path_blocking(struct btrfs_path *p); 2333void btrfs_set_path_blocking(struct btrfs_path *p);
2332void btrfs_clear_path_blocking(struct btrfs_path *p, 2334void btrfs_clear_path_blocking(struct btrfs_path *p,
2333 struct extent_buffer *held); 2335 struct extent_buffer *held, int held_rw);
2334void btrfs_unlock_up_safe(struct btrfs_path *p, int level); 2336void btrfs_unlock_up_safe(struct btrfs_path *p, int level);
2335 2337
2336int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, 2338int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,