diff options
| author | Bartlomiej Zolnierkiewicz <b.zolnierkiewicz@elka.pw.edu.pl> | 2004-06-23 20:02:51 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-23 20:02:51 -0700 |
| commit | e0db58edac3f394d910ec43fc1bcc3cc530ddc45 (patch) | |
| tree | 92394ea3ef31b3391d6f895ce7af1af212fcb686 /include/linux | |
| parent | a223911077e3d57164c4b78bb810667d87115df1 (diff) | |
[PATCH] ide: split task_sectors() and task_multi_sectors()
- split __task_sectors() out of task_sectors()
- add bio and buffer versions of task[_multi]_sectors()
- use task_bio_sectors() instead of task_sectors() in pdc4030.c
- move task[_buffer]_sectors() to ide-taskfile.c
- uninline task[_multi]_sectors()
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ide.h | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 5ae165606a7c..cddbcdd99479 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1415,42 +1415,32 @@ extern void atapi_output_bytes(ide_drive_t *, void *, u32); extern void taskfile_input_data(ide_drive_t *, void *, u32); extern void taskfile_output_data(ide_drive_t *, void *, u32); -#ifdef CONFIG_IDE_TASKFILE_IO - #define IDE_PIO_IN 0 #define IDE_PIO_OUT 1 -static inline void task_sectors(ide_drive_t *drive, struct request *rq, - unsigned nsect, int rw) +static inline void __task_sectors(ide_drive_t *drive, char *buf, + unsigned nsect, unsigned rw) { - unsigned long flags; - unsigned int bio_rq; - char *buf; - - /* - * bio_rq flag is needed because we can call - * rq_unmap_buffer() with rq->cbio == NULL - */ - bio_rq = rq->cbio ? 1 : 0; - - if (bio_rq) - buf = rq_map_buffer(rq, &flags); /* fs request */ - else - buf = rq->buffer + blk_rq_offset(rq); /* task request */ - /* * IRQ can happen instantly after reading/writing * last sector of the datablock. */ - process_that_request_first(rq, nsect); - if (rw == IDE_PIO_OUT) taskfile_output_data(drive, buf, nsect * SECTOR_WORDS); else taskfile_input_data(drive, buf, nsect * SECTOR_WORDS); +} + +#ifdef CONFIG_IDE_TASKFILE_IO +static inline void task_bio_sectors(ide_drive_t *drive, struct request *rq, + unsigned nsect, unsigned rw) +{ + unsigned long flags; + char *buf = rq_map_buffer(rq, &flags); - if (bio_rq) - rq_unmap_buffer(buf, &flags); + process_that_request_first(rq, nsect); + __task_sectors(drive, buf, nsect, rw); + rq_unmap_buffer(buf, &flags); } #endif /* CONFIG_IDE_TASKFILE_IO */ |
