transaction.h 784 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __TRANSACTION__
  2. #define __TRANSACTION__
  3. struct btrfs_transaction {
  4. u64 transid;
  5. unsigned long num_writers;
  6. int in_commit;
  7. int use_count;
  8. int commit_done;
  9. wait_queue_head_t writer_wait;
  10. wait_queue_head_t commit_wait;
  11. };
  12. struct btrfs_trans_handle {
  13. u64 transid;
  14. unsigned long blocks_reserved;
  15. unsigned long blocks_used;
  16. struct btrfs_transaction *transaction;
  17. };
  18. int btrfs_end_transaction(struct btrfs_trans_handle *trans,
  19. struct btrfs_root *root);
  20. struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root,
  21. int num_blocks);
  22. int btrfs_write_and_wait_transaction(struct btrfs_trans_handle *trans,
  23. struct btrfs_root *root);
  24. int btrfs_commit_tree_roots(struct btrfs_trans_handle *trans,
  25. struct btrfs_root *root);
  26. #endif