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:
Jeff Mahoney 2013-08-14 14:21:54 -04:00 committed by David Sterba
parent 81e43b4b76
commit 626fee6b3b
1 changed files with 4 additions and 0 deletions

View File

@ -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))