aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-16 16:20:31 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-16 16:20:31 -0400
commite089f05c18ab36ed5fa7e2319052e03ab800d518 (patch)
treef20d727233bb23fa5a37fc050cf0cc5c9d5e7b48 /fs/btrfs/ctree.h
parent88fd146c27da0f34c512f47e2b3776a0762ecd81 (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.h63
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
7struct 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
659struct btrfs_buffer *btrfs_alloc_free_block(struct btrfs_root *root); 662struct btrfs_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
660int btrfs_inc_ref(struct btrfs_root *root, struct btrfs_buffer *buf); 663 struct btrfs_root *root);
661int btrfs_free_extent(struct btrfs_root *root, u64 blocknr, u64 num_blocks, 664int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
662 int pin); 665 struct btrfs_buffer *buf);
663int btrfs_search_slot(struct btrfs_root *root, struct btrfs_key *key, 666int 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);
668int 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);
665void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p); 671void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p);
666void btrfs_init_path(struct btrfs_path *p); 672void btrfs_init_path(struct btrfs_path *p);
667int btrfs_del_item(struct btrfs_root *root, struct btrfs_path *path); 673int btrfs_del_item(struct btrfs_trans_handle *trans, struct btrfs_root *root,
668int btrfs_insert_item(struct btrfs_root *root, struct btrfs_key *key, 674 struct btrfs_path *path);
669 void *data, u32 data_size); 675int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root
670int 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); 677int 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);
672int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path); 680int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path);
673int btrfs_leaf_free_space(struct btrfs_root *root, struct btrfs_leaf *leaf); 681int btrfs_leaf_free_space(struct btrfs_root *root, struct btrfs_leaf *leaf);
674int btrfs_drop_snapshot(struct btrfs_root *root, struct btrfs_buffer *snap); 682int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root
675int btrfs_finish_extent_commit(struct btrfs_root *root); 683 *root, struct btrfs_buffer *snap);
676int btrfs_del_root(struct btrfs_root *root, struct btrfs_key *key); 684int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, struct
677int btrfs_insert_root(struct btrfs_root *root, struct btrfs_key *key, 685 btrfs_root *root);
678 struct btrfs_root_item *item); 686int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
679int btrfs_update_root(struct btrfs_root *root, struct btrfs_key *key, 687 struct btrfs_key *key);
680 struct btrfs_root_item *item); 688int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root
681int 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);
683int btrfs_insert_dir_item(struct btrfs_root *root, char *name, int name_len, 691int 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
685int btrfs_lookup_dir_item(struct btrfs_root *root, struct btrfs_path *path, 693 *item);
686 u64 dir, char *name, int name_len, int mod); 694int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct
695 btrfs_root_item *item, struct btrfs_key *key);
696int 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);
699int 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);
687int btrfs_match_dir_item_name(struct btrfs_root *root, struct btrfs_path *path, 702int 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