aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-10-12 06:40:38 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-10-12 06:40:38 -0400
commit2da96acde0318f121ed3f5993ae9324c856ecfd4 (patch)
tree020f58a39c5ceb9bd3bca1a63ad22e3a2da98e57 /include/linux/kernel.h
parent782e3b3b3804c38d5130c7f21d7ec7bf6709023f (diff)
[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 <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h14
1 files changed, 14 insertions, 0 deletions
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[];
42#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) 42#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
43#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) 43#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
44 44
45#ifdef CONFIG_LBD
46# include <asm/div64.h>
47# define sector_div(a, b) do_div(a, b)
48#else
49# define sector_div(n, b)( \
50{ \
51 int _res; \
52 _res = (n) % (b); \
53 (n) /= (b); \
54 _res; \
55} \
56)
57#endif
58
45/** 59/**
46 * upper_32_bits - return bits 32-63 of a number 60 * upper_32_bits - return bits 32-63 of a number
47 * @n: the number we're accessing 61 * @n: the number we're accessing