]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #include "iscsi/task.h" |
2 | #include "iscsi/iscsi.h" | |
3 | #include "iscsi/conn.h" | |
4 | ||
5 | #include "spdk/env.h" | |
6 | #include "spdk/event.h" | |
7 | ||
8 | #include "spdk_internal/log.h" | |
9 | ||
10 | SPDK_LOG_REGISTER_TRACE_FLAG("iscsi", SPDK_TRACE_ISCSI) | |
11 | ||
12 | struct spdk_iscsi_task * | |
13 | spdk_iscsi_task_get(uint32_t *owner_task_ctr, struct spdk_iscsi_task *parent) | |
14 | { | |
15 | struct spdk_iscsi_task *task; | |
16 | ||
17 | task = calloc(1, sizeof(*task)); | |
18 | ||
19 | return task; | |
20 | } | |
21 | ||
22 | void | |
23 | spdk_scsi_task_put(struct spdk_scsi_task *task) | |
24 | { | |
25 | free(task); | |
26 | } | |
27 | ||
28 | void | |
29 | spdk_put_pdu(struct spdk_iscsi_pdu *pdu) | |
30 | { | |
31 | if (!pdu) | |
32 | return; | |
33 | ||
34 | if (pdu->ref < 0) { | |
35 | CU_FAIL("negative ref count"); | |
36 | pdu->ref = 0; | |
37 | } | |
38 | ||
39 | if (pdu->ref == 0) { | |
40 | if (pdu->data && !pdu->data_from_mempool) { | |
41 | free(pdu->data); | |
42 | } | |
43 | free(pdu); | |
44 | } | |
45 | } | |
46 | ||
47 | struct spdk_iscsi_pdu * | |
48 | spdk_get_pdu(void) | |
49 | { | |
50 | struct spdk_iscsi_pdu *pdu; | |
51 | ||
52 | pdu = malloc(sizeof(*pdu)); | |
53 | if (!pdu) { | |
54 | return NULL; | |
55 | } | |
56 | ||
57 | memset(pdu, 0, offsetof(struct spdk_iscsi_pdu, ahs_data)); | |
58 | pdu->ref = 1; | |
59 | ||
60 | return pdu; | |
61 | } | |
62 | ||
63 | void | |
64 | spdk_scsi_task_process_null_lun(struct spdk_scsi_task *task) | |
65 | { | |
66 | } | |
67 | ||
68 | void | |
69 | spdk_scsi_dev_queue_task(struct spdk_scsi_dev *dev, | |
70 | struct spdk_scsi_task *task) | |
71 | { | |
72 | } | |
73 | ||
74 | struct spdk_scsi_port * | |
75 | spdk_scsi_dev_find_port_by_id(struct spdk_scsi_dev *dev, uint64_t id) | |
76 | { | |
77 | return NULL; | |
78 | } | |
79 | ||
80 | int | |
81 | spdk_scsi_port_construct(struct spdk_scsi_port *port, uint64_t id, uint16_t index, | |
82 | const char *name) | |
83 | { | |
84 | return 0; | |
85 | } | |
86 | ||
87 | void | |
88 | spdk_scsi_dev_queue_mgmt_task(struct spdk_scsi_dev *dev, | |
89 | struct spdk_scsi_task *task) | |
90 | { | |
91 | } | |
92 | ||
93 | uint32_t | |
94 | spdk_env_get_current_core(void) | |
95 | { | |
96 | return 0; | |
97 | } | |
98 | ||
99 | struct spdk_event * | |
100 | spdk_event_allocate(uint32_t core, spdk_event_fn fn, void *arg1, void *arg2) | |
101 | { | |
102 | return NULL; | |
103 | } | |
104 | ||
105 | struct spdk_scsi_dev * | |
106 | spdk_scsi_dev_construct(const char *name, char **lun_name_list, | |
107 | int *lun_id_list, int num_luns) | |
108 | { | |
109 | return NULL; | |
110 | } | |
111 | ||
112 | void | |
113 | spdk_scsi_dev_destruct(struct spdk_scsi_dev *dev) | |
114 | { | |
115 | } | |
116 | ||
117 | int | |
118 | spdk_scsi_dev_add_port(struct spdk_scsi_dev *dev, uint64_t id, const char *name) | |
119 | { | |
120 | return 0; | |
121 | } | |
122 | ||
123 | int | |
124 | spdk_iscsi_drop_conns(struct spdk_iscsi_conn *conn, const char *conn_match, | |
125 | int drop_all) | |
126 | { | |
127 | return 0; | |
128 | } | |
129 | ||
130 | void | |
131 | spdk_shutdown_iscsi_conns(void) | |
132 | { | |
133 | } | |
134 | ||
135 | void | |
136 | process_task_completion(void *arg1, void *arg2) | |
137 | { | |
138 | } | |
139 | ||
140 | void | |
141 | process_task_mgmt_completion(void *arg1, void *arg2) | |
142 | { | |
143 | } | |
144 | ||
145 | int | |
146 | spdk_iscsi_conn_read_data(struct spdk_iscsi_conn *conn, int bytes, | |
147 | void *buf) | |
148 | { | |
149 | return 0; | |
150 | } | |
151 | ||
152 | void | |
153 | spdk_iscsi_conn_logout(struct spdk_iscsi_conn *conn) | |
154 | { | |
155 | } | |
156 | ||
157 | void | |
158 | spdk_scsi_dev_print(struct spdk_scsi_dev *dev) | |
159 | { | |
160 | } | |
161 | ||
162 | void | |
163 | spdk_scsi_task_set_status(struct spdk_scsi_task *task, int sc, int sk, int asc, int ascq) | |
164 | { | |
165 | } | |
166 | ||
167 | void | |
168 | spdk_scsi_task_set_data(struct spdk_scsi_task *task, void *data, uint32_t len) | |
169 | { | |
170 | task->iovs[0].iov_base = data; | |
171 | task->iovs[0].iov_len = len; | |
172 | } |