|
@@ -42,6 +42,7 @@
|
|
#include <linux/atomic.h>
|
|
#include <linux/atomic.h>
|
|
#include <linux/hrtimer.h>
|
|
#include <linux/hrtimer.h>
|
|
#include <linux/uuid.h>
|
|
#include <linux/uuid.h>
|
|
|
|
+#include <linux/t10-pi.h>
|
|
|
|
|
|
#include <net/checksum.h>
|
|
#include <net/checksum.h>
|
|
|
|
|
|
@@ -627,7 +628,7 @@ static LIST_HEAD(sdebug_host_list);
|
|
static DEFINE_SPINLOCK(sdebug_host_list_lock);
|
|
static DEFINE_SPINLOCK(sdebug_host_list_lock);
|
|
|
|
|
|
static unsigned char *fake_storep; /* ramdisk storage */
|
|
static unsigned char *fake_storep; /* ramdisk storage */
|
|
-static struct sd_dif_tuple *dif_storep; /* protection info */
|
|
|
|
|
|
+static struct t10_pi_tuple *dif_storep; /* protection info */
|
|
static void *map_storep; /* provisioning map */
|
|
static void *map_storep; /* provisioning map */
|
|
|
|
|
|
static unsigned long map_size;
|
|
static unsigned long map_size;
|
|
@@ -682,7 +683,7 @@ static void *fake_store(unsigned long long lba)
|
|
return fake_storep + lba * sdebug_sector_size;
|
|
return fake_storep + lba * sdebug_sector_size;
|
|
}
|
|
}
|
|
|
|
|
|
-static struct sd_dif_tuple *dif_store(sector_t sector)
|
|
|
|
|
|
+static struct t10_pi_tuple *dif_store(sector_t sector)
|
|
{
|
|
{
|
|
sector = sector_div(sector, sdebug_store_sectors);
|
|
sector = sector_div(sector, sdebug_store_sectors);
|
|
|
|
|
|
@@ -2430,7 +2431,7 @@ static __be16 dif_compute_csum(const void *buf, int len)
|
|
return csum;
|
|
return csum;
|
|
}
|
|
}
|
|
|
|
|
|
-static int dif_verify(struct sd_dif_tuple *sdt, const void *data,
|
|
|
|
|
|
+static int dif_verify(struct t10_pi_tuple *sdt, const void *data,
|
|
sector_t sector, u32 ei_lba)
|
|
sector_t sector, u32 ei_lba)
|
|
{
|
|
{
|
|
__be16 csum = dif_compute_csum(data, sdebug_sector_size);
|
|
__be16 csum = dif_compute_csum(data, sdebug_sector_size);
|
|
@@ -2504,7 +2505,7 @@ static int prot_verify_read(struct scsi_cmnd *SCpnt, sector_t start_sec,
|
|
unsigned int sectors, u32 ei_lba)
|
|
unsigned int sectors, u32 ei_lba)
|
|
{
|
|
{
|
|
unsigned int i;
|
|
unsigned int i;
|
|
- struct sd_dif_tuple *sdt;
|
|
|
|
|
|
+ struct t10_pi_tuple *sdt;
|
|
sector_t sector;
|
|
sector_t sector;
|
|
|
|
|
|
for (i = 0; i < sectors; i++, ei_lba++) {
|
|
for (i = 0; i < sectors; i++, ei_lba++) {
|
|
@@ -2696,7 +2697,7 @@ static int prot_verify_write(struct scsi_cmnd *SCpnt, sector_t start_sec,
|
|
unsigned int sectors, u32 ei_lba)
|
|
unsigned int sectors, u32 ei_lba)
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|
|
- struct sd_dif_tuple *sdt;
|
|
|
|
|
|
+ struct t10_pi_tuple *sdt;
|
|
void *daddr;
|
|
void *daddr;
|
|
sector_t sector = start_sec;
|
|
sector_t sector = start_sec;
|
|
int ppage_offset;
|
|
int ppage_offset;
|
|
@@ -2722,7 +2723,7 @@ static int prot_verify_write(struct scsi_cmnd *SCpnt, sector_t start_sec,
|
|
}
|
|
}
|
|
|
|
|
|
for (ppage_offset = 0; ppage_offset < piter.length;
|
|
for (ppage_offset = 0; ppage_offset < piter.length;
|
|
- ppage_offset += sizeof(struct sd_dif_tuple)) {
|
|
|
|
|
|
+ ppage_offset += sizeof(struct t10_pi_tuple)) {
|
|
/* If we're at the end of the current
|
|
/* If we're at the end of the current
|
|
* data page advance to the next one
|
|
* data page advance to the next one
|
|
*/
|
|
*/
|
|
@@ -5026,7 +5027,7 @@ static int __init scsi_debug_init(void)
|
|
if (sdebug_dix) {
|
|
if (sdebug_dix) {
|
|
int dif_size;
|
|
int dif_size;
|
|
|
|
|
|
- dif_size = sdebug_store_sectors * sizeof(struct sd_dif_tuple);
|
|
|
|
|
|
+ dif_size = sdebug_store_sectors * sizeof(struct t10_pi_tuple);
|
|
dif_storep = vmalloc(dif_size);
|
|
dif_storep = vmalloc(dif_size);
|
|
|
|
|
|
pr_err("dif_storep %u bytes @ %p\n", dif_size, dif_storep);
|
|
pr_err("dif_storep %u bytes @ %p\n", dif_size, dif_storep);
|