xfs_rtalloc.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. /*
  13. * Initialize realtime fields in the mount structure.
  14. */
  15. int /* error */
  16. xfs_rtmount_init(
  17. struct xfs_mount *mp); /* file system mount structure */
  18. void
  19. xfs_rtunmount_inodes(
  20. struct xfs_mount *mp);
  21. /*
  22. * Get the bitmap and summary inodes into the mount structure
  23. * at mount time.
  24. */
  25. int /* error */
  26. xfs_rtmount_inodes(
  27. struct xfs_mount *mp); /* file system mount structure */
  28. /*
  29. * Grow the realtime area of the filesystem.
  30. */
  31. int
  32. xfs_growfs_rt(
  33. struct xfs_mount *mp, /* file system mount structure */
  34. xfs_growfs_rt_t *in); /* user supplied growfs struct */
  35. int xfs_rtalloc_reinit_frextents(struct xfs_mount *mp);
  36. #else
  37. # define xfs_growfs_rt(mp,in) (-ENOSYS)
  38. # define xfs_rtalloc_reinit_frextents(m) (0)
  39. static inline int /* error */
  40. xfs_rtmount_init(
  41. xfs_mount_t *mp) /* file system mount structure */
  42. {
  43. if (mp->m_sb.sb_rblocks == 0)
  44. return 0;
  45. xfs_warn(mp, "Not built with CONFIG_XFS_RT");
  46. return -ENOSYS;
  47. }
  48. # define xfs_rtmount_inodes(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (-ENOSYS))
  49. # define xfs_rtunmount_inodes(m)
  50. #endif /* CONFIG_XFS_RT */
  51. #endif /* __XFS_RTALLOC_H__ */