From: Darrick J. Wong Date: Fri, 4 Sep 2020 20:03:20 +0000 (-0400) Subject: xfs: make XFS_DQUOT_CLUSTER_SIZE_FSB part of the ondisk format X-Git-Tag: v5.9.0-rc0~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8330c89c9e2dd49f2ab4ec71865ee23f409c5237;p=thirdparty%2Fxfsprogs-dev.git xfs: make XFS_DQUOT_CLUSTER_SIZE_FSB part of the ondisk format Source kernel commit: cb64e1299364a51bf60e96f2a35df31f47aa2eee 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: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h index 3ccaf0a8c..7548336ff 100644 --- a/libxfs/xfs_format.h +++ b/libxfs/xfs_format.h @@ -1198,6 +1198,22 @@ typedef struct xfs_dqblk { #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. */ diff --git a/libxfs/xfs_quota_defs.h b/libxfs/xfs_quota_defs.h index 70ba784d9..e2da08055 100644 --- a/libxfs/xfs_quota_defs.h +++ b/libxfs/xfs_quota_defs.h @@ -18,8 +18,6 @@ typedef uint64_t xfs_qcnt_t; typedef uint16_t xfs_qwarncnt_t; -#define XFS_DQUOT_CLUSTER_SIZE_FSB (xfs_filblks_t)1 - /* * flags for q_flags field in the dquot. */