1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
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)
|