diff options
| author | Bartlomiej Zolnierkiewicz <b.zolnierkiewicz@elka.pw.edu.pl> | 2004-06-23 20:03:13 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-23 20:03:13 -0700 |
| commit | 2677a4df4899708b3b886ce155ee86553716fd9c (patch) | |
| tree | 5f9c00e4a667bed15194bf9122bd911265d586b9 /include | |
| parent | 89c70be655fce2a55c7632d307a2d64c7d622d69 (diff) | |
[PATCH] ide: use task_buffer[_multi]_sectors() in ide-taskfile.c
- update rq counters directly in task_buffer_sectors()
- use task_buffer[_multi]_sectors() in taskfile PIO
handlers (CONFIG_IDE_TASKFILE_IO=n and flagged ones) so:
(a) rq->hard_cur_sectors is used for rq mapping
(b) in case of error valid rq->sector is reported
(c) we can s/rq->current_nr_sectors/rq->nr_sectors/ later
- uninline task_buffer_sectors()
- remove not needed !rq->bio code from ide_[un]map_buffer()
(it is used only for fs requests which are always bio based)
- remove no longer needed task_rq_offset()
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/ide.h | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index cddbcdd99479..fe54e41439c8 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -833,30 +833,14 @@ typedef struct ide_dma_ops_s { #define ide_rq_offset(rq) \ (((rq)->hard_cur_sectors - (rq)->current_nr_sectors) << 9) -/* - * taskfiles really should use hard_cur_sectors as well! - */ -#define task_rq_offset(rq) \ - (((rq)->nr_sectors - (rq)->current_nr_sectors) * SECTOR_SIZE) - static inline void *ide_map_buffer(struct request *rq, unsigned long *flags) { - /* - * fs request - */ - if (rq->bio) - return bio_kmap_irq(rq->bio, flags) + ide_rq_offset(rq); - - /* - * task request - */ - return rq->buffer + task_rq_offset(rq); + return bio_kmap_irq(rq->bio, flags) + ide_rq_offset(rq); } static inline void ide_unmap_buffer(struct request *rq, char *buffer, unsigned long *flags) { - if (rq->bio) - bio_kunmap_irq(buffer, flags); + bio_kunmap_irq(buffer, flags); } #endif /* !CONFIG_IDE_TASKFILE_IO */ |
