xfs_format.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (c) 2000-2005 Silicon Graphics, Inc.
  3. * All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it would be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write the Free Software Foundation,
  16. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef __XFS_FORMAT_H__
  19. #define __XFS_FORMAT_H__
  20. /*
  21. * XFS On Disk Format Definitions
  22. *
  23. * This header file defines all the on-disk format definitions for
  24. * general XFS objects. Directory and attribute related objects are defined in
  25. * xfs_da_format.h, which log and log item formats are defined in
  26. * xfs_log_format.h. Everything else goes here.
  27. */
  28. /*
  29. * Dquot and dquot block format definitions
  30. */
  31. #define XFS_DQUOT_MAGIC 0x4451 /* 'DQ' */
  32. #define XFS_DQUOT_VERSION (u_int8_t)0x01 /* latest version number */
  33. /*
  34. * This is the main portion of the on-disk representation of quota
  35. * information for a user. This is the q_core of the xfs_dquot_t that
  36. * is kept in kernel memory. We pad this with some more expansion room
  37. * to construct the on disk structure.
  38. */
  39. typedef struct xfs_disk_dquot {
  40. __be16 d_magic; /* dquot magic = XFS_DQUOT_MAGIC */
  41. __u8 d_version; /* dquot version */
  42. __u8 d_flags; /* XFS_DQ_USER/PROJ/GROUP */
  43. __be32 d_id; /* user,project,group id */
  44. __be64 d_blk_hardlimit;/* absolute limit on disk blks */
  45. __be64 d_blk_softlimit;/* preferred limit on disk blks */
  46. __be64 d_ino_hardlimit;/* maximum # allocated inodes */
  47. __be64 d_ino_softlimit;/* preferred inode limit */
  48. __be64 d_bcount; /* disk blocks owned by the user */
  49. __be64 d_icount; /* inodes owned by the user */
  50. __be32 d_itimer; /* zero if within inode limits if not,
  51. this is when we refuse service */
  52. __be32 d_btimer; /* similar to above; for disk blocks */
  53. __be16 d_iwarns; /* warnings issued wrt num inodes */
  54. __be16 d_bwarns; /* warnings issued wrt disk blocks */
  55. __be32 d_pad0; /* 64 bit align */
  56. __be64 d_rtb_hardlimit;/* absolute limit on realtime blks */
  57. __be64 d_rtb_softlimit;/* preferred limit on RT disk blks */
  58. __be64 d_rtbcount; /* realtime blocks owned */
  59. __be32 d_rtbtimer; /* similar to above; for RT disk blocks */
  60. __be16 d_rtbwarns; /* warnings issued wrt RT disk blocks */
  61. __be16 d_pad;
  62. } xfs_disk_dquot_t;
  63. /*
  64. * This is what goes on disk. This is separated from the xfs_disk_dquot because
  65. * carrying the unnecessary padding would be a waste of memory.
  66. */
  67. typedef struct xfs_dqblk {
  68. xfs_disk_dquot_t dd_diskdq; /* portion that lives incore as well */
  69. char dd_fill[4]; /* filling for posterity */
  70. /*
  71. * These two are only present on filesystems with the CRC bits set.
  72. */
  73. __be32 dd_crc; /* checksum */
  74. __be64 dd_lsn; /* last modification in log */
  75. uuid_t dd_uuid; /* location information */
  76. } xfs_dqblk_t;
  77. #define XFS_DQUOT_CRC_OFF offsetof(struct xfs_dqblk, dd_crc)
  78. #endif /* __XFS_FORMAT_H__ */