localalloc.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /* -*- mode: c; c-basic-offset: 8; -*-
  3. * vim: noexpandtab sw=8 ts=8 sts=0:
  4. *
  5. * localalloc.h
  6. *
  7. * Function prototypes
  8. *
  9. * Copyright (C) 2002, 2004 Oracle. All rights reserved.
  10. */
  11. #ifndef OCFS2_LOCALALLOC_H
  12. #define OCFS2_LOCALALLOC_H
  13. int ocfs2_load_local_alloc(struct ocfs2_super *osb);
  14. void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb);
  15. void ocfs2_la_set_sizes(struct ocfs2_super *osb, int requested_mb);
  16. unsigned int ocfs2_la_default_mb(struct ocfs2_super *osb);
  17. int ocfs2_begin_local_alloc_recovery(struct ocfs2_super *osb,
  18. int node_num,
  19. struct ocfs2_dinode **alloc_copy);
  20. int ocfs2_complete_local_alloc_recovery(struct ocfs2_super *osb,
  21. struct ocfs2_dinode *alloc);
  22. int ocfs2_alloc_should_use_local(struct ocfs2_super *osb,
  23. u64 bits);
  24. struct ocfs2_alloc_context;
  25. int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb,
  26. u32 bits_wanted,
  27. struct ocfs2_alloc_context *ac);
  28. int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb,
  29. handle_t *handle,
  30. struct ocfs2_alloc_context *ac,
  31. u32 bits_wanted,
  32. u32 *bit_off,
  33. u32 *num_bits);
  34. int ocfs2_free_local_alloc_bits(struct ocfs2_super *osb,
  35. handle_t *handle,
  36. struct ocfs2_alloc_context *ac,
  37. u32 bit_off,
  38. u32 num_bits);
  39. void ocfs2_local_alloc_seen_free_bits(struct ocfs2_super *osb,
  40. unsigned int num_clusters);
  41. void ocfs2_la_enable_worker(struct work_struct *work);
  42. #endif /* OCFS2_LOCALALLOC_H */