Commit a91a3a20 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Jens Axboe

sg: rename sg_cmd_done sg_rq_end_io

old sg_rq_end_io() was used to wrap sg_cmd_done during converting sg
to use the block layer (in order to cover the difference
scsi_execute_async and blk_execute_rq_nowait). Now we don't need it so
let's remove it.
Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 224cb3e9
...@@ -177,7 +177,7 @@ typedef struct sg_device { /* holds the state of each scsi generic device */ ...@@ -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); static int sg_fasync(int fd, struct file *filp, int mode);
/* tasklet or soft irq callback */ /* 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 int sg_start_req(Sg_request *srp, unsigned char *cmd);
static void sg_finish_rem_req(Sg_request * srp); static void sg_finish_rem_req(Sg_request * srp);
static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size); static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size);
...@@ -227,11 +227,6 @@ static int sg_allow_access(struct file *filp, unsigned char *cmd) ...@@ -227,11 +227,6 @@ static int sg_allow_access(struct file *filp, unsigned char *cmd)
cmd, filp->f_mode & FMODE_WRITE); 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 static int
sg_open(struct inode *inode, struct file *filp) sg_open(struct inode *inode, struct file *filp)
{ {
...@@ -1257,16 +1252,19 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma) ...@@ -1257,16 +1252,19 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma)
return 0; return 0;
} }
/* This function is a "bottom half" handler that is called by the /*
* mid level when a command is completed (or has failed). */ * This function is a "bottom half" handler that is called by the mid
static void * level when a command is completed (or has failed).
sg_cmd_done(void *data, char *sense, int result, int resid) */
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_device *sdp = NULL;
Sg_fd *sfp; Sg_fd *sfp;
unsigned long iflags; unsigned long iflags;
unsigned int ms; unsigned int ms;
char *sense;
int result, resid;
if (NULL == srp) { if (NULL == srp) {
printk(KERN_ERR "sg_cmd_done: NULL request\n"); printk(KERN_ERR "sg_cmd_done: NULL request\n");
...@@ -1280,6 +1278,9 @@ sg_cmd_done(void *data, char *sense, int result, int resid) ...@@ -1280,6 +1278,9 @@ sg_cmd_done(void *data, char *sense, int result, int resid)
return; 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", 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)); sdp->disk->disk_name, srp->header.pack_id, result));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment