X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=compat%2Finclude%2Fbsdcompat.h;h=4b9b9077ac6edacbf38a9e27e2f793a5122a9b52;hb=e1e4be20b0192a2988eab70a31fb1428c4c81eec;hp=ce7d6538544999f99e5b8a8285908f107adc3851;hpb=3e8961b70386c298ef95b85171ec9bb5dea9649a;p=dump.git diff --git a/compat/include/bsdcompat.h b/compat/include/bsdcompat.h index ce7d653..4b9b907 100644 --- a/compat/include/bsdcompat.h +++ b/compat/include/bsdcompat.h @@ -5,12 +5,13 @@ * Stelian Pop , 1999-2000 * Stelian Pop - AlcĂ´ve , 2000-2002 * - * $Id: bsdcompat.h,v 1.21 2003/11/22 16:52:16 stelian Exp $ + * $Id: bsdcompat.h,v 1.23 2004/07/01 09:14:48 stelian Exp $ */ #include #include #include +#include #define __dead volatile #define UNUSED(x) x __attribute__ ((unused)) @@ -37,11 +38,17 @@ #define UF_NODUMP EXT2_NODUMP_FL #endif +#ifndef howmany #define howmany(x,y) (((x)+((y)-1))/(y)) +#endif +#ifndef roundup #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) +#endif +#ifndef powerof2 #define powerof2(x) ((((x)-1)&(x))==0) +#endif -#define fsbtodb(sb,b) ((int)(((long long)(b) * EXT2_BLOCK_SIZE((sb)->super)) / DEV_BSIZE)) +#define fsbtodb(sb,b) ((ext2_loff_t)(((long long)(b) * EXT2_BLOCK_SIZE((sb)->super)) / DEV_BSIZE)) #define dbtofsb(sb,b) ((int)(((long long)(b) * DEV_BSIZE) / EXT2_BLOCK_SIZE((sb)->super))) #define sblock fs @@ -111,8 +118,8 @@ struct dinode { __u32 di_blocks; __u32 di_flags; __u32 di_reserved1; - daddr_t di_db[NDADDR]; - daddr_t di_ib[NIADDR]; + __u32 di_db[NDADDR]; + __u32 di_ib[NIADDR]; __u32 di_gen; __u32 di_file_acl; __u32 di_dir_acl; @@ -242,8 +249,8 @@ struct old_bsd_inode { char di_usymlink[MAXFASTLINK + 1]; } di_un; #else - daddr_t di_db[NDADDR]; - daddr_t di_ib[NIADDR]; + __u32 di_db[NDADDR]; + __u32 di_ib[NIADDR]; #endif __s32 di_flags; __s32 di_blocks; @@ -271,8 +278,8 @@ struct new_bsd_inode { struct bsdtimeval di_atime; struct bsdtimeval di_mtime; struct bsdtimeval di_ctime; - daddr_t di_db[NDADDR]; - daddr_t di_ib[NIADDR]; + __u32 di_db[NDADDR]; + __u32 di_ib[NIADDR]; __u32 di_flags; __s32 di_blocks; __s32 di_gen;