aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-08-12 06:49:26 -0400
committerBen Myers <bpm@sgi.com>2013-08-12 17:09:52 -0400
commit6ca1c9063d1952b20c61136e01e6a8987371616b (patch)
treea20a77fef2438674b52562f7e156cb5a9ea789d3
parent9fbe24d95ea36205a71195b378a163aa829dfe40 (diff)
xfs: separate dquot on disk format definitions out of xfs_quota.h
The on disk format definitions of the on-disk dquot, log formats and quota off log formats are all intertwined with other definitions for quotas. Separate them out into their own header file so they can easily be shared with userspace. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
-rw-r--r--fs/xfs/xfs_attr.c2
-rw-r--r--fs/xfs/xfs_bmap.c2
-rw-r--r--fs/xfs/xfs_bmap_btree.c2
-rw-r--r--fs/xfs/xfs_discard.c1
-rw-r--r--fs/xfs/xfs_dquot.c1
-rw-r--r--fs/xfs/xfs_dquot_item.c1
-rw-r--r--fs/xfs/xfs_format.h86
-rw-r--r--fs/xfs/xfs_icache.c1
-rw-r--r--fs/xfs/xfs_inode.c2
-rw-r--r--fs/xfs/xfs_ioctl.c1
-rw-r--r--fs/xfs/xfs_iomap.c1
-rw-r--r--fs/xfs/xfs_iops.c1
-rw-r--r--fs/xfs/xfs_log_format.h58
-rw-r--r--fs/xfs/xfs_log_recover.c2
-rw-r--r--fs/xfs/xfs_mount.c2
-rw-r--r--fs/xfs/xfs_qm.c1
-rw-r--r--fs/xfs/xfs_qm_bhv.c1
-rw-r--r--fs/xfs/xfs_qm_syscalls.c1
-rw-r--r--fs/xfs/xfs_quota.h126
-rw-r--r--fs/xfs/xfs_quotaops.c1
-rw-r--r--fs/xfs/xfs_rename.c2
-rw-r--r--fs/xfs/xfs_super.c1
-rw-r--r--fs/xfs/xfs_symlink.c2
-rw-r--r--fs/xfs/xfs_trace.c1
-rw-r--r--fs/xfs/xfs_trans.c2
-rw-r--r--fs/xfs/xfs_trans_dquot.c1
-rw-r--r--fs/xfs/xfs_types.h6
-rw-r--r--fs/xfs/xfs_utils.c2
-rw-r--r--fs/xfs/xfs_vnodeops.c2
29 files changed, 175 insertions, 137 deletions
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c
index 20fe3fe9d341..27a48bb07249 100644
--- a/fs/xfs/xfs_attr.c
+++ b/fs/xfs/xfs_attr.c
@@ -17,7 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_types.h" 20#include "xfs_format.h"
21#include "xfs_bit.h" 21#include "xfs_bit.h"
22#include "xfs_log.h" 22#include "xfs_log.h"
23#include "xfs_trans.h" 23#include "xfs_trans.h"
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 05c698ccb238..0343b44b8284 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -17,7 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_types.h" 20#include "xfs_format.h"
21#include "xfs_bit.h" 21#include "xfs_bit.h"
22#include "xfs_log.h" 22#include "xfs_log.h"
23#include "xfs_inum.h" 23#include "xfs_inum.h"
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c
index 0c61a22be6fd..bcee383b23b6 100644
--- a/fs/xfs/xfs_bmap_btree.c
+++ b/fs/xfs/xfs_bmap_btree.c
@@ -17,7 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_types.h" 20#include "xfs_format.h"
21#include "xfs_bit.h" 21#include "xfs_bit.h"
22#include "xfs_log.h" 22#include "xfs_log.h"
23#include "xfs_trans.h" 23#include "xfs_trans.h"
diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
index 69cf4fcde03e..65831f9babeb 100644
--- a/fs/xfs/xfs_discard.c
+++ b/fs/xfs/xfs_discard.c
@@ -16,6 +16,7 @@
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_format.h"
19#include "xfs_sb.h" 20#include "xfs_sb.h"
20#include "xfs_log.h" 21#include "xfs_log.h"
21#include "xfs_ag.h" 22#include "xfs_ag.h"
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 0adf27ecf3f1..36e1cf32f741 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -17,6 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_bit.h" 21#include "xfs_bit.h"
21#include "xfs_log.h" 22#include "xfs_log.h"
22#include "xfs_trans.h" 23#include "xfs_trans.h"
diff --git a/fs/xfs/xfs_dquot_item.c b/fs/xfs/xfs_dquot_item.c
index 57aa4b03720c..f07a4365def6 100644
--- a/fs/xfs/xfs_dquot_item.c
+++ b/fs/xfs/xfs_dquot_item.c
@@ -17,6 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_log.h" 21#include "xfs_log.h"
21#include "xfs_trans.h" 22#include "xfs_trans.h"
22#include "xfs_sb.h" 23#include "xfs_sb.h"
diff --git a/fs/xfs/xfs_format.h b/fs/xfs/xfs_format.h
new file mode 100644
index 000000000000..2b4f16668123
--- /dev/null
+++ b/fs/xfs/xfs_format.h
@@ -0,0 +1,86 @@
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 */
42typedef 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 */
71typedef 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__ */
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 3f90e1ceb8d6..d9a41671a4ad 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -17,6 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_types.h" 21#include "xfs_types.h"
21#include "xfs_log.h" 22#include "xfs_log.h"
22#include "xfs_log_priv.h" 23#include "xfs_log_priv.h"
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index bb262c25c8de..516a70a5a45d 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -19,7 +19,7 @@
19 19
20#include "xfs.h" 20#include "xfs.h"
21#include "xfs_fs.h" 21#include "xfs_fs.h"
22#include "xfs_types.h" 22#include "xfs_format.h"
23#include "xfs_log.h" 23#include "xfs_log.h"
24#include "xfs_inum.h" 24#include "xfs_inum.h"
25#include "xfs_trans.h" 25#include "xfs_trans.h"
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 6e2bca5d44d6..3124efafb8bf 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -17,6 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_log.h" 21#include "xfs_log.h"
21#include "xfs_trans.h" 22#include "xfs_trans.h"
22#include "xfs_sb.h" 23#include "xfs_sb.h"
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 6a7096422295..e4577f819f1f 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -17,6 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_log.h" 21#include "xfs_log.h"
21#include "xfs_trans.h" 22#include "xfs_trans.h"
22#include "xfs_sb.h" 23#include "xfs_sb.h"
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index 96dda62d497b..e44169843c40 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -17,6 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_acl.h" 21#include "xfs_acl.h"
21#include "xfs_log.h" 22#include "xfs_log.h"
22#include "xfs_trans.h" 23#include "xfs_trans.h"
diff --git a/fs/xfs/xfs_log_format.h b/fs/xfs/xfs_log_format.h
index d1e93d38bd39..5963ec73a95a 100644
--- a/fs/xfs/xfs_log_format.h
+++ b/fs/xfs/xfs_log_format.h
@@ -544,4 +544,62 @@ typedef struct xfs_efd_log_format_64 {
544 xfs_extent_64_t efd_extents[1]; /* array of extents freed */ 544 xfs_extent_64_t efd_extents[1]; /* array of extents freed */
545} xfs_efd_log_format_64_t; 545} xfs_efd_log_format_64_t;
546 546
547/*
548 * Dquot Log format definitions.
549 *
550 * The first two fields must be the type and size fitting into
551 * 32 bits : log_recovery code assumes that.
552 */
553typedef struct xfs_dq_logformat {
554 __uint16_t qlf_type; /* dquot log item type */
555 __uint16_t qlf_size; /* size of this item */
556 xfs_dqid_t qlf_id; /* usr/grp/proj id : 32 bits */
557 __int64_t qlf_blkno; /* blkno of dquot buffer */
558 __int32_t qlf_len; /* len of dquot buffer */
559 __uint32_t qlf_boffset; /* off of dquot in buffer */
560} xfs_dq_logformat_t;
561
562/*
563 * log format struct for QUOTAOFF records.
564 * The first two fields must be the type and size fitting into
565 * 32 bits : log_recovery code assumes that.
566 * We write two LI_QUOTAOFF logitems per quotaoff, the last one keeps a pointer
567 * to the first and ensures that the first logitem is taken out of the AIL
568 * only when the last one is securely committed.
569 */
570typedef struct xfs_qoff_logformat {
571 unsigned short qf_type; /* quotaoff log item type */
572 unsigned short qf_size; /* size of this item */
573 unsigned int qf_flags; /* USR and/or GRP */
574 char qf_pad[12]; /* padding for future */
575} xfs_qoff_logformat_t;
576
577
578/*
579 * Disk quotas status in m_qflags, and also sb_qflags. 16 bits.
580 */
581#define XFS_UQUOTA_ACCT 0x0001 /* user quota accounting ON */
582#define XFS_UQUOTA_ENFD 0x0002 /* user quota limits enforced */
583#define XFS_UQUOTA_CHKD 0x0004 /* quotacheck run on usr quotas */
584#define XFS_PQUOTA_ACCT 0x0008 /* project quota accounting ON */
585#define XFS_OQUOTA_ENFD 0x0010 /* other (grp/prj) quota limits enforced */
586#define XFS_OQUOTA_CHKD 0x0020 /* quotacheck run on other (grp/prj) quotas */
587#define XFS_GQUOTA_ACCT 0x0040 /* group quota accounting ON */
588
589/*
590 * Conversion to and from the combined OQUOTA flag (if necessary)
591 * is done only in xfs_sb_qflags_to_disk() and xfs_sb_qflags_from_disk()
592 */
593#define XFS_GQUOTA_ENFD 0x0080 /* group quota limits enforced */
594#define XFS_GQUOTA_CHKD 0x0100 /* quotacheck run on group quotas */
595#define XFS_PQUOTA_ENFD 0x0200 /* project quota limits enforced */
596#define XFS_PQUOTA_CHKD 0x0400 /* quotacheck run on project quotas */
597
598#define XFS_ALL_QUOTA_ACCT \
599 (XFS_UQUOTA_ACCT | XFS_GQUOTA_ACCT | XFS_PQUOTA_ACCT)
600#define XFS_ALL_QUOTA_ENFD \
601 (XFS_UQUOTA_ENFD | XFS_GQUOTA_ENFD | XFS_PQUOTA_ENFD)
602#define XFS_ALL_QUOTA_CHKD \
603 (XFS_UQUOTA_CHKD | XFS_GQUOTA_CHKD | XFS_PQUOTA_CHKD)
604
547#endif /* __XFS_LOG_FORMAT_H__ */ 605#endif /* __XFS_LOG_FORMAT_H__ */
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 7d3fc9ec56a2..7e480860fa75 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -17,7 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_types.h" 20#include "xfs_format.h"
21#include "xfs_bit.h" 21#include "xfs_bit.h"
22#include "xfs_log.h" 22#include "xfs_log.h"
23#include "xfs_inum.h" 23#include "xfs_inum.h"
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index a0fa8021330d..ca4a1a5776af 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -17,7 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_types.h" 20#include "xfs_format.h"
21#include "xfs_bit.h" 21#include "xfs_bit.h"
22#include "xfs_log.h" 22#include "xfs_log.h"
23#include "xfs_inum.h" 23#include "xfs_inum.h"
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 1e2361d0294e..92c36ac4bb23 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -17,6 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_bit.h" 21#include "xfs_bit.h"
21#include "xfs_log.h" 22#include "xfs_log.h"
22#include "xfs_trans.h" 23#include "xfs_trans.h"
diff --git a/fs/xfs/xfs_qm_bhv.c b/fs/xfs/xfs_qm_bhv.c
index 437a52d91f6d..3af50ccdfac1 100644
--- a/fs/xfs/xfs_qm_bhv.c
+++ b/fs/xfs/xfs_qm_bhv.c
@@ -17,6 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_log.h" 21#include "xfs_log.h"
21#include "xfs_trans.h" 22#include "xfs_trans.h"
22#include "xfs_sb.h" 23#include "xfs_sb.h"
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index 8d9e4c78e1ab..18519392c486 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -20,6 +20,7 @@
20 20
21#include "xfs.h" 21#include "xfs.h"
22#include "xfs_fs.h" 22#include "xfs_fs.h"
23#include "xfs_format.h"
23#include "xfs_bit.h" 24#include "xfs_bit.h"
24#include "xfs_log.h" 25#include "xfs_log.h"
25#include "xfs_trans.h" 26#include "xfs_trans.h"
diff --git a/fs/xfs/xfs_quota.h b/fs/xfs/xfs_quota.h
index b14f42c714b6..16bde32f140e 100644
--- a/fs/xfs/xfs_quota.h
+++ b/fs/xfs/xfs_quota.h
@@ -21,18 +21,6 @@
21struct xfs_trans; 21struct xfs_trans;
22 22
23/* 23/*
24 * The ondisk form of a dquot structure.
25 */
26#define XFS_DQUOT_MAGIC 0x4451 /* 'DQ' */
27#define XFS_DQUOT_VERSION (u_int8_t)0x01 /* latest version number */
28
29/*
30 * uid_t and gid_t are hard-coded to 32 bits in the inode.
31 * Hence, an 'id' in a dquot is 32 bits..
32 */
33typedef __uint32_t xfs_dqid_t;
34
35/*
36 * Even though users may not have quota limits occupying all 64-bits, 24 * Even though users may not have quota limits occupying all 64-bits,
37 * they may need 64-bit accounting. Hence, 64-bit quota-counters, 25 * they may need 64-bit accounting. Hence, 64-bit quota-counters,
38 * and quota-limits. This is a waste in the common case, but hey ... 26 * and quota-limits. This is a waste in the common case, but hey ...
@@ -41,55 +29,6 @@ typedef __uint64_t xfs_qcnt_t;
41typedef __uint16_t xfs_qwarncnt_t; 29typedef __uint16_t xfs_qwarncnt_t;
42 30
43/* 31/*
44 * This is the main portion of the on-disk representation of quota
45 * information for a user. This is the q_core of the xfs_dquot_t that
46 * is kept in kernel memory. We pad this with some more expansion room
47 * to construct the on disk structure.
48 */
49typedef struct xfs_disk_dquot {
50 __be16 d_magic; /* dquot magic = XFS_DQUOT_MAGIC */
51 __u8 d_version; /* dquot version */
52 __u8 d_flags; /* XFS_DQ_USER/PROJ/GROUP */
53 __be32 d_id; /* user,project,group id */
54 __be64 d_blk_hardlimit;/* absolute limit on disk blks */
55 __be64 d_blk_softlimit;/* preferred limit on disk blks */
56 __be64 d_ino_hardlimit;/* maximum # allocated inodes */
57 __be64 d_ino_softlimit;/* preferred inode limit */
58 __be64 d_bcount; /* disk blocks owned by the user */
59 __be64 d_icount; /* inodes owned by the user */
60 __be32 d_itimer; /* zero if within inode limits if not,
61 this is when we refuse service */
62 __be32 d_btimer; /* similar to above; for disk blocks */
63 __be16 d_iwarns; /* warnings issued wrt num inodes */
64 __be16 d_bwarns; /* warnings issued wrt disk blocks */
65 __be32 d_pad0; /* 64 bit align */
66 __be64 d_rtb_hardlimit;/* absolute limit on realtime blks */
67 __be64 d_rtb_softlimit;/* preferred limit on RT disk blks */
68 __be64 d_rtbcount; /* realtime blocks owned */
69 __be32 d_rtbtimer; /* similar to above; for RT disk blocks */
70 __be16 d_rtbwarns; /* warnings issued wrt RT disk blocks */
71 __be16 d_pad;
72} xfs_disk_dquot_t;
73
74/*
75 * This is what goes on disk. This is separated from the xfs_disk_dquot because
76 * carrying the unnecessary padding would be a waste of memory.
77 */
78typedef struct xfs_dqblk {
79 xfs_disk_dquot_t dd_diskdq; /* portion that lives incore as well */
80 char dd_fill[4]; /* filling for posterity */
81
82 /*
83 * These two are only present on filesystems with the CRC bits set.
84 */
85 __be32 dd_crc; /* checksum */
86 __be64 dd_lsn; /* last modification in log */
87 uuid_t dd_uuid; /* location information */
88} xfs_dqblk_t;
89
90#define XFS_DQUOT_CRC_OFF offsetof(struct xfs_dqblk, dd_crc)
91
92/*
93 * flags for q_flags field in the dquot. 32 * flags for q_flags field in the dquot.
94 */ 33 */
95#define XFS_DQ_USER 0x0001 /* a user quota */ 34#define XFS_DQ_USER 0x0001 /* a user quota */
@@ -131,71 +70,6 @@ typedef struct xfs_dqblk {
131#define XFS_DQUOT_LOGRES(mp) \ 70#define XFS_DQUOT_LOGRES(mp) \
132 ((sizeof(struct xfs_dq_logformat) + sizeof(struct xfs_disk_dquot)) * 6) 71 ((sizeof(struct xfs_dq_logformat) + sizeof(struct xfs_disk_dquot)) * 6)
133 72
134/*
135 * These are the structures used to lay out dquots and quotaoff
136 * records on the log. Quite similar to those of inodes.
137 */
138
139/*
140 * log format struct for dquots.
141 * The first two fields must be the type and size fitting into
142 * 32 bits : log_recovery code assumes that.
143 */
144typedef struct xfs_dq_logformat {
145 __uint16_t qlf_type; /* dquot log item type */
146 __uint16_t qlf_size; /* size of this item */
147 xfs_dqid_t qlf_id; /* usr/grp/proj id : 32 bits */
148 __int64_t qlf_blkno; /* blkno of dquot buffer */
149 __int32_t qlf_len; /* len of dquot buffer */
150 __uint32_t qlf_boffset; /* off of dquot in buffer */
151} xfs_dq_logformat_t;
152
153/*
154 * log format struct for QUOTAOFF records.
155 * The first two fields must be the type and size fitting into
156 * 32 bits : log_recovery code assumes that.
157 * We write two LI_QUOTAOFF logitems per quotaoff, the last one keeps a pointer
158 * to the first and ensures that the first logitem is taken out of the AIL
159 * only when the last one is securely committed.
160 */
161typedef struct xfs_qoff_logformat {
162 unsigned short qf_type; /* quotaoff log item type */
163 unsigned short qf_size; /* size of this item */
164 unsigned int qf_flags; /* USR and/or GRP */
165 char qf_pad[12]; /* padding for future */
166} xfs_qoff_logformat_t;
167
168
169/*
170 * Disk quotas status in m_qflags, and also sb_qflags. 16 bits.
171 */
172#define XFS_UQUOTA_ACCT 0x0001 /* user quota accounting ON */
173#define XFS_UQUOTA_ENFD 0x0002 /* user quota limits enforced */
174#define XFS_UQUOTA_CHKD 0x0004 /* quotacheck run on usr quotas */
175#define XFS_PQUOTA_ACCT 0x0008 /* project quota accounting ON */
176#define XFS_OQUOTA_ENFD 0x0010 /* other (grp/prj) quota limits enforced */
177#define XFS_OQUOTA_CHKD 0x0020 /* quotacheck run on other (grp/prj) quotas */
178#define XFS_GQUOTA_ACCT 0x0040 /* group quota accounting ON */
179
180/*
181 * Conversion to and from the combined OQUOTA flag (if necessary)
182 * is done only in xfs_sb_qflags_to_disk() and xfs_sb_qflags_from_disk()
183 */
184#define XFS_GQUOTA_ENFD 0x0080 /* group quota limits enforced */
185#define XFS_GQUOTA_CHKD 0x0100 /* quotacheck run on group quotas */
186#define XFS_PQUOTA_ENFD 0x0200 /* project quota limits enforced */
187#define XFS_PQUOTA_CHKD 0x0400 /* quotacheck run on project quotas */
188
189/*
190 * Quota Accounting/Enforcement flags
191 */
192#define XFS_ALL_QUOTA_ACCT \
193 (XFS_UQUOTA_ACCT | XFS_GQUOTA_ACCT | XFS_PQUOTA_ACCT)
194#define XFS_ALL_QUOTA_ENFD \
195 (XFS_UQUOTA_ENFD | XFS_GQUOTA_ENFD | XFS_PQUOTA_ENFD)
196#define XFS_ALL_QUOTA_CHKD \
197 (XFS_UQUOTA_CHKD | XFS_GQUOTA_CHKD | XFS_PQUOTA_CHKD)
198
199#define XFS_IS_QUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ACCT) 73#define XFS_IS_QUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ACCT)
200#define XFS_IS_UQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_UQUOTA_ACCT) 74#define XFS_IS_UQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_UQUOTA_ACCT)
201#define XFS_IS_PQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_PQUOTA_ACCT) 75#define XFS_IS_PQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_PQUOTA_ACCT)
diff --git a/fs/xfs/xfs_quotaops.c b/fs/xfs/xfs_quotaops.c
index 20e30f93b0c7..acf50712f4d7 100644
--- a/fs/xfs/xfs_quotaops.c
+++ b/fs/xfs/xfs_quotaops.c
@@ -16,6 +16,7 @@
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_format.h"
19#include "xfs_sb.h" 20#include "xfs_sb.h"
20#include "xfs_log.h" 21#include "xfs_log.h"
21#include "xfs_ag.h" 22#include "xfs_ag.h"
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
index 30ff5f401d28..0c1f8ef1880b 100644
--- a/fs/xfs/xfs_rename.c
+++ b/fs/xfs/xfs_rename.c
@@ -17,7 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_types.h" 20#include "xfs_format.h"
21#include "xfs_log.h" 21#include "xfs_log.h"
22#include "xfs_trans.h" 22#include "xfs_trans.h"
23#include "xfs_sb.h" 23#include "xfs_sb.h"
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 19922ebeea25..47a1abd94aca 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include "xfs.h" 19#include "xfs.h"
20#include "xfs_format.h"
20#include "xfs_log.h" 21#include "xfs_log.h"
21#include "xfs_inum.h" 22#include "xfs_inum.h"
22#include "xfs_trans.h" 23#include "xfs_trans.h"
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
index f4895b662fcb..80d550c18bd5 100644
--- a/fs/xfs/xfs_symlink.c
+++ b/fs/xfs/xfs_symlink.c
@@ -18,7 +18,7 @@
18 */ 18 */
19#include "xfs.h" 19#include "xfs.h"
20#include "xfs_fs.h" 20#include "xfs_fs.h"
21#include "xfs_types.h" 21#include "xfs_format.h"
22#include "xfs_bit.h" 22#include "xfs_bit.h"
23#include "xfs_log.h" 23#include "xfs_log.h"
24#include "xfs_trans.h" 24#include "xfs_trans.h"
diff --git a/fs/xfs/xfs_trace.c b/fs/xfs/xfs_trace.c
index b6e3897c1d9f..5d7b3e40705f 100644
--- a/fs/xfs/xfs_trace.c
+++ b/fs/xfs/xfs_trace.c
@@ -18,6 +18,7 @@
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_types.h" 20#include "xfs_types.h"
21#include "xfs_format.h"
21#include "xfs_log.h" 22#include "xfs_log.h"
22#include "xfs_trans.h" 23#include "xfs_trans.h"
23#include "xfs_sb.h" 24#include "xfs_sb.h"
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 35a229981354..1d2a0613cf6a 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -18,7 +18,7 @@
18 */ 18 */
19#include "xfs.h" 19#include "xfs.h"
20#include "xfs_fs.h" 20#include "xfs_fs.h"
21#include "xfs_types.h" 21#include "xfs_format.h"
22#include "xfs_log.h" 22#include "xfs_log.h"
23#include "xfs_trans.h" 23#include "xfs_trans.h"
24#include "xfs_sb.h" 24#include "xfs_sb.h"
diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
index 61407a847b86..54ee3c5dee76 100644
--- a/fs/xfs/xfs_trans_dquot.c
+++ b/fs/xfs/xfs_trans_dquot.c
@@ -17,6 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_format.h"
20#include "xfs_log.h" 21#include "xfs_log.h"
21#include "xfs_trans.h" 22#include "xfs_trans.h"
22#include "xfs_sb.h" 23#include "xfs_sb.h"
diff --git a/fs/xfs/xfs_types.h b/fs/xfs/xfs_types.h
index 39c48ca64a60..69074ac20ac3 100644
--- a/fs/xfs/xfs_types.h
+++ b/fs/xfs/xfs_types.h
@@ -177,4 +177,10 @@ struct xfs_name {
177 int len; 177 int len;
178}; 178};
179 179
180/*
181 * uid_t and gid_t are hard-coded to 32 bits in the inode.
182 * Hence, an 'id' in a dquot is 32 bits..
183 */
184typedef __uint32_t xfs_dqid_t;
185
180#endif /* __XFS_TYPES_H__ */ 186#endif /* __XFS_TYPES_H__ */
diff --git a/fs/xfs/xfs_utils.c b/fs/xfs/xfs_utils.c
index 0025c78ac03c..58386fab913e 100644
--- a/fs/xfs/xfs_utils.c
+++ b/fs/xfs/xfs_utils.c
@@ -17,7 +17,7 @@
17 */ 17 */
18#include "xfs.h" 18#include "xfs.h"
19#include "xfs_fs.h" 19#include "xfs_fs.h"
20#include "xfs_types.h" 20#include "xfs_format.h"
21#include "xfs_log.h" 21#include "xfs_log.h"
22#include "xfs_trans.h" 22#include "xfs_trans.h"
23#include "xfs_sb.h" 23#include "xfs_sb.h"
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index dc730ac272be..c2d96cd43809 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -19,7 +19,7 @@
19 19
20#include "xfs.h" 20#include "xfs.h"
21#include "xfs_fs.h" 21#include "xfs_fs.h"
22#include "xfs_types.h" 22#include "xfs_format.h"
23#include "xfs_bit.h" 23#include "xfs_bit.h"
24#include "xfs_log.h" 24#include "xfs_log.h"
25#include "xfs_trans.h" 25#include "xfs_trans.h"