aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/t10-pi.h
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2014-09-26 19:20:07 -0400
committerJens Axboe <axboe@fb.com>2014-09-27 09:14:59 -0600
commit2341c2f8c33196d02cf5a721746eea4e3c06674a (patch)
treecd51e37c084f016ea05a253b7b9041866d2e12fb /include/linux/t10-pi.h
parentblock: Don't merge requests if integrity flags differ (diff)
downloadlinux-dev-2341c2f8c33196d02cf5a721746eea4e3c06674a.tar.xz
linux-dev-2341c2f8c33196d02cf5a721746eea4e3c06674a.zip
block: Add T10 Protection Information functions
The T10 Protection Information format is also used by some devices that do not go through the SCSI layer (virtual block devices, NVMe). Relocate the relevant functions to a block layer library that can be used without involving SCSI. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/t10-pi.h')
-rw-r--r--include/linux/t10-pi.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/t10-pi.h b/include/linux/t10-pi.h
new file mode 100644
index 000000000000..6a8b9942632d
--- /dev/null
+++ b/include/linux/t10-pi.h
@@ -0,0 +1,22 @@
+#ifndef _LINUX_T10_PI_H
+#define _LINUX_T10_PI_H
+
+#include <linux/types.h>
+#include <linux/blkdev.h>
+
+/*
+ * T10 Protection Information tuple.
+ */
+struct t10_pi_tuple {
+ __be16 guard_tag; /* Checksum */
+ __be16 app_tag; /* Opaque storage */
+ __be32 ref_tag; /* Target LBA or indirect LBA */
+};
+
+
+extern struct blk_integrity t10_pi_type1_crc;
+extern struct blk_integrity t10_pi_type1_ip;
+extern struct blk_integrity t10_pi_type3_crc;
+extern struct blk_integrity t10_pi_type3_ip;
+
+#endif