# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.640 -> 1.641 # include/linux/ide24.h 1.4 -> 1.5 # drivers/ide24/ide-taskfile.c 1.1 -> 1.2 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/07/10 axboe@burns.home.kernel.dk 1.641 # unify task and fs request highmem mapping # -------------------------------------------- # diff -Nru a/drivers/ide24/ide-taskfile.c b/drivers/ide24/ide-taskfile.c --- a/drivers/ide24/ide-taskfile.c Wed Jul 10 10:51:45 2002 +++ b/drivers/ide24/ide-taskfile.c Wed Jul 10 10:51:45 2002 @@ -59,32 +59,8 @@ #define DTF(x...) #endif -/* - * - */ -#define task_rq_offset(rq) \ - (((rq)->nr_sectors - (rq)->current_nr_sectors) * SECTOR_SIZE) - -/* - * for now, taskfile requests are special :/ - * - * However, upon the creation of the atapi version of packet_command - * data-phase ISR plus it own diagnostics and extensions for direct access - * (ioctl,read,write,rip,stream -- atapi), the kmap/kunmap for PIO will - * come localized. - */ -inline char *task_map_rq (struct request *rq, unsigned long *flags) -{ - if (rq->bio) - return ide_map_buffer(rq, flags); - return rq->buffer + task_rq_offset(rq); -} - -inline void task_unmap_rq (struct request *rq, char *buf, unsigned long *flags) -{ - if (rq->bio) - ide_unmap_buffer(buf, flags); -} +#define task_map_rq(rq, flags) ide_map_buffer((rq), (flags)) +#define task_unmap_rq(rq, buf, flags) ide_unmap_buffer((buf), (flags)) inline u32 task_read_24 (ide_drive_t *drive) { diff -Nru a/include/linux/ide24.h b/include/linux/ide24.h --- a/include/linux/ide24.h Wed Jul 10 10:51:45 2002 +++ b/include/linux/ide24.h Wed Jul 10 10:51:45 2002 @@ -571,12 +571,24 @@ #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) + extern 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); - else - return rq->buffer + ide_rq_offset(rq); + + /* + * task request + */ + return rq->buffer + task_rq_offset(rq); } extern inline void ide_unmap_buffer(char *buffer, unsigned long *flags)