From: Christoph Hellwig <hch@lst.de>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: "Darrick J . Wong" <djwong@kernel.org>, linux-xfs@vger.kernel.org
Subject: [PATCH 06/32] libxfs: add SZ_* constants
Date: Thu, 24 Sep 2026 12:03:56 +0200 [thread overview]
Message-ID: <20260924100512.2733748-7-hch@lst.de> (raw)
In-Reply-To: <20260924100512.2733748-1-hch@lst.de>
Import a slightly adapted version of <linux/sizes.h> from the kernel so that
we can use these constants in shared libxfs code.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
include/libxfs.h | 1 +
include/sizes.h | 67 +++++++++++++++++++++++++++++++++++++++++++
libxfs/xfs_platform.h | 1 +
3 files changed, 69 insertions(+)
create mode 100644 include/sizes.h
diff --git a/include/libxfs.h b/include/libxfs.h
index 7f0c22ef4991..34dd267831c0 100644
--- a/include/libxfs.h
+++ b/include/libxfs.h
@@ -18,6 +18,7 @@
#include "platform_defs.h"
#include "xfs.h"
+#include "sizes.h"
#include "list.h"
#include "hlist.h"
#include "cache.h"
diff --git a/include/sizes.h b/include/sizes.h
new file mode 100644
index 000000000000..69075e8f3370
--- /dev/null
+++ b/include/sizes.h
@@ -0,0 +1,67 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __SIZES_H__
+#define __SIZES_H__
+
+#define SZ_1 0x00000001
+#define SZ_2 0x00000002
+#define SZ_4 0x00000004
+#define SZ_8 0x00000008
+#define SZ_16 0x00000010
+#define SZ_32 0x00000020
+#define SZ_64 0x00000040
+#define SZ_128 0x00000080
+#define SZ_256 0x00000100
+#define SZ_512 0x00000200
+
+#define SZ_1K 0x00000400
+#define SZ_2K 0x00000800
+#define SZ_4K 0x00001000
+#define SZ_8K 0x00002000
+#define SZ_16K 0x00004000
+#define SZ_24K 0x00006000
+#define SZ_32K 0x00008000
+#define SZ_64K 0x00010000
+#define SZ_128K 0x00020000
+#define SZ_192K 0x00030000
+#define SZ_256K 0x00040000
+#define SZ_384K 0x00060000
+#define SZ_512K 0x00080000
+
+#define SZ_1M 0x00100000
+#define SZ_2M 0x00200000
+#define SZ_3M 0x00300000
+#define SZ_4M 0x00400000
+#define SZ_6M 0x00600000
+#define SZ_8M 0x00800000
+#define SZ_12M 0x00c00000
+#define SZ_16M 0x01000000
+#define SZ_18M 0x01200000
+#define SZ_24M 0x01800000
+#define SZ_32M 0x02000000
+#define SZ_64M 0x04000000
+#define SZ_128M 0x08000000
+#define SZ_256M 0x10000000
+#define SZ_512M 0x20000000
+
+#define SZ_1G 0x40000000
+#define SZ_2G 0x80000000
+
+#define SZ_4G 0x100000000ULL
+#define SZ_8G 0x200000000ULL
+#define SZ_16G 0x400000000ULL
+#define SZ_32G 0x800000000ULL
+#define SZ_64G 0x1000000000ULL
+#define SZ_128G 0x2000000000ULL
+#define SZ_256G 0x4000000000ULL
+#define SZ_512G 0x8000000000ULL
+
+#define SZ_1T 0x10000000000ULL
+#define SZ_2T 0x20000000000ULL
+#define SZ_4T 0x40000000000ULL
+#define SZ_8T 0x80000000000ULL
+#define SZ_16T 0x100000000000ULL
+#define SZ_32T 0x200000000000ULL
+#define SZ_64T 0x400000000000ULL
+#define SZ_128T 0x800000000000ULL
+
+#endif /* __SIZES_H__ */
diff --git a/libxfs/xfs_platform.h b/libxfs/xfs_platform.h
index a61d50de9dc0..0aeb80fb8244 100644
--- a/libxfs/xfs_platform.h
+++ b/libxfs/xfs_platform.h
@@ -45,6 +45,7 @@
#include "platform_defs.h"
#include "xfs.h"
+#include "sizes.h"
#include "list.h"
#include "hlist.h"
#include "cache.h"
--
2.53.0
next prev parent reply other threads:[~2026-09-24 10:05 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 10:03 xfsprogs support for RT data checksums Christoph Hellwig
2026-09-24 10:03 ` [PATCH 01/32] man: fix alignment of the rtstart field in ioctl_xfs_fsgeometry.2 Christoph Hellwig
2026-09-24 20:30 ` Darrick J. Wong
2026-09-26 6:15 ` Christoph Hellwig
2026-09-29 10:14 ` Andrey Albershteyn
2026-09-24 10:03 ` [PATCH 02/32] add cpu_to_le64 and le64_to_cpu_helpers Christoph Hellwig
2026-09-24 20:30 ` Darrick J. Wong
2026-09-24 10:03 ` [PATCH 03/32] libfrog: add a crc64_nvme implementation Christoph Hellwig
2026-09-24 10:03 ` [PATCH 04/32] libxfs: add DIV_ROUND_UP_ULL Christoph Hellwig
2026-09-24 20:44 ` Darrick J. Wong
2026-09-25 6:13 ` Christoph Hellwig
2026-09-24 10:03 ` [PATCH 05/32] libxfs: remove a spurious xfs_rtbitmap.h include in xfs_sb.c Christoph Hellwig
2026-09-25 23:27 ` Darrick J. Wong
2026-09-24 10:03 ` Christoph Hellwig [this message]
2026-09-25 23:27 ` [PATCH 06/32] libxfs: add SZ_* constants Darrick J. Wong
2026-09-24 10:03 ` [PATCH 07/32] xfs: remove spurious XBF_DONE clearing on readahead validation failure Christoph Hellwig
2026-09-24 10:03 ` [PATCH 08/32] xfs: hide b_flags manipulation from code outside of xfs_buf.c Christoph Hellwig
2026-09-24 10:03 ` [PATCH 09/32] FIXUP Christoph Hellwig
2026-09-25 23:29 ` Darrick J. Wong
2026-09-26 6:17 ` Christoph Hellwig
2026-09-24 10:04 ` [PATCH 10/32] xfs: add error injection for lazy bounce buffering Christoph Hellwig
2026-09-24 10:04 ` [PATCH 11/32] xfs: add xfs_daddr_to_rgno and xfs_daddr_to_rgbno helpers Christoph Hellwig
2026-09-24 10:04 ` [PATCH 12/32] FIXUP Christoph Hellwig
2026-09-24 10:04 ` [PATCH 13/32] xfs: introduce XFS_BLI_PREALLOC Christoph Hellwig
2026-09-24 10:04 ` [PATCH 14/32] xfs: centralize setting of buf_ops/buf_type/magic for rtblocks Christoph Hellwig
2026-09-24 10:04 ` [PATCH 15/32] xfs: factor out a xfs_rtfile_initialize_buf helper Christoph Hellwig
2026-09-24 10:04 ` [PATCH 16/32] xfs: add a xfs_rtblock_payload helper Christoph Hellwig
2026-09-24 10:04 ` [PATCH 17/32] xfs: prepare xfs_rtfile_initialize_blocks for larger than FSB blocks Christoph Hellwig
2026-09-24 10:04 ` [PATCH 18/32] FIXUP Christoph Hellwig
2026-09-24 10:04 ` [PATCH 19/32] xfs: define the RT data checksum on-disk format Christoph Hellwig
2026-09-24 10:04 ` [PATCH 20/32] FIXUP Christoph Hellwig
2026-09-24 10:04 ` [PATCH 21/32] xfs: add support for per-RTG csum files Christoph Hellwig
2026-09-24 10:04 ` [PATCH 22/32] FIXUP Christoph Hellwig
2026-09-24 10:04 ` [PATCH 23/32] xfs: calculate the log reservation for logging data checksum buffers Christoph Hellwig
2026-09-24 10:04 ` [PATCH 24/32] xfs: report RT data checksum information via XFS_FSOP_GEOM Christoph Hellwig
2026-09-24 10:04 ` [PATCH 25/32] xfs: enable RT data checksums Christoph Hellwig
2026-09-24 10:04 ` [PATCH 26/32] man: document the rtcsum geom fields Christoph Hellwig
2026-09-25 23:31 ` Darrick J. Wong
2026-09-26 6:17 ` Christoph Hellwig
2026-09-24 10:04 ` [PATCH 27/32] libfrog: print csum geometry information Christoph Hellwig
2026-09-25 23:32 ` Darrick J. Wong
2026-09-24 10:04 ` [PATCH 28/32] xfs_io: report checksum information from fs geometry in statfs Christoph Hellwig
2026-09-25 23:33 ` Darrick J. Wong
2026-09-26 6:18 ` Christoph Hellwig
2026-09-24 10:04 ` [PATCH 29/32] mkfs: support RT data checksums Christoph Hellwig
2026-09-25 23:39 ` Darrick J. Wong
2026-09-26 6:19 ` Christoph Hellwig
2026-09-24 10:04 ` [PATCH 30/32] xfs_db: support RT data checksum Christoph Hellwig
2026-09-25 23:43 ` Darrick J. Wong
2026-09-26 6:21 ` Christoph Hellwig
2026-09-26 18:20 ` Darrick J. Wong
2026-09-24 10:04 ` [PATCH 31/32] repair: support RT data checksums Christoph Hellwig
2026-09-25 23:54 ` Darrick J. Wong
2026-09-26 6:23 ` Christoph Hellwig
2026-09-27 0:01 ` Darrick J. Wong
2026-09-24 10:04 ` [PATCH 32/32] xfs_scrub: don't merge over unused space when data checksums are enabled Christoph Hellwig
2026-09-25 23:51 ` Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260924100512.2733748-7-hch@lst.de \
--to=hch@lst.de \
--cc=aalbersh@kernel.org \
--cc=djwong@kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox