Skip to content

Commit

Permalink
[BLOCK] Move sector_div() from blkdev.h to kernel.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe committed Oct 12, 2007
1 parent 782e3b3 commit 2da96ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 0 additions & 14 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,6 @@

#include <asm/scatterlist.h>

#ifdef CONFIG_LBD
# include <asm/div64.h>
# 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;
Expand Down
14 changes: 14 additions & 0 deletions include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <asm/div64.h>
# 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
Expand Down

0 comments on commit 2da96ac

Please sign in to comment.