aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/st.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:44:25 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:44:25 -0500
commit5f0b1437e0708772b6fecae5900c01c3b5f9b512 (patch)
treebcd923e305345178bc162ed8560d56a3af197224 /drivers/scsi/st.c
parent574009c1a895aeeb85eaab29c235d75852b09eb8 (diff)
parent81b7bbd1932a04869d4c8635a75222dfc6089f96 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (97 commits) [SCSI] zfcp: removed wrong comment [SCSI] zfcp: use of uninitialized variable [SCSI] zfcp: Invalid locking order [SCSI] aic79xx: use dma_get_required_mask() [SCSI] aic79xx: fix bracket mismatch in unused macro [SCSI] BusLogic: Replace 'boolean' by 'bool' [SCSI] advansys: clean up warnings [SCSI] 53c7xx: brackets fix in uncompiled code [SCSI] nsp_cs: remove old scsi code [SCSI] aic79xx: make ahd_match_scb() static [SCSI] DAC960: kmalloc->kzalloc/Casting cleanups [SCSI] scsi_kmap_atomic_sg(): check that local irqs are disabled [SCSI] Buslogic: local_irq_disable() is redundant after local_irq_save() [SCSI] aic94xx: update for v28 firmware [SCSI] scsi_error: Fix lost EH commands [SCSI] aic94xx: Add default bus reset handler [SCSI] aic94xx: Remove TMF result code munging [SCSI] libsas: Add an LU reset mechanism to the error handler [SCSI] libsas: Don't BUG when connecting two expanders via wide port [SCSI] st: fix Tape dies if wrong block size used, bug 7919 ...
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r--drivers/scsi/st.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 488ec7948a57..16e279be4a3e 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -9,7 +9,7 @@
9 Steve Hirsch, Andreas Koppenh"ofer, Michael Leodolter, Eyal Lebedinsky, 9 Steve Hirsch, Andreas Koppenh"ofer, Michael Leodolter, Eyal Lebedinsky,
10 Michael Schaefer, J"org Weule, and Eric Youngdale. 10 Michael Schaefer, J"org Weule, and Eric Youngdale.
11 11
12 Copyright 1992 - 2006 Kai Makisara 12 Copyright 1992 - 2007 Kai Makisara
13 email Kai.Makisara@kolumbus.fi 13 email Kai.Makisara@kolumbus.fi
14 14
15 Some small formal changes - aeb, 950809 15 Some small formal changes - aeb, 950809
@@ -17,7 +17,7 @@
17 Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support 17 Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support
18 */ 18 */
19 19
20static const char *verstr = "20061107"; 20static const char *verstr = "20070203";
21 21
22#include <linux/module.h> 22#include <linux/module.h>
23 23
@@ -1168,6 +1168,7 @@ static int st_open(struct inode *inode, struct file *filp)
1168 STps = &(STp->ps[i]); 1168 STps = &(STp->ps[i]);
1169 STps->rw = ST_IDLE; 1169 STps->rw = ST_IDLE;
1170 } 1170 }
1171 STp->try_dio_now = STp->try_dio;
1171 STp->recover_count = 0; 1172 STp->recover_count = 0;
1172 DEB( STp->nbr_waits = STp->nbr_finished = 0; 1173 DEB( STp->nbr_waits = STp->nbr_finished = 0;
1173 STp->nbr_requests = STp->nbr_dio = STp->nbr_pages = STp->nbr_combinable = 0; ) 1174 STp->nbr_requests = STp->nbr_dio = STp->nbr_pages = STp->nbr_combinable = 0; )
@@ -1400,9 +1401,9 @@ static int setup_buffering(struct scsi_tape *STp, const char __user *buf,
1400 struct st_buffer *STbp = STp->buffer; 1401 struct st_buffer *STbp = STp->buffer;
1401 1402
1402 if (is_read) 1403 if (is_read)
1403 i = STp->try_dio && try_rdio; 1404 i = STp->try_dio_now && try_rdio;
1404 else 1405 else
1405 i = STp->try_dio && try_wdio; 1406 i = STp->try_dio_now && try_wdio;
1406 1407
1407 if (i && ((unsigned long)buf & queue_dma_alignment( 1408 if (i && ((unsigned long)buf & queue_dma_alignment(
1408 STp->device->request_queue)) == 0) { 1409 STp->device->request_queue)) == 0) {
@@ -1599,7 +1600,7 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
1599 STm->do_async_writes && STps->eof < ST_EOM_OK; 1600 STm->do_async_writes && STps->eof < ST_EOM_OK;
1600 1601
1601 if (STp->block_size != 0 && STm->do_buffer_writes && 1602 if (STp->block_size != 0 && STm->do_buffer_writes &&
1602 !(STp->try_dio && try_wdio) && STps->eof < ST_EOM_OK && 1603 !(STp->try_dio_now && try_wdio) && STps->eof < ST_EOM_OK &&
1603 STbp->buffer_bytes < STbp->buffer_size) { 1604 STbp->buffer_bytes < STbp->buffer_size) {
1604 STp->dirty = 1; 1605 STp->dirty = 1;
1605 /* Don't write a buffer that is not full enough. */ 1606 /* Don't write a buffer that is not full enough. */
@@ -1769,7 +1770,7 @@ static long read_tape(struct scsi_tape *STp, long count,
1769 if (STp->block_size == 0) 1770 if (STp->block_size == 0)
1770 blks = bytes = count; 1771 blks = bytes = count;
1771 else { 1772 else {
1772 if (!(STp->try_dio && try_rdio) && STm->do_read_ahead) { 1773 if (!(STp->try_dio_now && try_rdio) && STm->do_read_ahead) {
1773 blks = (STp->buffer)->buffer_blocks; 1774 blks = (STp->buffer)->buffer_blocks;
1774 bytes = blks * STp->block_size; 1775 bytes = blks * STp->block_size;
1775 } else { 1776 } else {
@@ -1948,10 +1949,12 @@ st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
1948 goto out; 1949 goto out;
1949 1950
1950 STm = &(STp->modes[STp->current_mode]); 1951 STm = &(STp->modes[STp->current_mode]);
1951 if (!(STm->do_read_ahead) && STp->block_size != 0 && 1952 if (STp->block_size != 0 && (count % STp->block_size) != 0) {
1952 (count % STp->block_size) != 0) { 1953 if (!STm->do_read_ahead) {
1953 retval = (-EINVAL); /* Read must be integral number of blocks */ 1954 retval = (-EINVAL); /* Read must be integral number of blocks */
1954 goto out; 1955 goto out;
1956 }
1957 STp->try_dio_now = 0; /* Direct i/o can't handle split blocks */
1955 } 1958 }
1956 1959
1957 STps = &(STp->ps[STp->partition]); 1960 STps = &(STp->ps[STp->partition]);