Dave Chinner | 6ca1c90 | 2013-08-12 20:49:26 +1000 | [diff] [blame^] | 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 | /* |
| 22 | * XFS On Disk Format Definitions |
| 23 | * |
| 24 | * This header file defines all the on-disk format definitions for |
| 25 | * general XFS objects. Directory and attribute related objects are defined in |
| 26 | * xfs_da_format.h, which log and log item formats are defined in |
| 27 | * xfs_log_format.h. Everything else goes here. |
| 28 | */ |
| 29 | |
| 30 | /* |
| 31 | * Dquot and dquot block format definitions |
| 32 | */ |
| 33 | #define XFS_DQUOT_MAGIC 0x4451 /* 'DQ' */ |
| 34 | #define XFS_DQUOT_VERSION (u_int8_t)0x01 /* latest version number */ |
| 35 | |
| 36 | /* |
| 37 | * This is the main portion of the on-disk representation of quota |
| 38 | * information for a user. This is the q_core of the xfs_dquot_t that |
| 39 | * is kept in kernel memory. We pad this with some more expansion room |
| 40 | * to construct the on disk structure. |
| 41 | */ |
| 42 | typedef struct xfs_disk_dquot { |
| 43 | __be16 d_magic; /* dquot magic = XFS_DQUOT_MAGIC */ |
| 44 | __u8 d_version; /* dquot version */ |
| 45 | __u8 d_flags; /* XFS_DQ_USER/PROJ/GROUP */ |
| 46 | __be32 d_id; /* user,project,group id */ |
| 47 | __be64 d_blk_hardlimit;/* absolute limit on disk blks */ |
| 48 | __be64 d_blk_softlimit;/* preferred limit on disk blks */ |
| 49 | __be64 d_ino_hardlimit;/* maximum # allocated inodes */ |
| 50 | __be64 d_ino_softlimit;/* preferred inode limit */ |
| 51 | __be64 d_bcount; /* disk blocks owned by the user */ |
| 52 | __be64 d_icount; /* inodes owned by the user */ |
| 53 | __be32 d_itimer; /* zero if within inode limits if not, |
| 54 | this is when we refuse service */ |
| 55 | __be32 d_btimer; /* similar to above; for disk blocks */ |
| 56 | __be16 d_iwarns; /* warnings issued wrt num inodes */ |
| 57 | __be16 d_bwarns; /* warnings issued wrt disk blocks */ |
| 58 | __be32 d_pad0; /* 64 bit align */ |
| 59 | __be64 d_rtb_hardlimit;/* absolute limit on realtime blks */ |
| 60 | __be64 d_rtb_softlimit;/* preferred limit on RT disk blks */ |
| 61 | __be64 d_rtbcount; /* realtime blocks owned */ |
| 62 | __be32 d_rtbtimer; /* similar to above; for RT disk blocks */ |
| 63 | __be16 d_rtbwarns; /* warnings issued wrt RT disk blocks */ |
| 64 | __be16 d_pad; |
| 65 | } xfs_disk_dquot_t; |
| 66 | |
| 67 | /* |
| 68 | * This is what goes on disk. This is separated from the xfs_disk_dquot because |
| 69 | * carrying the unnecessary padding would be a waste of memory. |
| 70 | */ |
| 71 | typedef struct xfs_dqblk { |
| 72 | xfs_disk_dquot_t dd_diskdq; /* portion that lives incore as well */ |
| 73 | char dd_fill[4]; /* filling for posterity */ |
| 74 | |
| 75 | /* |
| 76 | * These two are only present on filesystems with the CRC bits set. |
| 77 | */ |
| 78 | __be32 dd_crc; /* checksum */ |
| 79 | __be64 dd_lsn; /* last modification in log */ |
| 80 | uuid_t dd_uuid; /* location information */ |
| 81 | } xfs_dqblk_t; |
| 82 | |
| 83 | #define XFS_DQUOT_CRC_OFF offsetof(struct xfs_dqblk, dd_crc) |
| 84 | |
| 85 | |
| 86 | #endif /* __XFS_FORMAT_H__ */ |