From e3408ae9a6a48feb86956ed4a7cd1c3ef367d980 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 23 Apr 2003 04:27:34 -0700 Subject: [PATCH] [PATCH] kill LOCAL_END_REQUEST And uninline end_request - it's calling to many functions to be useful inline. --- drivers/block/ll_rw_blk.c | 10 ++++++++++ drivers/mtd/mtdblock.c | 1 - drivers/mtd/mtdblock_ro.c | 1 - drivers/s390/block/dasd.c | 2 -- include/linux/blk.h | 16 +--------------- include/linux/ide.h | 1 - 6 files changed, 11 insertions(+), 20 deletions(-) diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index ad6e7b62e66f9..832189677065d 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c @@ -2187,6 +2187,15 @@ void end_that_request_last(struct request *req) complete(waiting); } +void end_request(struct request *req, int uptodate) +{ + if (!end_that_request_first(req, uptodate, req->hard_cur_sectors)) { + add_disk_randomness(req->rq_disk); + blkdev_dequeue_request(req); + end_that_request_last(req); + } +} + int __init blk_dev_init(void) { int total_ram = nr_free_pages() << (PAGE_SHIFT - 10); @@ -2229,6 +2238,7 @@ int __init blk_dev_init(void) EXPORT_SYMBOL(end_that_request_first); EXPORT_SYMBOL(end_that_request_chunk); EXPORT_SYMBOL(end_that_request_last); +EXPORT_SYMBOL(end_request); EXPORT_SYMBOL(blk_init_queue); EXPORT_SYMBOL(blk_cleanup_queue); EXPORT_SYMBOL(blk_queue_make_request); diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c index b512feb74aa63..815dbfe4ad830 100644 --- a/drivers/mtd/mtdblock.c +++ b/drivers/mtd/mtdblock.c @@ -19,7 +19,6 @@ #define MAJOR_NR MTD_BLOCK_MAJOR #define DEVICE_NAME "mtdblock" #define DEVICE_NR(device) (device) -#define LOCAL_END_REQUEST #include #include diff --git a/drivers/mtd/mtdblock_ro.c b/drivers/mtd/mtdblock_ro.c index 3083f0c41a06f..f29b2c23e1fab 100644 --- a/drivers/mtd/mtdblock_ro.c +++ b/drivers/mtd/mtdblock_ro.c @@ -18,7 +18,6 @@ #include #include -#define LOCAL_END_REQUEST #define MAJOR_NR MTD_BLOCK_MAJOR #define DEVICE_NAME "mtdblock" #include diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 16bba2e924e60..43b06070bed72 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -10,8 +10,6 @@ * $Revision: 1.94 $ */ -#define LOCAL_END_REQUEST /* Don't generate end_request in blk.h */ - #include #include #include diff --git a/include/linux/blk.h b/include/linux/blk.h index 8523e8f841e35..9e65d6827d300 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -25,6 +25,7 @@ extern void rand_initialize_disk(struct gendisk *disk); extern int end_that_request_first(struct request *, int, int); extern int end_that_request_chunk(struct request *, int, int); extern void end_that_request_last(struct request *); +extern void end_request(struct request *req, int uptodate); struct request *elv_next_request(request_queue_t *q); static inline void blkdev_dequeue_request(struct request *req) @@ -37,19 +38,4 @@ static inline void blkdev_dequeue_request(struct request *req) elv_remove_request(req->q, req); } -/* - * If we have our own end_request, we do not want to include this mess - */ -#ifndef LOCAL_END_REQUEST -static inline void end_request(struct request *req, int uptodate) -{ - if (end_that_request_first(req, uptodate, req->hard_cur_sectors)) - return; - - add_disk_randomness(req->rq_disk); - blkdev_dequeue_request(req); - end_that_request_last(req); -} -#endif /* !LOCAL_END_REQUEST */ - #endif /* _BLK_H */ diff --git a/include/linux/ide.h b/include/linux/ide.h index a06f010335847..96c9ce33ce4dd 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1245,7 +1245,6 @@ extern int noautodma; * We need blk.h, but we replace its end_request by our own version. */ #define IDE_DRIVER /* Toggle some magic bits in blk.h */ -#define LOCAL_END_REQUEST /* Don't generate end_request in blk.h */ #include extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); -- 2.53.0