Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124656
b: refs/heads/master
c: 4deba24
h: refs/heads/master
v: v3
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Dec 29, 2008
1 parent b4c6b88 commit 9cd84bb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 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: 5d2711c0ff9cdff79cd62d3c830e763d889e73de
refs/heads/master: 4deba245d0d6b2dc97cc4277c37f8519655d3afe
32 changes: 19 additions & 13 deletions trunk/drivers/scsi/st.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,23 @@ static void st_sleep_done(void *data, char *sense, int result, int resid)
complete(SRpnt->waiting);
}

static struct st_request *st_allocate_request(void)
static struct st_request *st_allocate_request(struct scsi_tape *stp)
{
return kzalloc(sizeof(struct st_request), GFP_KERNEL);
struct st_request *streq;

streq = kzalloc(sizeof(*streq), GFP_KERNEL);
if (streq)
streq->stp = stp;
else {
DEBC(printk(KERN_ERR "%s: Can't get SCSI request.\n",
tape_name(stp)););
if (signal_pending(current))
stp->buffer->syscall_result = -EINTR;
else
stp->buffer->syscall_result = -EBUSY;
}

return streq;
}

static void st_release_request(struct st_request *streq)
Expand Down Expand Up @@ -481,18 +495,10 @@ st_do_scsi(struct st_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd
return NULL;
}

if (SRpnt == NULL) {
SRpnt = st_allocate_request();
if (SRpnt == NULL) {
DEBC( printk(KERN_ERR "%s: Can't get SCSI request.\n",
tape_name(STp)); );
if (signal_pending(current))
(STp->buffer)->syscall_result = (-EINTR);
else
(STp->buffer)->syscall_result = (-EBUSY);
if (!SRpnt) {
SRpnt = st_allocate_request(STp);
if (!SRpnt)
return NULL;
}
SRpnt->stp = STp;
}

/* If async IO, set last_SRpnt. This ptr tells write_behind_check
Expand Down

0 comments on commit 9cd84bb

Please sign in to comment.