* Stelian Pop <stelian@popies.net>, 1999-2000
* Stelian Pop <stelian@popies.net> - AlcĂ´ve <www.alcove.com>, 2000-2002
*
- * $Id: bsdcompat.h,v 1.20 2003/10/26 16:05:46 stelian Exp $
+ * $Id: bsdcompat.h,v 1.25 2011/06/10 12:46:41 stelian Exp $
*/
#include <config.h>
#include <sys/time.h>
#include <dirent.h>
+#include <ext2fs/ext2fs.h>
+
+#ifndef _BSDCOMPAT_H
+#define _BSDCOMPAT_H 1
#define __dead volatile
#define UNUSED(x) x __attribute__ ((unused))
#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
typedef int16_t __s16;
typedef int32_t __s32;
#ifndef u_int
-#typedef unsigned int u_int;
+typedef unsigned int u_int;
#endif
#ifndef u_int16_t
typedef unsigned short u_int16_t;
__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;
__u16 di_uidhigh;
__u16 di_gidhigh;
__u32 di_spare;
+ __u16 di_extraisize;
+ __u16 di_pad2;
};
#define di_rdev di_db[0]
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;
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;
#define di_ouid di_u.oldids[0]
#define di_ogid di_u.oldids[1]
+#endif /* _BSDCOMPAT_H */