gh-83714: Check for struct statx.stx_atomic_write_unit_max_opt in configure (#140185)

stx_atomic_write_unit_max_opt was added in Linux 6.16, but is controlled
by the STATX_WRITE_ATOMIC mask bit added in Linux 6.11.  That's safe at
runtime because all kernels clear the reserved space in struct statx and
zero is a valid value for stx_atomic_write_unit_max_opt, and it avoids
allocating another mask bit, which are a limited resource.  But it also
means the kernel headers don't provide a way to check whether
stx_atomic_write_unit_max_opt exists, so add a configure check.
This commit is contained in:
Jeffrey Bosboom 2025-10-16 04:40:47 -07:00 committed by GitHub
parent ea4cc585cd
commit 5a31024da4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 28 additions and 2 deletions

View file

@ -3369,7 +3369,7 @@ static PyMemberDef pystatx_result_members[] = {
MM(stx_atomic_write_segments_max, Py_T_UINT, atomic_write_segments_max,
"maximum iovecs for direct I/O with torn-write protection"),
#endif
#if 0
#ifdef HAVE_STRUCT_STATX_STX_ATOMIC_WRITE_UNIT_MAX_OPT
MM(stx_atomic_write_unit_max_opt, Py_T_UINT, atomic_write_unit_max_opt,
"maximum optimized size for direct I/O with torn-write protection"),
#endif