diff options
Diffstat (limited to 'drivers/block/xen-blkback/common.h')
-rw-r--r-- | drivers/block/xen-blkback/common.h | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h index 6072390c7f57..60103e2517ba 100644 --- a/drivers/block/xen-blkback/common.h +++ b/drivers/block/xen-blkback/common.h | |||
@@ -77,11 +77,18 @@ struct blkif_x86_32_request_discard { | |||
77 | uint64_t nr_sectors; | 77 | uint64_t nr_sectors; |
78 | } __attribute__((__packed__)); | 78 | } __attribute__((__packed__)); |
79 | 79 | ||
80 | struct blkif_x86_32_request_other { | ||
81 | uint8_t _pad1; | ||
82 | blkif_vdev_t _pad2; | ||
83 | uint64_t id; /* private guest value, echoed in resp */ | ||
84 | } __attribute__((__packed__)); | ||
85 | |||
80 | struct blkif_x86_32_request { | 86 | struct blkif_x86_32_request { |
81 | uint8_t operation; /* BLKIF_OP_??? */ | 87 | uint8_t operation; /* BLKIF_OP_??? */ |
82 | union { | 88 | union { |
83 | struct blkif_x86_32_request_rw rw; | 89 | struct blkif_x86_32_request_rw rw; |
84 | struct blkif_x86_32_request_discard discard; | 90 | struct blkif_x86_32_request_discard discard; |
91 | struct blkif_x86_32_request_other other; | ||
85 | } u; | 92 | } u; |
86 | } __attribute__((__packed__)); | 93 | } __attribute__((__packed__)); |
87 | 94 | ||
@@ -113,11 +120,19 @@ struct blkif_x86_64_request_discard { | |||
113 | uint64_t nr_sectors; | 120 | uint64_t nr_sectors; |
114 | } __attribute__((__packed__)); | 121 | } __attribute__((__packed__)); |
115 | 122 | ||
123 | struct blkif_x86_64_request_other { | ||
124 | uint8_t _pad1; | ||
125 | blkif_vdev_t _pad2; | ||
126 | uint32_t _pad3; /* offsetof(blkif_..,u.discard.id)==8 */ | ||
127 | uint64_t id; /* private guest value, echoed in resp */ | ||
128 | } __attribute__((__packed__)); | ||
129 | |||
116 | struct blkif_x86_64_request { | 130 | struct blkif_x86_64_request { |
117 | uint8_t operation; /* BLKIF_OP_??? */ | 131 | uint8_t operation; /* BLKIF_OP_??? */ |
118 | union { | 132 | union { |
119 | struct blkif_x86_64_request_rw rw; | 133 | struct blkif_x86_64_request_rw rw; |
120 | struct blkif_x86_64_request_discard discard; | 134 | struct blkif_x86_64_request_discard discard; |
135 | struct blkif_x86_64_request_other other; | ||
121 | } u; | 136 | } u; |
122 | } __attribute__((__packed__)); | 137 | } __attribute__((__packed__)); |
123 | 138 | ||
@@ -172,7 +187,6 @@ struct persistent_gnt { | |||
172 | struct page *page; | 187 | struct page *page; |
173 | grant_ref_t gnt; | 188 | grant_ref_t gnt; |
174 | grant_handle_t handle; | 189 | grant_handle_t handle; |
175 | uint64_t dev_bus_addr; | ||
176 | struct rb_node node; | 190 | struct rb_node node; |
177 | }; | 191 | }; |
178 | 192 | ||
@@ -208,13 +222,13 @@ struct xen_blkif { | |||
208 | 222 | ||
209 | /* statistics */ | 223 | /* statistics */ |
210 | unsigned long st_print; | 224 | unsigned long st_print; |
211 | int st_rd_req; | 225 | unsigned long long st_rd_req; |
212 | int st_wr_req; | 226 | unsigned long long st_wr_req; |
213 | int st_oo_req; | 227 | unsigned long long st_oo_req; |
214 | int st_f_req; | 228 | unsigned long long st_f_req; |
215 | int st_ds_req; | 229 | unsigned long long st_ds_req; |
216 | int st_rd_sect; | 230 | unsigned long long st_rd_sect; |
217 | int st_wr_sect; | 231 | unsigned long long st_wr_sect; |
218 | 232 | ||
219 | wait_queue_head_t waiting_to_free; | 233 | wait_queue_head_t waiting_to_free; |
220 | }; | 234 | }; |
@@ -278,6 +292,11 @@ static inline void blkif_get_x86_32_req(struct blkif_request *dst, | |||
278 | dst->u.discard.nr_sectors = src->u.discard.nr_sectors; | 292 | dst->u.discard.nr_sectors = src->u.discard.nr_sectors; |
279 | break; | 293 | break; |
280 | default: | 294 | default: |
295 | /* | ||
296 | * Don't know how to translate this op. Only get the | ||
297 | * ID so failure can be reported to the frontend. | ||
298 | */ | ||
299 | dst->u.other.id = src->u.other.id; | ||
281 | break; | 300 | break; |
282 | } | 301 | } |
283 | } | 302 | } |
@@ -309,6 +328,11 @@ static inline void blkif_get_x86_64_req(struct blkif_request *dst, | |||
309 | dst->u.discard.nr_sectors = src->u.discard.nr_sectors; | 328 | dst->u.discard.nr_sectors = src->u.discard.nr_sectors; |
310 | break; | 329 | break; |
311 | default: | 330 | default: |
331 | /* | ||
332 | * Don't know how to translate this op. Only get the | ||
333 | * ID so failure can be reported to the frontend. | ||
334 | */ | ||
335 | dst->u.other.id = src->u.other.id; | ||
312 | break; | 336 | break; |
313 | } | 337 | } |
314 | } | 338 | } |