xfs_rtalloc.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
  4. * All Rights Reserved.
  5. */
  6. #ifndef __XFS_RTALLOC_H__
  7. #define __XFS_RTALLOC_H__
  8. /* kernel only definitions and functions */
  9. struct xfs_mount;
  10. struct xfs_trans;
  11. #ifdef CONFIG_XFS_RT
  12. /* rtgroup superblock initialization */
  13. int xfs_rtmount_readsb(struct xfs_mount *mp);
  14. void xfs_rtmount_freesb(struct xfs_mount *mp);
  15. /*
  16. * Initialize realtime fields in the mount structure.
  17. */
  18. int /* error */
  19. xfs_rtmount_init(
  20. struct xfs_mount *mp); /* file system mount structure */
  21. void
  22. xfs_rtunmount_inodes(
  23. struct xfs_mount *mp);
  24. /*
  25. * Get the bitmap and summary inodes into the mount structure
  26. * at mount time.
  27. */
  28. int /* error */
  29. xfs_rtmount_inodes(
  30. struct xfs_mount *mp); /* file system mount structure */
  31. /*
  32. * Grow the realtime area of the filesystem.
  33. */
  34. int
  35. xfs_growfs_rt(
  36. struct xfs_mount *mp, /* file system mount structure */
  37. xfs_growfs_rt_t *in); /* user supplied growfs struct */
  38. int xfs_rtalloc_reinit_frextents(struct xfs_mount *mp);
  39. int xfs_growfs_check_rtgeom(const struct xfs_mount *mp, xfs_rfsblock_t dblocks,
  40. xfs_rfsblock_t rblocks, xfs_agblock_t rextsize);
  41. #else
  42. # define xfs_growfs_rt(mp,in) (-ENOSYS)
  43. # define xfs_rtalloc_reinit_frextents(m) (0)
  44. # define xfs_rtmount_readsb(mp) (0)
  45. # define xfs_rtmount_freesb(mp) ((void)0)
  46. static inline int /* error */
  47. xfs_rtmount_init(
  48. xfs_mount_t *mp) /* file system mount structure */
  49. {
  50. if (mp->m_sb.sb_rblocks == 0)
  51. return 0;
  52. xfs_warn(mp, "Not built with CONFIG_XFS_RT");
  53. return -ENOSYS;
  54. }
  55. # define xfs_rtmount_inodes(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (-ENOSYS))
  56. # define xfs_rtunmount_inodes(m)
  57. static inline int
  58. xfs_growfs_check_rtgeom(const struct xfs_mount *mp,
  59. xfs_rfsblock_t dblocks, xfs_rfsblock_t rblocks,
  60. xfs_extlen_t rextsize)
  61. {
  62. return 0;
  63. }
  64. #endif /* CONFIG_XFS_RT */
  65. int xfs_rtallocate_rtgs(struct xfs_trans *tp, xfs_fsblock_t bno_hint,
  66. xfs_rtxlen_t minlen, xfs_rtxlen_t maxlen, xfs_rtxlen_t prod,
  67. bool wasdel, bool initial_user_data, xfs_rtblock_t *bno,
  68. xfs_extlen_t *blen);
  69. #endif /* __XFS_RTALLOC_H__ */