btrfs-progs: compat: define DIV_ROUND_UP if not already defined
DIV_ROUND_UP may not be defined, so define it if it's not already. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
parent
81e43b4b76
commit
626fee6b3b
4
bitops.h
4
bitops.h
|
@ -3,6 +3,10 @@
|
|||
|
||||
#include <linux/kernel.h>
|
||||
|
||||
#ifndef DIV_ROUND_UP
|
||||
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
|
||||
#endif
|
||||
|
||||
#define BITS_PER_BYTE 8
|
||||
#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
|
||||
#define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u64))
|
||||
|
|
Loading…
Reference in New Issue