diff options
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index dcea9d706d9b..50891b39f366 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -330,8 +330,13 @@ struct btrfs_node { | |||
330 | struct btrfs_path { | 330 | struct btrfs_path { |
331 | struct extent_buffer *nodes[BTRFS_MAX_LEVEL]; | 331 | struct extent_buffer *nodes[BTRFS_MAX_LEVEL]; |
332 | int slots[BTRFS_MAX_LEVEL]; | 332 | int slots[BTRFS_MAX_LEVEL]; |
333 | /* if there is real range locking, this locks field will change */ | ||
334 | int locks[BTRFS_MAX_LEVEL]; | ||
333 | int reada; | 335 | int reada; |
336 | /* keep some upper locks as we walk down */ | ||
337 | int keep_locks; | ||
334 | int lowest_level; | 338 | int lowest_level; |
339 | int skip_locking; | ||
335 | }; | 340 | }; |
336 | 341 | ||
337 | /* | 342 | /* |
@@ -515,6 +520,8 @@ struct btrfs_fs_info { | |||
515 | spinlock_t hash_lock; | 520 | spinlock_t hash_lock; |
516 | struct mutex trans_mutex; | 521 | struct mutex trans_mutex; |
517 | struct mutex fs_mutex; | 522 | struct mutex fs_mutex; |
523 | struct mutex alloc_mutex; | ||
524 | struct mutex chunk_mutex; | ||
518 | struct list_head trans_list; | 525 | struct list_head trans_list; |
519 | struct list_head hashers; | 526 | struct list_head hashers; |
520 | struct list_head dead_roots; | 527 | struct list_head dead_roots; |
@@ -576,6 +583,10 @@ struct btrfs_fs_info { | |||
576 | */ | 583 | */ |
577 | struct btrfs_root { | 584 | struct btrfs_root { |
578 | struct extent_buffer *node; | 585 | struct extent_buffer *node; |
586 | |||
587 | /* the node lock is held while changing the node pointer */ | ||
588 | spinlock_t node_lock; | ||
589 | |||
579 | struct extent_buffer *commit_root; | 590 | struct extent_buffer *commit_root; |
580 | struct btrfs_root_item root_item; | 591 | struct btrfs_root_item root_item; |
581 | struct btrfs_key root_key; | 592 | struct btrfs_key root_key; |
@@ -1353,13 +1364,7 @@ struct btrfs_block_group_cache *btrfs_find_block_group(struct btrfs_root *root, | |||
1353 | struct btrfs_block_group_cache | 1364 | struct btrfs_block_group_cache |
1354 | *hint, u64 search_start, | 1365 | *hint, u64 search_start, |
1355 | int data, int owner); | 1366 | int data, int owner); |
1356 | int btrfs_inc_root_ref(struct btrfs_trans_handle *trans, | ||
1357 | struct btrfs_root *root, u64 owner_objectid); | ||
1358 | struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, | 1367 | struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, |
1359 | struct btrfs_root *root, u32 size, | ||
1360 | u64 root_objectid, | ||
1361 | u64 hint, u64 empty_size); | ||
1362 | struct extent_buffer *__btrfs_alloc_free_block(struct btrfs_trans_handle *trans, | ||
1363 | struct btrfs_root *root, | 1368 | struct btrfs_root *root, |
1364 | u32 blocksize, | 1369 | u32 blocksize, |
1365 | u64 root_objectid, | 1370 | u64 root_objectid, |
@@ -1368,8 +1373,6 @@ struct extent_buffer *__btrfs_alloc_free_block(struct btrfs_trans_handle *trans, | |||
1368 | int level, | 1373 | int level, |
1369 | u64 hint, | 1374 | u64 hint, |
1370 | u64 empty_size); | 1375 | u64 empty_size); |
1371 | int btrfs_grow_extent_tree(struct btrfs_trans_handle *trans, | ||
1372 | struct btrfs_root *root, u64 new_size); | ||
1373 | int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 new_size); | 1376 | int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 new_size); |
1374 | int btrfs_insert_extent_backref(struct btrfs_trans_handle *trans, | 1377 | int btrfs_insert_extent_backref(struct btrfs_trans_handle *trans, |
1375 | struct btrfs_root *root, | 1378 | struct btrfs_root *root, |
@@ -1409,6 +1412,10 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans, | |||
1409 | int btrfs_previous_item(struct btrfs_root *root, | 1412 | int btrfs_previous_item(struct btrfs_root *root, |
1410 | struct btrfs_path *path, u64 min_objectid, | 1413 | struct btrfs_path *path, u64 min_objectid, |
1411 | int type); | 1414 | int type); |
1415 | |||
1416 | struct extent_buffer *btrfs_root_node(struct btrfs_root *root); | ||
1417 | struct extent_buffer *btrfs_lock_root_node(struct btrfs_root *root); | ||
1418 | |||
1412 | int btrfs_cow_block(struct btrfs_trans_handle *trans, | 1419 | int btrfs_cow_block(struct btrfs_trans_handle *trans, |
1413 | struct btrfs_root *root, struct extent_buffer *buf, | 1420 | struct btrfs_root *root, struct extent_buffer *buf, |
1414 | struct extent_buffer *parent, int parent_slot, | 1421 | struct extent_buffer *parent, int parent_slot, |