tools headers UAPI: sync linux/fs.h with the kernel sources
authorAndrei Vagin <avagin@gmail.com>
Mon, 24 Mar 2025 06:53:27 +0000 (06:53 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 May 2025 00:48:16 +0000 (17:48 -0700)
Required for a new PAGEMAP_SCAN test to verify guard region reporting.

Link: https://lkml.kernel.org/r/20250324065328.107678-3-avagin@google.com
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/include/uapi/linux/fs.h

index 8a27bc5c7a7fef723990ccdb98b159e3b7329886..24ddf7bc4f25f002de452adea6a06b4c2138b324 100644 (file)
 #define BLOCK_SIZE_BITS 10
 #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
 
+/* flags for integrity meta */
+#define IO_INTEGRITY_CHK_GUARD         (1U << 0) /* enforce guard check */
+#define IO_INTEGRITY_CHK_REFTAG                (1U << 1) /* enforce ref check */
+#define IO_INTEGRITY_CHK_APPTAG                (1U << 2) /* enforce app check */
+
+#define IO_INTEGRITY_VALID_FLAGS (IO_INTEGRITY_CHK_GUARD | \
+                                 IO_INTEGRITY_CHK_REFTAG | \
+                                 IO_INTEGRITY_CHK_APPTAG)
+
 #define SEEK_SET       0       /* seek relative to beginning of file */
 #define SEEK_CUR       1       /* seek relative to current file position */
 #define SEEK_END       2       /* seek relative to end of file */
@@ -329,9 +338,16 @@ typedef int __bitwise __kernel_rwf_t;
 /* per-IO negation of O_APPEND */
 #define RWF_NOAPPEND   ((__force __kernel_rwf_t)0x00000020)
 
+/* Atomic Write */
+#define RWF_ATOMIC     ((__force __kernel_rwf_t)0x00000040)
+
+/* buffered IO that drops the cache after reading or writing data */
+#define RWF_DONTCACHE  ((__force __kernel_rwf_t)0x00000080)
+
 /* mask of flags supported by the kernel */
 #define RWF_SUPPORTED  (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\
-                        RWF_APPEND | RWF_NOAPPEND)
+                        RWF_APPEND | RWF_NOAPPEND | RWF_ATOMIC |\
+                        RWF_DONTCACHE)
 
 #define PROCFS_IOCTL_MAGIC 'f'
 
@@ -347,6 +363,7 @@ typedef int __bitwise __kernel_rwf_t;
 #define PAGE_IS_PFNZERO                (1 << 5)
 #define PAGE_IS_HUGE           (1 << 6)
 #define PAGE_IS_SOFT_DIRTY     (1 << 7)
+#define PAGE_IS_GUARD          (1 << 8)
 
 /*
  * struct page_region - Page region with flags