fs, iov_iter: define meta io descriptor
authorAnuj Gupta <anuj20.g@samsung.com>
Thu, 28 Nov 2024 11:22:34 +0000 (16:52 +0530)
committerJens Axboe <axboe@kernel.dk>
Mon, 23 Dec 2024 15:17:16 +0000 (08:17 -0700)
Add flags to describe checks for integrity meta buffer. Also, introduce
a  new 'uio_meta' structure that upper layer can use to pass the
meta/integrity information.

Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20241128112240.8867-5-anuj20.g@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/uio.h
include/uapi/linux/fs.h

index 853f9de5aa05ab4dc8127ae21d825946f31d4f7c..8ada84e85447aa49f6fbabdcd1143d7ec1f11f0e 100644 (file)
@@ -82,6 +82,15 @@ struct iov_iter {
        };
 };
 
+typedef __u16 uio_meta_flags_t;
+
+struct uio_meta {
+       uio_meta_flags_t        flags;
+       u16                     app_tag;
+       u64                     seed;
+       struct iov_iter         iter;
+};
+
 static inline const struct iovec *iter_iov(const struct iov_iter *iter)
 {
        if (iter->iter_type == ITER_UBUF)
index 7539717707337a8cb22396a869baba3bafa08371..9070ef19f0a3f5cb0be56f50cd1c8e0db425ca9d 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 */