aboutsummaryrefslogtreecommitdiffstats
path: root/block/bsg.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <tomof@acm.org>2007-07-29 10:00:46 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-07-31 11:43:05 -0400
commit0c6a89ba640d28e1dcd7fd1a217d2cfb92ae4953 (patch)
treef222695dfb6def9299717dd23f729c15fdd96919 /block/bsg.c
parentdb47c2d8d98a76083a88ec53f44cc74c48dfd1e8 (diff)
[SCSI] bsg: update sg_io_v4 structure
This updates sg_io_v4 structure (based on Doug's RFC, release 1.3). The major changes are: - add dout_resid field - increase tag size to 64 bits to comply with SAM-4 and SRP - add dout_iovec_count and din_iovec_count dout_iovec_count and din_iovec_count aren't supported now. I'm not sure whether they will be supported or not but they were added for the possible future changes. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'block/bsg.c')
-rw-r--r--block/bsg.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/block/bsg.c b/block/bsg.c
index d60eee549405..ed2646827234 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * bsg.c - block layer implementation of the sg v3 interface 2 * bsg.c - block layer implementation of the sg v4 interface
3 * 3 *
4 * Copyright (C) 2004 Jens Axboe <axboe@suse.de> SUSE Labs 4 * Copyright (C) 2004 Jens Axboe <axboe@suse.de> SUSE Labs
5 * Copyright (C) 2004 Peter M. Jones <pjones@redhat.com> 5 * Copyright (C) 2004 Peter M. Jones <pjones@redhat.com>
@@ -421,7 +421,6 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
421 hdr->info = 0; 421 hdr->info = 0;
422 if (hdr->device_status || hdr->transport_status || hdr->driver_status) 422 if (hdr->device_status || hdr->transport_status || hdr->driver_status)
423 hdr->info |= SG_INFO_CHECK; 423 hdr->info |= SG_INFO_CHECK;
424 hdr->din_resid = rq->data_len;
425 hdr->response_len = 0; 424 hdr->response_len = 0;
426 425
427 if (rq->sense_len && hdr->response) { 426 if (rq->sense_len && hdr->response) {
@@ -437,9 +436,14 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
437 } 436 }
438 437
439 if (rq->next_rq) { 438 if (rq->next_rq) {
439 hdr->dout_resid = rq->data_len;
440 hdr->din_resid = rq->next_rq->data_len;
440 blk_rq_unmap_user(bidi_bio); 441 blk_rq_unmap_user(bidi_bio);
441 blk_put_request(rq->next_rq); 442 blk_put_request(rq->next_rq);
442 } 443 } else if (rq_data_dir(rq) == READ)
444 hdr->din_resid = rq->data_len;
445 else
446 hdr->dout_resid = rq->data_len;
443 447
444 blk_rq_unmap_user(bio); 448 blk_rq_unmap_user(bio);
445 blk_put_request(rq); 449 blk_put_request(rq);