Commit cb64e129 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: make XFS_DQUOT_CLUSTER_SIZE_FSB part of the ondisk format

Move the dquot cluster size #define to xfs_format.h.  It is an important
part of the ondisk format because the ondisk dquot record size is not an
even power of two, which means that the buffer size we use is
significant here because the kernel leaves slack space at the end of the
buffer to avoid having to deal with a dquot record crossing a block
boundary.

This is also an excuse to fix one of the longstanding discrepancies
between kernel and userspace libxfs headers.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarChandan Babu R <chandanrlinux@gmail.com>
parent 985a78fd
...@@ -1198,6 +1198,22 @@ typedef struct xfs_dqblk { ...@@ -1198,6 +1198,22 @@ typedef struct xfs_dqblk {
#define XFS_DQUOT_CRC_OFF offsetof(struct xfs_dqblk, dd_crc) #define XFS_DQUOT_CRC_OFF offsetof(struct xfs_dqblk, dd_crc)
/*
* This defines the unit of allocation of dquots.
*
* Currently, it is just one file system block, and a 4K blk contains 30
* (136 * 30 = 4080) dquots. It's probably not worth trying to make
* this more dynamic.
*
* However, if this number is changed, we have to make sure that we don't
* implicitly assume that we do allocations in chunks of a single filesystem
* block in the dquot/xqm code.
*
* This is part of the ondisk format because the structure size is not a power
* of two, which leaves slack at the end of the disk block.
*/
#define XFS_DQUOT_CLUSTER_SIZE_FSB (xfs_filblks_t)1
/* /*
* Remote symlink format and access functions. * Remote symlink format and access functions.
*/ */
......
...@@ -30,17 +30,6 @@ extern struct kmem_zone *xfs_qm_dqtrxzone; ...@@ -30,17 +30,6 @@ extern struct kmem_zone *xfs_qm_dqtrxzone;
!dqp->q_core.d_rtbcount && \ !dqp->q_core.d_rtbcount && \
!dqp->q_core.d_icount) !dqp->q_core.d_icount)
/*
* This defines the unit of allocation of dquots.
* Currently, it is just one file system block, and a 4K blk contains 30
* (136 * 30 = 4080) dquots. It's probably not worth trying to make
* this more dynamic.
* XXXsup However, if this number is changed, we have to make sure that we don't
* implicitly assume that we do allocations in chunks of a single filesystem
* block in the dquot/xqm code.
*/
#define XFS_DQUOT_CLUSTER_SIZE_FSB (xfs_filblks_t)1
/* Defaults for each quota type: time limits, warn limits, usage limits */ /* Defaults for each quota type: time limits, warn limits, usage limits */
struct xfs_def_quota { struct xfs_def_quota {
time64_t btimelimit; /* limit for blks timer */ time64_t btimelimit; /* limit for blks timer */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment