summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2003-05-13 21:04:01 -0700
committerJens Axboe <axboe@suse.de>2003-05-13 21:04:01 -0700
commit55262c2d165deabb13d312183fecdcfea6fb6051 (patch)
treeeeb3b0c2af99d64c8dbc77641037232e30ea8599 /drivers
parent31ab234bcc1595fbe767c53fb24f42b8d36abe07 (diff)
[PATCH] Fix scsi_ioctl command direction bits
With the dynamic request allocation, we get the direction bits set for us. This breaks the scsi_ioctl stuff, since we always pass in WRITE there. So actually pass in the right direction instead.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/scsi_ioctl.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c
index fc3e3f7aaff8..6c995d61b51c 100644
--- a/drivers/block/scsi_ioctl.c
+++ b/drivers/block/scsi_ioctl.c
@@ -212,7 +212,7 @@ static int sg_io(request_queue_t *q, struct block_device *bdev,
}
}
- rq = blk_get_request(q, WRITE, __GFP_WAIT);
+ rq = blk_get_request(q, writing ? WRITE : READ, __GFP_WAIT);
/*
* fill in request structure
@@ -227,8 +227,6 @@ static int sg_io(request_queue_t *q, struct block_device *bdev,
rq->sense_len = 0;
rq->flags |= REQ_BLOCK_PC;
- if (writing)
- rq->flags |= REQ_RW;
rq->hard_nr_sectors = rq->nr_sectors = nr_sectors;
rq->hard_cur_sectors = rq->current_nr_sectors = nr_sectors;
@@ -329,7 +327,7 @@ static int sg_scsi_ioctl(request_queue_t *q, struct block_device *bdev,
memset(buffer, 0, bytes);
}
- rq = blk_get_request(q, WRITE, __GFP_WAIT);
+ rq = blk_get_request(q, in_len ? WRITE : READ, __GFP_WAIT);
cmdlen = COMMAND_SIZE(opcode);
@@ -373,8 +371,6 @@ static int sg_scsi_ioctl(request_queue_t *q, struct block_device *bdev,
rq->data = buffer;
rq->data_len = bytes;
rq->flags |= REQ_BLOCK_PC;
- if (in_len)
- rq->flags |= REQ_RW;
blk_do_rq(q, bdev, rq);
err = rq->errors & 0xff; /* only 8 bit SCSI status */