summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-09-02 22:50:04 +0900
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 08:56:14 +0200
commit44c7b0eaa041007066e30ab4869d5bbf8dad5989 (patch)
tree4c127ab80d271c86c38ea3a382667e88f00b83ca /drivers/scsi/sg.c
parentfd1c1de0766844af4cfc39298e109ad273e72a9e (diff)
downloadlinux-44c7b0eaa041007066e30ab4869d5bbf8dad5989.tar.bz2
sg: remove __sg_start_req
__sg_start_req() was used temporarily to call blk_get_request() during converting sg to use the block layer. Now sg always calls blk_get_request() so we can move blk_get_request() to sg_start_req(). We don't need __sg_start_req anymore. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c38
1 files changed, 13 insertions, 25 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index ccce31a400ea..9a56c0d320bf 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1626,14 +1626,23 @@ exit_sg(void)
idr_destroy(&sg_index_idr);
}
-static int __sg_start_req(struct sg_request *srp, struct sg_io_hdr *hp,
- unsigned char *cmd)
+static int sg_start_req(Sg_request *srp, unsigned char *cmd)
{
- struct sg_fd *sfp = srp->parentfp;
- struct request_queue *q = sfp->parentdp->device->request_queue;
+ int res = 0;
struct request *rq;
+ Sg_fd *sfp = srp->parentfp;
+ sg_io_hdr_t *hp = &srp->header;
+ int dxfer_len = (int) hp->dxfer_len;
+ int dxfer_dir = hp->dxfer_direction;
+ Sg_scatter_hold *req_schp = &srp->data;
+ Sg_scatter_hold *rsv_schp = &sfp->reserve;
+ struct request_queue *q = sfp->parentdp->device->request_queue;
+ struct rq_map_data map_data;
int rw = hp->dxfer_direction == SG_DXFER_TO_DEV ? WRITE : READ;
+ SCSI_LOG_TIMEOUT(4, printk(KERN_INFO "sg_start_req: dxfer_len=%d\n",
+ dxfer_len));
+
rq = blk_get_request(q, rw, GFP_ATOMIC);
if (!rq)
return -ENOMEM;
@@ -1648,27 +1657,6 @@ static int __sg_start_req(struct sg_request *srp, struct sg_io_hdr *hp,
rq->sense = srp->sense_b;
rq->retries = SG_DEFAULT_RETRIES;
- return 0;
-}
-
-static int sg_start_req(Sg_request *srp, unsigned char *cmd)
-{
- int res;
- Sg_fd *sfp = srp->parentfp;
- sg_io_hdr_t *hp = &srp->header;
- int dxfer_len = (int) hp->dxfer_len;
- int dxfer_dir = hp->dxfer_direction;
- Sg_scatter_hold *req_schp = &srp->data;
- Sg_scatter_hold *rsv_schp = &sfp->reserve;
- struct request_queue *q = sfp->parentdp->device->request_queue;
- struct rq_map_data map_data;
-
- SCSI_LOG_TIMEOUT(4, printk("sg_start_req: dxfer_len=%d\n", dxfer_len));
-
- res = __sg_start_req(srp, hp, cmd);
- if (res)
- return res;
-
if ((dxfer_len <= 0) || (dxfer_dir == SG_DXFER_NONE))
return 0;