You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.7 KiB

diff --git a/kernel/iscsi.c b/kernel/iscsi.c
index 9ad3047..37d7753 100644
--- a/kernel/iscsi.c
+++ b/kernel/iscsi.c
@@ -773,6 +773,7 @@ static void set_offset_and_length(const struct iet_volume *lu,
break;
case READ_16:
case WRITE_16:
+#ifdef WRITE_SAME_16
case WRITE_SAME_16:
*off = (u64)cmd[2] << 56 | (u64)cmd[3] << 48 |
(u64)cmd[4] << 40 | (u64)cmd[5] << 32 |
@@ -781,6 +782,7 @@ static void set_offset_and_length(const struct iet_volume *lu,
*len = (u32)cmd[10] << 24 | (u32)cmd[11] << 16 |
(u32)cmd[12] << 8 | (u32)cmd[13];
break;
+#endif
case PERSISTENT_RESERVE_OUT:
{
const struct persistent_reserve_out *pr_out =
@@ -1036,6 +1038,7 @@ static void scsi_cmnd_start(struct iscsi_conn *conn, struct iscsi_cmnd *req)
case WRITE_10:
case WRITE_16:
case WRITE_VERIFY:
+#ifdef WRITE_SAME_16
case WRITE_SAME_16:
{
struct iscsi_sess_param *param = &conn->session->param;
@@ -1104,6 +1107,7 @@ static void scsi_cmnd_start(struct iscsi_conn *conn, struct iscsi_cmnd *req)
}
break;
}
+#endif
error:
default:
eprintk("Unsupported %x\n", req_hdr->scb[0]);
diff --git a/kernel/iscsi_dbg.h b/kernel/iscsi_dbg.h
index 8c9b928..ad5c6d4 100644
--- a/kernel/iscsi_dbg.h
+++ b/kernel/iscsi_dbg.h
@@ -12,7 +12,9 @@
#define D_IOMODE (1UL << 8)
#define D_UAC (1UL << 9)
#define D_PR (1UL << 10)
+#ifdef WRITE_SAME_16
#define D_VAAI (1UL << 11)
+#endif
#define D_DATA (D_READ | D_WRITE)
diff --git a/kernel/target_disk.c b/kernel/target_disk.c
index 6b1de2c..ca28e4e 100644
--- a/kernel/target_disk.c
+++ b/kernel/target_disk.c
@@ -408,6 +408,7 @@ static void build_write_response(struct iscsi_cmnd *cmnd)
iscsi_cmnd_set_sense(cmnd, MEDIUM_ERROR, 0x03, 0x0);
}
+#ifdef WRITE_SAME_16
static void build_write_same_response(struct iscsi_cmnd *cmnd) {
int err;
struct tio *target_tio;
@@ -475,6 +476,7 @@ static void build_write_same_response(struct iscsi_cmnd *cmnd) {
tio_put(target_tio);
}
+#endif
static void build_sync_cache_response(struct iscsi_cmnd *cmnd)
{
@@ -618,9 +620,11 @@ static int disk_execute_cmnd(struct iscsi_cmnd *cmnd)
case WRITE_VERIFY:
send_scsi_rsp(cmnd, build_write_response);
break;
+#ifdef WRITE_SAME_16
case WRITE_SAME_16:
send_scsi_rsp(cmnd, build_write_same_response);
break;
+#endif
case SYNCHRONIZE_CACHE:
send_scsi_rsp(cmnd, build_sync_cache_response);
break;
diff --git a/kernel/volume.c b/kernel/volume.c
index 8beeb1e..6ad2a3d 100644
--- a/kernel/volume.c
+++ b/kernel/volume.c
@@ -446,7 +446,9 @@ int is_volume_reserved(struct iet_volume *volume, u64 sid, u8 *scb)
case WRITE_10:
case WRITE_12:
case WRITE_16:
+#ifdef WRITE_SAME_16
case WRITE_SAME_16:
+#endif
case WRITE_VERIFY:
case SYNCHRONIZE_CACHE:
if (write_excl || excl_access)