transaction.h 882 B

1234567891011121314151617181920212223242526272829303132333435
  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. int magic;
  10. struct list_head list;
  11. struct radix_tree_root dirty_pages;
  12. wait_queue_head_t writer_wait;
  13. wait_queue_head_t commit_wait;
  14. };
  15. struct btrfs_trans_handle {
  16. int magic;
  17. u64 transid;
  18. unsigned long blocks_reserved;
  19. unsigned long blocks_used;
  20. struct btrfs_transaction *transaction;
  21. int magic2;
  22. };
  23. int btrfs_end_transaction(struct btrfs_trans_handle *trans,
  24. struct btrfs_root *root);
  25. struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root,
  26. int num_blocks);
  27. int btrfs_write_and_wait_transaction(struct btrfs_trans_handle *trans,
  28. struct btrfs_root *root);
  29. int btrfs_commit_tree_roots(struct btrfs_trans_handle *trans,
  30. struct btrfs_root *root);
  31. #endif