aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-09-02 09:50:06 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 02:56:14 -0400
commitc3919af2354fff673026dcbeac6f009d2ce5ceee (patch)
tree8504a35a3a247ec2a40578754aff2f3128294749
parent626710c9d665ff381c7ec666b6a023f064ca5fef (diff)
sg: remove sg_write_xfer
sg_write_xfer was used to copy data from user space for WRITE commands. blk_rq_map_user_iov and blk_rq_map_user do the job so sg_write_xfer does nothing useful. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--drivers/scsi/sg.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index c0b6866eece9..07bd68331303 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -188,7 +188,6 @@ static ssize_t sg_new_write(Sg_fd *sfp, struct file *file,
188 int read_only, Sg_request **o_srp); 188 int read_only, Sg_request **o_srp);
189static int sg_common_write(Sg_fd * sfp, Sg_request * srp, 189static int sg_common_write(Sg_fd * sfp, Sg_request * srp,
190 unsigned char *cmnd, int timeout, int blocking); 190 unsigned char *cmnd, int timeout, int blocking);
191static int sg_write_xfer(Sg_request * srp);
192static int sg_read_xfer(Sg_request * srp); 191static int sg_read_xfer(Sg_request * srp);
193static int sg_read_oxfer(Sg_request * srp, char __user *outp, int num_read_xfer); 192static int sg_read_oxfer(Sg_request * srp, char __user *outp, int num_read_xfer);
194static void sg_remove_scat(Sg_scatter_hold * schp); 193static void sg_remove_scat(Sg_scatter_hold * schp);
@@ -736,11 +735,6 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
736 sg_finish_rem_req(srp); 735 sg_finish_rem_req(srp);
737 return k; /* probably out of space --> ENOMEM */ 736 return k; /* probably out of space --> ENOMEM */
738 } 737 }
739 if ((k = sg_write_xfer(srp))) {
740 SCSI_LOG_TIMEOUT(1, printk("sg_common_write: write_xfer, bad address\n"));
741 sg_finish_rem_req(srp);
742 return k;
743 }
744 if (sdp->detached) { 738 if (sdp->detached) {
745 sg_finish_rem_req(srp); 739 sg_finish_rem_req(srp);
746 return -ENODEV; 740 return -ENODEV;
@@ -1816,32 +1810,6 @@ out:
1816 return -ENOMEM; 1810 return -ENOMEM;
1817} 1811}
1818 1812
1819static int
1820sg_write_xfer(Sg_request * srp)
1821{
1822 sg_io_hdr_t *hp = &srp->header;
1823 Sg_scatter_hold *schp = &srp->data;
1824 int num_xfer = 0;
1825 int dxfer_dir = hp->dxfer_direction;
1826 int new_interface = ('\0' == hp->interface_id) ? 0 : 1;
1827
1828 if ((SG_DXFER_UNKNOWN == dxfer_dir) || (SG_DXFER_TO_DEV == dxfer_dir) ||
1829 (SG_DXFER_TO_FROM_DEV == dxfer_dir)) {
1830 num_xfer = (int) (new_interface ? hp->dxfer_len : hp->flags);
1831 if (schp->bufflen < num_xfer)
1832 num_xfer = schp->bufflen;
1833 }
1834 if ((num_xfer <= 0) || (schp->dio_in_use) ||
1835 (new_interface
1836 && ((SG_FLAG_NO_DXFER | SG_FLAG_MMAP_IO) & hp->flags)))
1837 return 0;
1838
1839 SCSI_LOG_TIMEOUT(4, printk("sg_write_xfer: num_xfer=%d, k_use_sg=%d\n",
1840 num_xfer, schp->k_use_sg));
1841
1842 return 0;
1843}
1844
1845static void 1813static void
1846sg_remove_scat(Sg_scatter_hold * schp) 1814sg_remove_scat(Sg_scatter_hold * schp)
1847{ 1815{