root-tree.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef BTRFS_ROOT_TREE_H
  3. #define BTRFS_ROOT_TREE_H
  4. #include <linux/types.h>
  5. struct fscrypt_str;
  6. struct extent_buffer;
  7. struct btrfs_key;
  8. struct btrfs_root;
  9. struct btrfs_root_item;
  10. struct btrfs_path;
  11. struct btrfs_fs_info;
  12. struct btrfs_block_rsv;
  13. struct btrfs_trans_handle;
  14. int btrfs_subvolume_reserve_metadata(struct btrfs_root *root,
  15. struct btrfs_block_rsv *rsv,
  16. int nitems, bool use_global_rsv);
  17. int btrfs_add_root_ref(struct btrfs_trans_handle *trans, u64 root_id,
  18. u64 ref_id, u64 dirid, u64 sequence,
  19. const struct fscrypt_str *name);
  20. int btrfs_del_root_ref(struct btrfs_trans_handle *trans, u64 root_id,
  21. u64 ref_id, u64 dirid, u64 *sequence,
  22. const struct fscrypt_str *name);
  23. int btrfs_del_root(struct btrfs_trans_handle *trans, const struct btrfs_key *key);
  24. int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
  25. const struct btrfs_key *key,
  26. struct btrfs_root_item *item);
  27. int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
  28. struct btrfs_key *key, struct btrfs_root_item *item);
  29. int btrfs_find_root(struct btrfs_root *root, const struct btrfs_key *search_key,
  30. struct btrfs_path *path, struct btrfs_root_item *root_item,
  31. struct btrfs_key *root_key);
  32. int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info);
  33. void btrfs_set_root_node(struct btrfs_root_item *item,
  34. struct extent_buffer *node);
  35. void btrfs_check_and_init_root_item(struct btrfs_root_item *item);
  36. void btrfs_update_root_times(struct btrfs_trans_handle *trans, struct btrfs_root *root);
  37. #endif