diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-08-28 02:05:59 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:11 -0400 |
commit | 01cfcddd98f09e05a2e36031654ed46643b76f23 (patch) | |
tree | 58bfbd3d70363e5a8d1c5822d27b29e2be93ad40 /drivers/scsi/sg.c | |
parent | 879040742cf09f2360a9ac41846288707e4e567c (diff) |
sg: use blk_rq_aligned helper function
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Douglas Gilbert <dougg@torque.net>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index d6391666502c..ed69292babde 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -1656,11 +1656,9 @@ static int sg_start_req(Sg_request *srp, unsigned char *cmd) | |||
1656 | sg_io_hdr_t *hp = &srp->header; | 1656 | sg_io_hdr_t *hp = &srp->header; |
1657 | int dxfer_len = (int) hp->dxfer_len; | 1657 | int dxfer_len = (int) hp->dxfer_len; |
1658 | int dxfer_dir = hp->dxfer_direction; | 1658 | int dxfer_dir = hp->dxfer_direction; |
1659 | unsigned long uaddr = (unsigned long)hp->dxferp; | ||
1660 | Sg_scatter_hold *req_schp = &srp->data; | 1659 | Sg_scatter_hold *req_schp = &srp->data; |
1661 | Sg_scatter_hold *rsv_schp = &sfp->reserve; | 1660 | Sg_scatter_hold *rsv_schp = &sfp->reserve; |
1662 | struct request_queue *q = sfp->parentdp->device->request_queue; | 1661 | struct request_queue *q = sfp->parentdp->device->request_queue; |
1663 | unsigned long alignment = queue_dma_alignment(q) | q->dma_pad_mask; | ||
1664 | struct rq_map_data map_data; | 1662 | struct rq_map_data map_data; |
1665 | 1663 | ||
1666 | SCSI_LOG_TIMEOUT(4, printk("sg_start_req: dxfer_len=%d\n", dxfer_len)); | 1664 | SCSI_LOG_TIMEOUT(4, printk("sg_start_req: dxfer_len=%d\n", dxfer_len)); |
@@ -1676,7 +1674,7 @@ static int sg_start_req(Sg_request *srp, unsigned char *cmd) | |||
1676 | if (sg_allow_dio && (hp->flags & SG_FLAG_DIRECT_IO) && | 1674 | if (sg_allow_dio && (hp->flags & SG_FLAG_DIRECT_IO) && |
1677 | (dxfer_dir != SG_DXFER_UNKNOWN) && (0 == hp->iovec_count) && | 1675 | (dxfer_dir != SG_DXFER_UNKNOWN) && (0 == hp->iovec_count) && |
1678 | (!sfp->parentdp->device->host->unchecked_isa_dma) && | 1676 | (!sfp->parentdp->device->host->unchecked_isa_dma) && |
1679 | !(uaddr & alignment) && !(dxfer_len & alignment)) | 1677 | blk_rq_aligned(q, hp->dxferp, dxfer_len)) |
1680 | return sg_build_direct(srp, sfp, dxfer_len); | 1678 | return sg_build_direct(srp, sfp, dxfer_len); |
1681 | #endif | 1679 | #endif |
1682 | if ((!sg_res_in_use(sfp)) && (dxfer_len <= rsv_schp->bufflen)) | 1680 | if ((!sg_res_in_use(sfp)) && (dxfer_len <= rsv_schp->bufflen)) |