diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-09-02 09:50:01 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:14 -0400 |
commit | a91a3a20e06621b9931793888583efe37db4e4e8 (patch) | |
tree | af515f0e87c438218e224e959692dbe3879248fb /drivers/scsi/sg.c | |
parent | 224cb3e981f1b2f9f93dbd49eaef505d17d894c2 (diff) |
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: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 50c07bca727d..d18f90d1d9ad 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -177,7 +177,7 @@ typedef struct sg_device { /* holds the state of each scsi generic device */ | |||
177 | 177 | ||
178 | static int sg_fasync(int fd, struct file *filp, int mode); | 178 | static int sg_fasync(int fd, struct file *filp, int mode); |
179 | /* tasklet or soft irq callback */ | 179 | /* tasklet or soft irq callback */ |
180 | static void sg_cmd_done(void *data, char *sense, int result, int resid); | 180 | static void sg_rq_end_io(struct request *rq, int uptodate); |
181 | static int sg_start_req(Sg_request *srp, unsigned char *cmd); | 181 | static int sg_start_req(Sg_request *srp, unsigned char *cmd); |
182 | static void sg_finish_rem_req(Sg_request * srp); | 182 | static void sg_finish_rem_req(Sg_request * srp); |
183 | static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size); | 183 | 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 | cmd, filp->f_mode & FMODE_WRITE); | 227 | cmd, filp->f_mode & FMODE_WRITE); |
228 | } | 228 | } |
229 | 229 | ||
230 | static void sg_rq_end_io(struct request *rq, int uptodate) | ||
231 | { | ||
232 | sg_cmd_done(rq->end_io_data, rq->sense, rq->errors, rq->data_len); | ||
233 | } | ||
234 | |||
235 | static int | 230 | static int |
236 | sg_open(struct inode *inode, struct file *filp) | 231 | sg_open(struct inode *inode, struct file *filp) |
237 | { | 232 | { |
@@ -1257,16 +1252,19 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma) | |||
1257 | return 0; | 1252 | return 0; |
1258 | } | 1253 | } |
1259 | 1254 | ||
1260 | /* This function is a "bottom half" handler that is called by the | 1255 | /* |
1261 | * mid level when a command is completed (or has failed). */ | 1256 | * This function is a "bottom half" handler that is called by the mid |
1262 | static void | 1257 | * level when a command is completed (or has failed). |
1263 | sg_cmd_done(void *data, char *sense, int result, int resid) | 1258 | */ |
1259 | static void sg_rq_end_io(struct request *rq, int uptodate) | ||
1264 | { | 1260 | { |
1265 | Sg_request *srp = data; | 1261 | struct sg_request *srp = rq->end_io_data; |
1266 | Sg_device *sdp = NULL; | 1262 | Sg_device *sdp = NULL; |
1267 | Sg_fd *sfp; | 1263 | Sg_fd *sfp; |
1268 | unsigned long iflags; | 1264 | unsigned long iflags; |
1269 | unsigned int ms; | 1265 | unsigned int ms; |
1266 | char *sense; | ||
1267 | int result, resid; | ||
1270 | 1268 | ||
1271 | if (NULL == srp) { | 1269 | if (NULL == srp) { |
1272 | printk(KERN_ERR "sg_cmd_done: NULL request\n"); | 1270 | 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 | return; | 1278 | return; |
1281 | } | 1279 | } |
1282 | 1280 | ||
1281 | sense = rq->sense; | ||
1282 | result = rq->errors; | ||
1283 | resid = rq->data_len; | ||
1283 | 1284 | ||
1284 | SCSI_LOG_TIMEOUT(4, printk("sg_cmd_done: %s, pack_id=%d, res=0x%x\n", | 1285 | SCSI_LOG_TIMEOUT(4, printk("sg_cmd_done: %s, pack_id=%d, res=0x%x\n", |
1285 | sdp->disk->disk_name, srp->header.pack_id, result)); | 1286 | sdp->disk->disk_name, srp->header.pack_id, result)); |