Skip to content

Commit 10783d0

Browse files
Anuj Guptaaxboe
authored andcommitted
fs, iov_iter: define meta io descriptor
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 <[email protected]> Signed-off-by: Anuj Gupta <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent fe8f4ca commit 10783d0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

include/linux/uio.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ struct iov_iter {
8282
};
8383
};
8484

85+
typedef __u16 uio_meta_flags_t;
86+
87+
struct uio_meta {
88+
uio_meta_flags_t flags;
89+
u16 app_tag;
90+
u64 seed;
91+
struct iov_iter iter;
92+
};
93+
8594
static inline const struct iovec *iter_iov(const struct iov_iter *iter)
8695
{
8796
if (iter->iter_type == ITER_UBUF)

include/uapi/linux/fs.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@
4040
#define BLOCK_SIZE_BITS 10
4141
#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
4242

43+
/* flags for integrity meta */
44+
#define IO_INTEGRITY_CHK_GUARD (1U << 0) /* enforce guard check */
45+
#define IO_INTEGRITY_CHK_REFTAG (1U << 1) /* enforce ref check */
46+
#define IO_INTEGRITY_CHK_APPTAG (1U << 2) /* enforce app check */
47+
48+
#define IO_INTEGRITY_VALID_FLAGS (IO_INTEGRITY_CHK_GUARD | \
49+
IO_INTEGRITY_CHK_REFTAG | \
50+
IO_INTEGRITY_CHK_APPTAG)
51+
4352
#define SEEK_SET 0 /* seek relative to beginning of file */
4453
#define SEEK_CUR 1 /* seek relative to current file position */
4554
#define SEEK_END 2 /* seek relative to end of file */

0 commit comments

Comments
 (0)