From 2da96acde0318f121ed3f5993ae9324c856ecfd4 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 12 Oct 2007 12:40:38 +0200 Subject: [PATCH 1/4] [BLOCK] Move sector_div() from blkdev.h to kernel.h We need it even if CONFIG_BLOCK is disabled, so move it outside of the block layer include system. Signed-off-by: Jens Axboe --- include/linux/blkdev.h | 14 -------------- include/linux/kernel.h | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 95be0ac57e76..5ed888b04b29 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -20,20 +20,6 @@ #include -#ifdef CONFIG_LBD -# include -# define sector_div(a, b) do_div(a, b) -#else -# define sector_div(n, b)( \ -{ \ - int _res; \ - _res = (n) % (b); \ - (n) /= (b); \ - _res; \ -} \ -) -#endif - struct scsi_ioctl_command; struct request_queue; diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 47160fe378c9..d9725a28a265 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -42,6 +42,20 @@ extern const char linux_proc_banner[]; #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) +#ifdef CONFIG_LBD +# include +# define sector_div(a, b) do_div(a, b) +#else +# define sector_div(n, b)( \ +{ \ + int _res; \ + _res = (n) % (b); \ + (n) /= (b); \ + _res; \ +} \ +) +#endif + /** * upper_32_bits - return bits 32-63 of a number * @n: the number we're accessing From 43d28d98bed372649060ef783719b426a91972ed Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 12 Oct 2007 12:50:07 +0200 Subject: [PATCH 2/4] [BLOCK] Better fix for do_blk_trace_setup() for !CONFIG_BLOCK We don't have the request queue definition, so just make it a macro instead. Signed-off-by: Jens Axboe --- include/linux/blktrace_api.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 2e105a12fe29..7e11d23ac36a 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h @@ -290,12 +290,7 @@ static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio, #define blk_add_trace_generic(q, rq, rw, what) do { } while (0) #define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) #define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) -static inline int do_blk_trace_setup(struct request_queue *q, - struct block_device *bdev, - struct blk_user_trace_setup *buts) -{ - return 0; -} +#define do_blk_trace_setup(q, bdev, buts) (-ENOTTY) #endif /* CONFIG_BLK_DEV_IO_TRACE */ #endif /* __KERNEL__ */ #endif From 99874d50481c093adfe74e796436024d88b6a48c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 12 Oct 2007 12:50:41 +0200 Subject: [PATCH 3/4] [BLOCK] Only include the compat ioctl code if CONFIG_BLOCK is set Add an extra CONFIG_BLOCK_COMPAT that we can use in the Makefile Signed-off-by: Jens Axboe --- block/Kconfig | 4 ++++ block/Makefile | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/block/Kconfig b/block/Kconfig index 2484e0e9d89c..e10895647f72 100644 --- a/block/Kconfig +++ b/block/Kconfig @@ -62,6 +62,10 @@ config BLK_DEV_BSG protocols (e.g. Task Management Functions and SMP in Serial Attached SCSI). +config BLOCK_COMPAT + bool + default y + endif # BLOCK source block/Kconfig.iosched diff --git a/block/Makefile b/block/Makefile index 3cfe7cebaa6a..826108190f00 100644 --- a/block/Makefile +++ b/block/Makefile @@ -11,4 +11,4 @@ obj-$(CONFIG_IOSCHED_DEADLINE) += deadline-iosched.o obj-$(CONFIG_IOSCHED_CFQ) += cfq-iosched.o obj-$(CONFIG_BLK_DEV_IO_TRACE) += blktrace.o -obj-$(CONFIG_COMPAT) += compat_ioctl.o +obj-$(CONFIG_BLOCK_COMPAT) += compat_ioctl.o From b018fc09498f73da0014b44acbd59ea4a94300b4 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 12 Oct 2007 12:54:13 +0200 Subject: [PATCH 4/4] [BLOCK] s390 xpram typo bio_end_io() should be bio_endio() Signed-off-by: Jens Axboe --- drivers/s390/block/xpram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c index 0fbacc8b1063..f231bc21b1ca 100644 --- a/drivers/s390/block/xpram.c +++ b/drivers/s390/block/xpram.c @@ -230,7 +230,7 @@ static int xpram_make_request(struct request_queue *q, struct bio *bio) } } set_bit(BIO_UPTODATE, &bio->bi_flags); - bio_end_io(bio, 0); + bio_endio(bio, 0); return 0; fail: bio_io_error(bio);