Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110527
b: refs/heads/master
c: a91a3a2
h: refs/heads/master
i:
  110525: ed4d908
  110523: 79b2247
  110519: 3fef7d5
  110511: da5a10c
  110495: 7a34e23
  110463: f3d548a
v: v3
  • Loading branch information
FUJITA Tomonori authored and Jens Axboe committed Oct 9, 2008
1 parent 2227e7f commit 6592626
Show file tree
Hide file tree
Showing 2 changed files with 13 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: 224cb3e981f1b2f9f93dbd49eaef505d17d894c2
refs/heads/master: a91a3a20e06621b9931793888583efe37db4e4e8
23 changes: 12 additions & 11 deletions trunk/drivers/scsi/sg.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ typedef struct sg_device { /* holds the state of each scsi generic device */

static int sg_fasync(int fd, struct file *filp, int mode);
/* tasklet or soft irq callback */
static void sg_cmd_done(void *data, char *sense, int result, int resid);
static void sg_rq_end_io(struct request *rq, int uptodate);
static int sg_start_req(Sg_request *srp, unsigned char *cmd);
static void sg_finish_rem_req(Sg_request * srp);
static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size);
Expand Down Expand Up @@ -227,11 +227,6 @@ static int sg_allow_access(struct file *filp, unsigned char *cmd)
cmd, filp->f_mode & FMODE_WRITE);
}

static void sg_rq_end_io(struct request *rq, int uptodate)
{
sg_cmd_done(rq->end_io_data, rq->sense, rq->errors, rq->data_len);
}

static int
sg_open(struct inode *inode, struct file *filp)
{
Expand Down Expand Up @@ -1257,16 +1252,19 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma)
return 0;
}

/* This function is a "bottom half" handler that is called by the
* mid level when a command is completed (or has failed). */
static void
sg_cmd_done(void *data, char *sense, int result, int resid)
/*
* This function is a "bottom half" handler that is called by the mid
* level when a command is completed (or has failed).
*/
static void sg_rq_end_io(struct request *rq, int uptodate)
{
Sg_request *srp = data;
struct sg_request *srp = rq->end_io_data;
Sg_device *sdp = NULL;
Sg_fd *sfp;
unsigned long iflags;
unsigned int ms;
char *sense;
int result, resid;

if (NULL == srp) {
printk(KERN_ERR "sg_cmd_done: NULL request\n");
Expand All @@ -1280,6 +1278,9 @@ sg_cmd_done(void *data, char *sense, int result, int resid)
return;
}

sense = rq->sense;
result = rq->errors;
resid = rq->data_len;

SCSI_LOG_TIMEOUT(4, printk("sg_cmd_done: %s, pack_id=%d, res=0x%x\n",
sdp->disk->disk_name, srp->header.pack_id, result));
Expand Down

0 comments on commit 6592626

Please sign in to comment.