From: Nathan Scott Date: Mon, 29 May 2006 03:54:39 +0000 (+0000) Subject: Fix an endianness issue in the FreeBSD headers, remove a no-longer-needed HAVE macro... X-Git-Tag: v2.9.0~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=714bd9e5ff5fc6d00406c8fda0ef1b9a1052c986;p=thirdparty%2Fxfsprogs-dev.git Fix an endianness issue in the FreeBSD headers, remove a no-longer-needed HAVE macro too. Merge of master-melb:xfs-cmds:26062a by kenmcd. --- diff --git a/VERSION b/VERSION index d2b5331a4..e1be0f5e5 100644 --- a/VERSION +++ b/VERSION @@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=8 -PKG_REVISION=0 +PKG_REVISION=1 PKG_BUILD=1 diff --git a/debian/changelog b/debian/changelog index 71f2d5968..92b616d95 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -xfsprogs (2.8.0-1) unstable; urgency=low +xfsprogs (2.8.1-1) unstable; urgency=low * New upstream release. - -- Nathan Scott Thu, 18 May 2006 16:27:47 +1000 + -- Nathan Scott Mon, 29 May 2006 08:46:05 +1000 xfsprogs (2.7.16-1) unstable; urgency=low diff --git a/doc/CHANGES b/doc/CHANGES index c683cf620..fe8725395 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,6 @@ +xfsprogs-2.8.1 (29 May 2006) + - Fix endianness issues on FreeBSD. + xfsprogs-2.8.0 (18 May 2006) - Initial pass at user space caching, ultimately provides a starting point for a faster, parallel version of repair. diff --git a/include/darwin.h b/include/darwin.h index e0164a596..87eec1b22 100644 --- a/include/darwin.h +++ b/include/darwin.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2005 Silicon Graphics, Inc. + * Copyright (c) 2004-2006 Silicon Graphics, Inc. * All Rights Reserved. * * This program is free software; you can redistribute it and/or @@ -25,6 +25,12 @@ #include #include +#include +#define __BYTE_ORDER BYTE_ORDER +#define __BIG_ENDIAN BIG_ENDIAN +#define __LITTLE_ENDIAN LITTLE_ENDIAN +#include + #include # ifndef SYS_fsctl # define SYS_fsctl 242 @@ -39,7 +45,7 @@ static __inline__ int platform_test_xfs_fd(int fd) struct statfs buf; if (fstatfs(fd, &buf) < 0) return 0; - return (strcmp(buf.f_fstypename, "xfs") == 0); + return strncmp(buf.f_fstypename, "xfs", 4) == 0; } static __inline__ int platform_test_xfs_path(const char *path) @@ -47,7 +53,7 @@ static __inline__ int platform_test_xfs_path(const char *path) struct statfs buf; if (statfs(path, &buf) < 0) return 0; - return (strcmp(buf.f_fstypename, "xfs") == 0); + return strncmp(buf.f_fstypename, "xfs", 4) == 0; } static __inline__ int platform_fstatfs(int fd, struct statfs *buf) @@ -132,12 +138,6 @@ typedef unsigned char uchar_t; #define fdatasync fsync #define memalign(a,sz) valloc(sz) -#include -#define __BYTE_ORDER BYTE_ORDER -#define __BIG_ENDIAN BIG_ENDIAN -#define __LITTLE_ENDIAN LITTLE_ENDIAN -#include - #define O_LARGEFILE 0 #ifndef O_DIRECT #define O_DIRECT 0 diff --git a/include/freebsd.h b/include/freebsd.h index b68f17d41..19d85d55f 100644 --- a/include/freebsd.h +++ b/include/freebsd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2005 Silicon Graphics, Inc. + * Copyright (c) 2004-2006 Silicon Graphics, Inc. * All Rights Reserved. * * This program is free software; you can redistribute it and/or @@ -27,17 +27,23 @@ #include #include -#include +#include +#define __BYTE_ORDER BYTE_ORDER +#define __BIG_ENDIAN BIG_ENDIAN +#define __LITTLE_ENDIAN LITTLE_ENDIAN +#define __swab16(x) __bswap16(x) +#define __swab32(x) __bswap32(x) +#define __swab64(x) __bswap64(x) /* FreeBSD file API is 64-bit aware */ -#define fstat64 fstat -#define ftruncate64 ftruncate +#define fstat64 fstat +#define ftruncate64 ftruncate #define lseek64 lseek -#define stat64 stat -#define pwrite64 pwrite -#define pread64 pread -#define fdatasync fsync -#define memalign(a,size) valloc(size) +#define stat64 stat +#define pwrite64 pwrite +#define pread64 pread +#define fdatasync fsync +#define memalign(a,sz) valloc(sz) #define constpp char * const * @@ -60,10 +66,6 @@ typedef enum { B_FALSE,B_TRUE } boolean_t; #define O_LARGEFILE 0 #define HAVE_FID 1 -#define HAVE_SWABMACROS 1 -#define INT_SWAP16(type,var) ((typeof(type))(__bswap16((__u16)(var)))) -#define INT_SWAP32(type,var) ((typeof(type))(__bswap32((__u32)(var)))) -#define INT_SWAP64(type,var) ((typeof(type))(__bswap64((__u64)(var)))) static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) { @@ -75,7 +77,7 @@ static __inline__ int platform_test_xfs_fd(int fd) struct statfs buf; if (fstatfs(fd, &buf) < 0) return 0; - return strcpy(buf.f_fstypename, "xfs") == 0; + return strncmp(buf.f_fstypename, "xfs", 4) == 0; } static __inline__ int platform_test_xfs_path(const char *path) @@ -83,7 +85,7 @@ static __inline__ int platform_test_xfs_path(const char *path) struct statfs buf; if (statfs(path, &buf) < 0) return 0; - return strcpy(buf.f_fstypename, "xfs") == 0; + return strncmp(buf.f_fstypename, "xfs", 4) == 0; } static __inline__ int platform_fstatfs(int fd, struct statfs *buf) diff --git a/include/irix.h b/include/irix.h index edca008ba..882f241a8 100644 --- a/include/irix.h +++ b/include/irix.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2005 Silicon Graphics, Inc. + * Copyright (c) 2000-2006 Silicon Graphics, Inc. * All Rights Reserved. * * This program is free software; you can redistribute it and/or @@ -122,10 +122,9 @@ typedef struct xfs_fsop_attrmulti_handlereq { #define __BYTE_ORDER BYTE_ORDER #define __BIG_ENDIAN BIG_ENDIAN #define __LITTLE_ENDIAN LITTLE_ENDIAN -#define HAVE_SWABMACROS 1 -#define INT_SWAP16(type,var) (var) -#define INT_SWAP32(type,var) (var) -#define INT_SWAP64(type,var) (var) +#define __swab16(x) (x) +#define __swab32(x) (x) +#define __swab64(x) (x) /* Map some gcc macros for the MipsPRO compiler */ #ifndef __GNUC__ @@ -231,7 +230,7 @@ static __inline__ int platform_test_xfs_fd(int fd) struct statvfs sbuf; if (fstatvfs(fd, &sbuf) < 0) return 0; - return (strcmp(sbuf.f_basetype, "xfs") == 0); + return strncmp(sbuf.f_basetype, "xfs", 4) == 0; } static __inline__ int platform_test_xfs_path(const char *path) @@ -239,7 +238,7 @@ static __inline__ int platform_test_xfs_path(const char *path) struct statvfs sbuf; if (statvfs(path, &sbuf) < 0) return 0; - return (strcmp(sbuf.f_basetype, "xfs") == 0); + return strncmp(sbuf.f_basetype, "xfs", 4) == 0; } static __inline__ int platform_fstatfs(int fd, struct statfs *buf) diff --git a/include/xfs_arch.h b/include/xfs_arch.h index c4836890b..b16825b91 100644 --- a/include/xfs_arch.h +++ b/include/xfs_arch.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc. + * Copyright (c) 2000-2002,2005-2006 Silicon Graphics, Inc. * All Rights Reserved. * * This program is free software; you can redistribute it and/or @@ -68,11 +68,9 @@ /* generic swapping macros */ -#ifndef HAVE_SWABMACROS #define INT_SWAP16(type,var) ((typeof(type))(__swab16((__u16)(var)))) #define INT_SWAP32(type,var) ((typeof(type))(__swab32((__u32)(var)))) #define INT_SWAP64(type,var) ((typeof(type))(__swab64((__u64)(var)))) -#endif #define INT_SWAP(type, var) \ ((sizeof(type) == 8) ? INT_SWAP64(type,var) : \ @@ -199,7 +197,7 @@ static inline void be64_add(__be64 *a, __s64 b) * into 32bits a four-member array is used: * * |24-31|16-23| 8-15| 0- 7| - */ + */ #define XFS_GET_DIR_INO4(di) \ (((__u32)(di).i[0] << 24) | ((di).i[1] << 16) | ((di).i[2] << 8) | ((di).i[3])) @@ -232,5 +230,5 @@ do { \ (di).i[6] = (((from) & 0x000000000000ff00ULL) >> 8); \ (di).i[7] = ((from) & 0x00000000000000ffULL); \ } while (0) - + #endif /* __XFS_ARCH_H__ */