diff options
Diffstat (limited to 'drivers/block/nbd.c')
-rw-r--r-- | drivers/block/nbd.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 228b2ff577aa..be5ec3a9b1fc 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -212,19 +212,17 @@ static int nbd_send_req(struct nbd_device *lo, struct request *req) | |||
212 | * whether to set MSG_MORE or not... | 212 | * whether to set MSG_MORE or not... |
213 | */ | 213 | */ |
214 | rq_for_each_segment(bvec, req, iter) { | 214 | rq_for_each_segment(bvec, req, iter) { |
215 | flags = 0; | 215 | flags = 0; |
216 | if (!rq_iter_last(req, iter)) | 216 | if (!rq_iter_last(req, iter)) |
217 | flags = MSG_MORE; | 217 | flags = MSG_MORE; |
218 | dprintk(DBG_TX, "%s: request %p: sending %d bytes data\n", | 218 | dprintk(DBG_TX, "%s: request %p: sending %d bytes data\n", |
219 | lo->disk->disk_name, req, | 219 | lo->disk->disk_name, req, bvec->bv_len); |
220 | bvec->bv_len); | 220 | result = sock_send_bvec(sock, bvec, flags); |
221 | result = sock_send_bvec(sock, bvec, flags); | 221 | if (result <= 0) { |
222 | if (result <= 0) { | 222 | printk(KERN_ERR "%s: Send data failed (result %d)\n", |
223 | printk(KERN_ERR "%s: Send data failed (result %d)\n", | 223 | lo->disk->disk_name, result); |
224 | lo->disk->disk_name, | 224 | goto error_out; |
225 | result); | 225 | } |
226 | goto error_out; | ||
227 | } | ||
228 | } | 226 | } |
229 | } | 227 | } |
230 | return 0; | 228 | return 0; |
@@ -323,16 +321,15 @@ static struct request *nbd_read_stat(struct nbd_device *lo) | |||
323 | struct bio_vec *bvec; | 321 | struct bio_vec *bvec; |
324 | 322 | ||
325 | rq_for_each_segment(bvec, req, iter) { | 323 | rq_for_each_segment(bvec, req, iter) { |
326 | result = sock_recv_bvec(sock, bvec); | 324 | result = sock_recv_bvec(sock, bvec); |
327 | if (result <= 0) { | 325 | if (result <= 0) { |
328 | printk(KERN_ERR "%s: Receive data failed (result %d)\n", | 326 | printk(KERN_ERR "%s: Receive data failed (result %d)\n", |
329 | lo->disk->disk_name, | 327 | lo->disk->disk_name, result); |
330 | result); | 328 | req->errors++; |
331 | req->errors++; | 329 | return req; |
332 | return req; | 330 | } |
333 | } | 331 | dprintk(DBG_RX, "%s: request %p: got %d bytes data\n", |
334 | dprintk(DBG_RX, "%s: request %p: got %d bytes data\n", | 332 | lo->disk->disk_name, req, bvec->bv_len); |
335 | lo->disk->disk_name, req, bvec->bv_len); | ||
336 | } | 333 | } |
337 | } | 334 | } |
338 | return req; | 335 | return req; |