]>
Commit | Line | Data |
---|---|---|
2bd0ea18 | 1 | /* |
cc08d43e | 2 | * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. |
2bd0ea18 NS |
3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | |
5 | * under the terms of version 2 of the GNU General Public License as | |
6 | * published by the Free Software Foundation. | |
7 | * | |
8 | * This program is distributed in the hope that it would be useful, but | |
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
11 | * | |
12 | * Further, this software is distributed without any warranty that it is | |
13 | * free of the rightful claim of any third person regarding infringement | |
14 | * or the like. Any license provided herein, whether implied or | |
15 | * otherwise, applies only to this software file. Patent licenses, if | |
16 | * any, provided herein do not apply to combinations of this program with | |
17 | * other software, or any other product whatsoever. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License along | |
20 | * with this program; if not, write the Free Software Foundation, Inc., 59 | |
21 | * Temple Place - Suite 330, Boston MA 02111-1307, USA. | |
22 | * | |
23 | * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, | |
24 | * Mountain View, CA 94043, or: | |
25 | * | |
26 | * http://www.sgi.com | |
27 | * | |
28 | * For further information regarding this notice, see: | |
29 | * | |
30 | * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ | |
31 | */ | |
32 | #ifndef __XFS_DQBLK_H__ | |
33 | #define __XFS_DQBLK_H__ | |
34 | ||
35 | /* | |
36 | * The ondisk form of a dquot structure. | |
37 | */ | |
38 | #define XFS_DQUOT_MAGIC 0x4451 /* 'DQ' */ | |
39 | #define XFS_DQUOT_VERSION (u_int8_t)0x01 /* latest version number */ | |
40 | ||
41 | /* | |
42 | * This is the main portion of the on-disk representation of quota | |
43 | * information for a user. This is the q_core of the xfs_dquot_t that | |
44 | * is kept in kernel memory. We pad this with some more expansion room | |
45 | * to construct the on disk structure. | |
46 | */ | |
47 | typedef struct xfs_disk_dquot { | |
48 | /*16*/ u_int16_t d_magic; /* dquot magic = XFS_DQUOT_MAGIC */ | |
49 | /*8 */ u_int8_t d_version; /* dquot version */ | |
b36eef04 NS |
50 | /*8 */ u_int8_t d_flags; /* XFS_DQ_USER/PROJ/GROUP */ |
51 | /*32*/ xfs_dqid_t d_id; /* user,project,group id */ | |
2bd0ea18 NS |
52 | /*64*/ xfs_qcnt_t d_blk_hardlimit;/* absolute limit on disk blks */ |
53 | /*64*/ xfs_qcnt_t d_blk_softlimit;/* preferred limit on disk blks */ | |
54 | /*64*/ xfs_qcnt_t d_ino_hardlimit;/* maximum # allocated inodes */ | |
55 | /*64*/ xfs_qcnt_t d_ino_softlimit;/* preferred inode limit */ | |
56 | /*64*/ xfs_qcnt_t d_bcount; /* disk blocks owned by the user */ | |
57 | /*64*/ xfs_qcnt_t d_icount; /* inodes owned by the user */ | |
58 | /*32*/ __int32_t d_itimer; /* zero if within inode limits if not, | |
59 | this is when we refuse service */ | |
60 | /*32*/ __int32_t d_btimer; /* similar to above; for disk blocks */ | |
61 | /*16*/ xfs_qwarncnt_t d_iwarns; /* warnings issued wrt num inodes */ | |
62 | /*16*/ xfs_qwarncnt_t d_bwarns; /* warnings issued wrt disk blocks */ | |
63 | /*32*/ __int32_t d_pad0; /* 64 bit align */ | |
64 | /*64*/ xfs_qcnt_t d_rtb_hardlimit;/* absolute limit on realtime blks */ | |
65 | /*64*/ xfs_qcnt_t d_rtb_softlimit;/* preferred limit on RT disk blks */ | |
66 | /*64*/ xfs_qcnt_t d_rtbcount; /* realtime blocks owned */ | |
67 | /*32*/ __int32_t d_rtbtimer; /* similar to above; for RT disk blocks */ | |
68 | /*16*/ xfs_qwarncnt_t d_rtbwarns; /* warnings issued wrt RT disk blocks */ | |
69 | /*16*/ __uint16_t d_pad; | |
70 | } xfs_disk_dquot_t; | |
71 | ||
72 | /* | |
73 | * This is what goes on disk. This is separated from the xfs_disk_dquot because | |
74 | * carrying the unnecessary padding would be a waste of memory. | |
75 | */ | |
76 | typedef struct xfs_dqblk { | |
77 | xfs_disk_dquot_t dd_diskdq; /* portion that lives incore as well */ | |
78 | char dd_fill[32]; /* filling for posterity */ | |
79 | } xfs_dqblk_t; | |
80 | ||
81 | /* | |
82 | * flags for q_flags field in the dquot. | |
83 | */ | |
84 | #define XFS_DQ_USER 0x0001 /* a user quota */ | |
b36eef04 NS |
85 | /* #define XFS_DQ_PROJ 0x0002 -- project quota (IRIX) */ |
86 | #define XFS_DQ_GROUP 0x0004 /* a group quota */ | |
2bd0ea18 NS |
87 | #define XFS_DQ_FLOCKED 0x0008 /* flush lock taken */ |
88 | #define XFS_DQ_DIRTY 0x0010 /* dquot is dirty */ | |
89 | #define XFS_DQ_WANT 0x0020 /* for lookup/reclaim race */ | |
90 | #define XFS_DQ_INACTIVE 0x0040 /* dq off mplist & hashlist */ | |
91 | #define XFS_DQ_MARKER 0x0080 /* sentinel */ | |
92 | ||
93 | /* | |
b36eef04 | 94 | * In the worst case, when both user and group quotas are on, |
2bd0ea18 NS |
95 | * we can have a max of three dquots changing in a single transaction. |
96 | */ | |
97 | #define XFS_DQUOT_LOGRES(mp) (sizeof(xfs_disk_dquot_t) * 3) | |
98 | ||
99 | #endif /* __XFS_DQBLK_H__ */ |