diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-03-16 16:20:31 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-03-16 16:20:31 -0400 |
commit | e089f05c18ab36ed5fa7e2319052e03ab800d518 (patch) | |
tree | f20d727233bb23fa5a37fc050cf0cc5c9d5e7b48 /fs/btrfs/ctree.h | |
parent | 88fd146c27da0f34c512f47e2b3776a0762ecd81 (diff) |
Btrfs: transaction handles everywhere
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index d15a2ed95076..68f0af39777f 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -4,6 +4,8 @@ | |||
4 | #include "list.h" | 4 | #include "list.h" |
5 | #include "kerncompat.h" | 5 | #include "kerncompat.h" |
6 | 6 | ||
7 | struct btrfs_trans_handle; | ||
8 | |||
7 | #define BTRFS_MAGIC "_BtRfS_M" | 9 | #define BTRFS_MAGIC "_BtRfS_M" |
8 | 10 | ||
9 | #define BTRFS_ROOT_TREE_OBJECTID 1 | 11 | #define BTRFS_ROOT_TREE_OBJECTID 1 |
@@ -200,6 +202,7 @@ struct btrfs_root { | |||
200 | struct btrfs_root_item root_item; | 202 | struct btrfs_root_item root_item; |
201 | struct btrfs_key root_key; | 203 | struct btrfs_key root_key; |
202 | u32 blocksize; | 204 | u32 blocksize; |
205 | struct btrfs_trans_handle *running_transaction; | ||
203 | }; | 206 | }; |
204 | 207 | ||
205 | /* the lower bits in the key flags defines the item type */ | 208 | /* the lower bits in the key flags defines the item type */ |
@@ -656,34 +659,46 @@ static inline u8 *btrfs_leaf_data(struct btrfs_leaf *l) | |||
656 | ((type *)(btrfs_leaf_data(leaf) + \ | 659 | ((type *)(btrfs_leaf_data(leaf) + \ |
657 | btrfs_item_offset((leaf)->items + (slot)))) | 660 | btrfs_item_offset((leaf)->items + (slot)))) |
658 | 661 | ||
659 | struct btrfs_buffer *btrfs_alloc_free_block(struct btrfs_root *root); | 662 | struct btrfs_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, |
660 | int btrfs_inc_ref(struct btrfs_root *root, struct btrfs_buffer *buf); | 663 | struct btrfs_root *root); |
661 | int btrfs_free_extent(struct btrfs_root *root, u64 blocknr, u64 num_blocks, | 664 | int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
662 | int pin); | 665 | struct btrfs_buffer *buf); |
663 | int btrfs_search_slot(struct btrfs_root *root, struct btrfs_key *key, | 666 | int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root |
664 | struct btrfs_path *p, int ins_len, int cow); | 667 | *root, u64 blocknr, u64 num_blocks, int pin); |
668 | int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root | ||
669 | *root, struct btrfs_key *key, struct btrfs_path *p, int | ||
670 | ins_len, int cow); | ||
665 | void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p); | 671 | void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p); |
666 | void btrfs_init_path(struct btrfs_path *p); | 672 | void btrfs_init_path(struct btrfs_path *p); |
667 | int btrfs_del_item(struct btrfs_root *root, struct btrfs_path *path); | 673 | int btrfs_del_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
668 | int btrfs_insert_item(struct btrfs_root *root, struct btrfs_key *key, | 674 | struct btrfs_path *path); |
669 | void *data, u32 data_size); | 675 | int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root |
670 | int btrfs_insert_empty_item(struct btrfs_root *root, struct btrfs_path *path, | 676 | *root, struct btrfs_key *key, void *data, u32 data_size); |
671 | struct btrfs_key *cpu_key, u32 data_size); | 677 | int btrfs_insert_empty_item(struct btrfs_trans_handle *trans, struct btrfs_root |
678 | *root, struct btrfs_path *path, struct btrfs_key | ||
679 | *cpu_key, u32 data_size); | ||
672 | int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path); | 680 | int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path); |
673 | int btrfs_leaf_free_space(struct btrfs_root *root, struct btrfs_leaf *leaf); | 681 | int btrfs_leaf_free_space(struct btrfs_root *root, struct btrfs_leaf *leaf); |
674 | int btrfs_drop_snapshot(struct btrfs_root *root, struct btrfs_buffer *snap); | 682 | int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root |
675 | int btrfs_finish_extent_commit(struct btrfs_root *root); | 683 | *root, struct btrfs_buffer *snap); |
676 | int btrfs_del_root(struct btrfs_root *root, struct btrfs_key *key); | 684 | int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, struct |
677 | int btrfs_insert_root(struct btrfs_root *root, struct btrfs_key *key, | 685 | btrfs_root *root); |
678 | struct btrfs_root_item *item); | 686 | int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
679 | int btrfs_update_root(struct btrfs_root *root, struct btrfs_key *key, | 687 | struct btrfs_key *key); |
680 | struct btrfs_root_item *item); | 688 | int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root |
681 | int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, | 689 | *root, struct btrfs_key *key, struct btrfs_root_item |
682 | struct btrfs_root_item *item, struct btrfs_key *key); | 690 | *item); |
683 | int btrfs_insert_dir_item(struct btrfs_root *root, char *name, int name_len, | 691 | int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root |
684 | u64 dir, u64 objectid, u8 type); | 692 | *root, struct btrfs_key *key, struct btrfs_root_item |
685 | int btrfs_lookup_dir_item(struct btrfs_root *root, struct btrfs_path *path, | 693 | *item); |
686 | u64 dir, char *name, int name_len, int mod); | 694 | int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct |
695 | btrfs_root_item *item, struct btrfs_key *key); | ||
696 | int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root | ||
697 | *root, char *name, int name_len, u64 dir, u64 | ||
698 | objectid, u8 type); | ||
699 | int btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root | ||
700 | *root, struct btrfs_path *path, u64 dir, char *name, | ||
701 | int name_len, int mod); | ||
687 | int btrfs_match_dir_item_name(struct btrfs_root *root, struct btrfs_path *path, | 702 | int btrfs_match_dir_item_name(struct btrfs_root *root, struct btrfs_path *path, |
688 | char *name, int name_len); | 703 | char *name, int name_len); |
689 | #endif | 704 | #endif |