Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47791
b: refs/heads/master
c: 9abe16c
h: refs/heads/master
i:
  47789: e3f5810
  47787: 56c9afb
  47783: d87fe66
  47775: b014c67
v: v3
  • Loading branch information
Kai Makisara authored and James Bottomley committed Feb 3, 2007
1 parent 24cbceb commit bb565b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 07c861d6d9ca3dc58e225bcfe2da0f378af6fa6c
refs/heads/master: 9abe16c670bd3d4ab5519257514f9f291383d104
23 changes: 13 additions & 10 deletions trunk/drivers/scsi/st.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
Steve Hirsch, Andreas Koppenh"ofer, Michael Leodolter, Eyal Lebedinsky,
Michael Schaefer, J"org Weule, and Eric Youngdale.
Copyright 1992 - 2006 Kai Makisara
Copyright 1992 - 2007 Kai Makisara
email Kai.Makisara@kolumbus.fi
Some small formal changes - aeb, 950809
Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support
*/

static const char *verstr = "20061107";
static const char *verstr = "20070203";

#include <linux/module.h>

Expand Down Expand Up @@ -1168,6 +1168,7 @@ static int st_open(struct inode *inode, struct file *filp)
STps = &(STp->ps[i]);
STps->rw = ST_IDLE;
}
STp->try_dio_now = STp->try_dio;
STp->recover_count = 0;
DEB( STp->nbr_waits = STp->nbr_finished = 0;
STp->nbr_requests = STp->nbr_dio = STp->nbr_pages = STp->nbr_combinable = 0; )
Expand Down Expand Up @@ -1400,9 +1401,9 @@ static int setup_buffering(struct scsi_tape *STp, const char __user *buf,
struct st_buffer *STbp = STp->buffer;

if (is_read)
i = STp->try_dio && try_rdio;
i = STp->try_dio_now && try_rdio;
else
i = STp->try_dio && try_wdio;
i = STp->try_dio_now && try_wdio;

if (i && ((unsigned long)buf & queue_dma_alignment(
STp->device->request_queue)) == 0) {
Expand Down Expand Up @@ -1599,7 +1600,7 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
STm->do_async_writes && STps->eof < ST_EOM_OK;

if (STp->block_size != 0 && STm->do_buffer_writes &&
!(STp->try_dio && try_wdio) && STps->eof < ST_EOM_OK &&
!(STp->try_dio_now && try_wdio) && STps->eof < ST_EOM_OK &&
STbp->buffer_bytes < STbp->buffer_size) {
STp->dirty = 1;
/* Don't write a buffer that is not full enough. */
Expand Down Expand Up @@ -1769,7 +1770,7 @@ static long read_tape(struct scsi_tape *STp, long count,
if (STp->block_size == 0)
blks = bytes = count;
else {
if (!(STp->try_dio && try_rdio) && STm->do_read_ahead) {
if (!(STp->try_dio_now && try_rdio) && STm->do_read_ahead) {
blks = (STp->buffer)->buffer_blocks;
bytes = blks * STp->block_size;
} else {
Expand Down Expand Up @@ -1948,10 +1949,12 @@ st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
goto out;

STm = &(STp->modes[STp->current_mode]);
if (!(STm->do_read_ahead) && STp->block_size != 0 &&
(count % STp->block_size) != 0) {
retval = (-EINVAL); /* Read must be integral number of blocks */
goto out;
if (STp->block_size != 0 && (count % STp->block_size) != 0) {
if (!STm->do_read_ahead) {
retval = (-EINVAL); /* Read must be integral number of blocks */
goto out;
}
STp->try_dio_now = 0; /* Direct i/o can't handle split blocks */
}

STps = &(STp->ps[STp->partition]);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/scsi/st.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ struct scsi_tape {
unsigned char cln_sense_value;
unsigned char cln_sense_mask;
unsigned char use_pf; /* Set Page Format bit in all mode selects? */
unsigned char try_dio; /* try direct i/o? */
unsigned char try_dio; /* try direct i/o in general? */
unsigned char try_dio_now; /* try direct i/o before next close? */
unsigned char c_algo; /* compression algorithm */
unsigned char pos_unknown; /* after reset position unknown */
int tape_type;
Expand Down

0 comments on commit bb565b7

Please sign in to comment.