public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* xfsprogs: clean up installed headers
@ 2015-07-03 10:12 Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 01/13] xfsprogs: don't install internal header files Christoph Hellwig
                   ` (12 more replies)
  0 siblings, 13 replies; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

This series ensures we only install the minimum required headers, and
especially no autoconf-generated header that might differ for different
targets in multiarch setups.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 01/13] xfsprogs: don't install internal header files
  2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
@ 2015-07-03 10:12 ` Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 02/13] xfsprogs: remove unused macros from xfs_arch.h Christoph Hellwig
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

All the headers in $(HFILES) are internal to xfsprogs and should not be
installed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 libxfs/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libxfs/Makefile b/libxfs/Makefile
index 98e0e28..c85f1ed 100644
--- a/libxfs/Makefile
+++ b/libxfs/Makefile
@@ -139,7 +139,7 @@ install-headers: $(addsuffix -hdrs, $(PKGHFILES) $(QAHFILES))
 	$(Q)$(LN_S) -f $(PWD)/libxfs/$* $(TOPDIR)/include/xfs/$*
 
 install-dev: install
-	$(INSTALL) -m 644 $(PKGHFILES) $(HFILES) $(PKG_INC_DIR)
+	$(INSTALL) -m 644 $(PKGHFILES) $(PKG_INC_DIR)
 
 install-qa: install-dev
 	$(INSTALL) -m 644 $(QAHFILES) $(PKG_INC_DIR)
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 02/13] xfsprogs: remove unused macros from xfs_arch.h
  2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 01/13] xfsprogs: don't install internal header files Christoph Hellwig
@ 2015-07-03 10:12 ` Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 03/13] xfsprogs: remove swab.h Christoph Hellwig
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/xfs_arch.h | 60 ------------------------------------------------------
 1 file changed, 60 deletions(-)

diff --git a/include/xfs_arch.h b/include/xfs_arch.h
index 07026c0..903b02a 100644
--- a/include/xfs_arch.h
+++ b/include/xfs_arch.h
@@ -71,64 +71,4 @@ static inline void be64_add_cpu(__be64 *a, __s64 b)
 	*a = cpu_to_be64(be64_to_cpu(*a) + b);
 }
 
-/*
- * get and set integers from potentially unaligned locations
- */
-
-#define INT_GET_UNALIGNED_16_BE(pointer) \
-   ((__u16)((((__u8*)(pointer))[0] << 8) | (((__u8*)(pointer))[1])))
-#define INT_SET_UNALIGNED_16_BE(pointer,value) \
-    { \
-	((__u8*)(pointer))[0] = (((value) >> 8) & 0xff); \
-	((__u8*)(pointer))[1] = (((value)     ) & 0xff); \
-    }
-
-/*
- * In directories inode numbers are stored as unaligned arrays of unsigned
- * 8bit integers on disk.
- *
- * For v1 directories or v2 directories that contain inode numbers that
- * do not fit into 32bit the array has eight members, but the first member
- * is always zero:
- *
- *  |unused|48-55|40-47|32-39|24-31|16-23| 8-15| 0- 7|
- *
- * For v2 directories that only contain entries with inode numbers that fit
- * 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]))
-
-#define XFS_PUT_DIR_INO4(from, di) \
-do { \
-	(di).i[0] = (((from) & 0xff000000ULL) >> 24); \
-	(di).i[1] = (((from) & 0x00ff0000ULL) >> 16); \
-	(di).i[2] = (((from) & 0x0000ff00ULL) >> 8); \
-	(di).i[3] = ((from) & 0x000000ffULL); \
-} while (0)
-
-#define XFS_DI_HI(di) \
-	(((__u32)(di).i[1] << 16) | ((di).i[2] << 8) | ((di).i[3]))
-#define XFS_DI_LO(di) \
-	(((__u32)(di).i[4] << 24) | ((di).i[5] << 16) | ((di).i[6] << 8) | ((di).i[7]))
-
-#define XFS_GET_DIR_INO8(di)        \
-	(((xfs_ino_t)XFS_DI_LO(di) & 0xffffffffULL) | \
-	 ((xfs_ino_t)XFS_DI_HI(di) << 32))
-
-#define XFS_PUT_DIR_INO8(from, di) \
-do { \
-	(di).i[0] = 0; \
-	(di).i[1] = (((from) & 0x00ff000000000000ULL) >> 48); \
-	(di).i[2] = (((from) & 0x0000ff0000000000ULL) >> 40); \
-	(di).i[3] = (((from) & 0x000000ff00000000ULL) >> 32); \
-	(di).i[4] = (((from) & 0x00000000ff000000ULL) >> 24); \
-	(di).i[5] = (((from) & 0x0000000000ff0000ULL) >> 16); \
-	(di).i[6] = (((from) & 0x000000000000ff00ULL) >> 8); \
-	(di).i[7] = ((from) & 0x00000000000000ffULL); \
-} while (0)
-	
 #endif	/* __XFS_ARCH_H__ */
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 03/13] xfsprogs: remove swab.h
  2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 01/13] xfsprogs: don't install internal header files Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 02/13] xfsprogs: remove unused macros from xfs_arch.h Christoph Hellwig
@ 2015-07-03 10:12 ` Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 04/13] xfsprogs: only install *format.h headers in install-qa Christoph Hellwig
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

The macros in swab.h are only used to implement those in xfs_arch.h, so let's
consolidate the two headers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/Makefile      |   1 -
 include/gnukfreebsd.h |   1 -
 include/libxfs.h      |   1 -
 include/swab.h        | 194 --------------------------------------------------
 include/xfs_arch.h    | 191 +++++++++++++++++++++++++++++++++++++++++++++++++
 libxfs/crc32.c        |   1 -
 libxfs/libxfs_priv.h  |   1 -
 7 files changed, 191 insertions(+), 199 deletions(-)
 delete mode 100644 include/swab.h

diff --git a/include/Makefile b/include/Makefile
index 91b33b0..f033245 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -28,7 +28,6 @@ QAHFILES = libxfs.h \
 	list.h \
 	parent.h \
 	radix-tree.h \
-	swab.h \
 	xfs_arch.h \
 	xfs_btree_trace.h \
 	xfs_inode.h \
diff --git a/include/gnukfreebsd.h b/include/gnukfreebsd.h
index f2e1bf5..b83c144 100644
--- a/include/gnukfreebsd.h
+++ b/include/gnukfreebsd.h
@@ -31,7 +31,6 @@
 #include <ctype.h>
 #include <libgen.h>
 #include <paths.h>
-#include "xfs/swab.h"
 
 #define constpp	char * const *
 
diff --git a/include/libxfs.h b/include/libxfs.h
index ab4cc9a..eda664f 100644
--- a/include/libxfs.h
+++ b/include/libxfs.h
@@ -28,7 +28,6 @@
 #include "xfs/bitops.h"
 #include "xfs/kmem.h"
 #include "xfs/radix-tree.h"
-#include "xfs/swab.h"
 #include "xfs/atomic.h"
 
 #include "xfs/xfs_types.h"
diff --git a/include/swab.h b/include/swab.h
deleted file mode 100644
index b06346c..0000000
--- a/include/swab.h
+++ /dev/null
@@ -1,194 +0,0 @@
-#ifndef SWAB_H
-#define SWAB_H
-
-/* casts are necessary for constants, because we never know how for sure
- * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
- */
-#define ___swab16(x) \
-({ \
-	__u16 __x = (x); \
-	((__u16)( \
-		(((__u16)(__x) & (__u16)0x00ffU) << 8) | \
-		(((__u16)(__x) & (__u16)0xff00U) >> 8) )); \
-})
-
-#define ___swab32(x) \
-({ \
-	__u32 __x = (x); \
-	((__u32)( \
-		(((__u32)(__x) & (__u32)0x000000ffUL) << 24) | \
-		(((__u32)(__x) & (__u32)0x0000ff00UL) <<  8) | \
-		(((__u32)(__x) & (__u32)0x00ff0000UL) >>  8) | \
-		(((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); \
-})
-
-#define ___swab64(x) \
-({ \
-	__u64 __x = (x); \
-	((__u64)( \
-		(__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \
-		(__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \
-		(__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \
-		(__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) <<  8) | \
-		(__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >>  8) | \
-		(__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
-		(__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \
-		(__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \
-})
-
-#define ___constant_swab16(x) \
-	((__u16)( \
-		(((__u16)(x) & (__u16)0x00ffU) << 8) | \
-		(((__u16)(x) & (__u16)0xff00U) >> 8) ))
-#define ___constant_swab32(x) \
-	((__u32)( \
-		(((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
-		(((__u32)(x) & (__u32)0x0000ff00UL) <<  8) | \
-		(((__u32)(x) & (__u32)0x00ff0000UL) >>  8) | \
-		(((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
-#define ___constant_swab64(x) \
-	((__u64)( \
-		(__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
-		(__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
-		(__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
-		(__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) <<  8) | \
-		(__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >>  8) | \
-		(__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
-		(__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
-		(__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
-
-/*
- * provide defaults when no architecture-specific optimization is detected
- */
-#ifndef __arch__swab16
-#  define __arch__swab16(x) ({ __u16 __tmp = (x) ; ___swab16(__tmp); })
-#endif
-#ifndef __arch__swab32
-#  define __arch__swab32(x) ({ __u32 __tmp = (x) ; ___swab32(__tmp); })
-#endif
-#ifndef __arch__swab64
-#  define __arch__swab64(x) ({ __u64 __tmp = (x) ; ___swab64(__tmp); })
-#endif
-
-#ifndef __arch__swab16p
-#  define __arch__swab16p(x) __arch__swab16(*(x))
-#endif
-#ifndef __arch__swab32p
-#  define __arch__swab32p(x) __arch__swab32(*(x))
-#endif
-#ifndef __arch__swab64p
-#  define __arch__swab64p(x) __arch__swab64(*(x))
-#endif
-
-#ifndef __arch__swab16s
-#  define __arch__swab16s(x) do { *(x) = __arch__swab16p((x)); } while (0)
-#endif
-#ifndef __arch__swab32s
-#  define __arch__swab32s(x) do { *(x) = __arch__swab32p((x)); } while (0)
-#endif
-#ifndef __arch__swab64s
-#  define __arch__swab64s(x) do { *(x) = __arch__swab64p((x)); } while (0)
-#endif
-
-
-/*
- * Allow constant folding
- */
-#  define __swab16(x) \
-(__builtin_constant_p((__u16)(x)) ? \
- ___constant_swab16((x)) : \
- __fswab16((x)))
-#  define __swab32(x) \
-(__builtin_constant_p((__u32)(x)) ? \
- ___constant_swab32((x)) : \
- __fswab32((x)))
-#  define __swab64(x) \
-(__builtin_constant_p((__u64)(x)) ? \
- ___constant_swab64((x)) : \
- __fswab64((x)))
-
-
-static __inline__ __u16 __fswab16(__u16 x)
-{
-	return (__extension__ __arch__swab16(x));
-}
-static __inline__ __u16 __swab16p(__u16 *x)
-{
-	return (__extension__ __arch__swab16p(x));
-}
-static __inline__ void __swab16s(__u16 *addr)
-{
-	(__extension__ ({__arch__swab16s(addr);}));
-}
-
-static __inline__ __u32 __fswab32(__u32 x)
-{
-	return (__extension__ __arch__swab32(x));
-}
-static __inline__ __u32 __swab32p(__u32 *x)
-{
-	return (__extension__ __arch__swab32p(x));
-}
-static __inline__ void __swab32s(__u32 *addr)
-{
-	(__extension__ ({__arch__swab32s(addr);}));
-}
-
-static __inline__ __u64 __fswab64(__u64 x)
-{
-#  ifdef __SWAB_64_THRU_32__
-	__u32 h = x >> 32;
-	__u32 l = x & ((1ULL<<32)-1);
-	return (((__u64)__swab32(l)) << 32) | ((__u64)(__swab32(h)));
-#  else
-	return (__extension__ __arch__swab64(x));
-#  endif
-}
-static __inline__ __u64 __swab64p(__u64 *x)
-{
-	return (__extension__ __arch__swab64p(x));
-}
-static __inline__ void __swab64s(__u64 *addr)
-{
-	(__extension__ ({__arch__swab64s(addr);}));
-}
-
-static inline __uint16_t get_unaligned_be16(void *p)
-{
-	__uint8_t *__p = p;
-	return __p[0] << 8 | __p[1];
-}
-
-static inline __uint32_t get_unaligned_be32(void *p)
-{
-	__uint8_t *__p = p;
-        return __p[0] << 24 | __p[1] << 16 | __p[2] << 8 | __p[3];
-}
-
-static inline __uint64_t get_unaligned_be64(void *p)
-{
-	return (__uint64_t)get_unaligned_be32(p) << 32 |
-			   get_unaligned_be32(p + 4);
-}
-
-static inline void put_unaligned_be16(__uint16_t val, void *p)
-{
-	__uint8_t *__p = p;
-	*__p++ = val >> 8;
-	*__p++ = val;
-}
-
-static inline void put_unaligned_be32(__uint32_t val, void *p)
-{
-	__uint8_t *__p = p;
-	put_unaligned_be16(val >> 16, __p);
-	put_unaligned_be16(val, __p + 2);
-}
-
-static inline void put_unaligned_be64(__uint64_t val, void *p)
-{
-	put_unaligned_be32(val >> 32, p);
-	put_unaligned_be32(val, p + 4);
-}
-
-#endif /* SWAB_H */
diff --git a/include/xfs_arch.h b/include/xfs_arch.h
index 903b02a..310a17e 100644
--- a/include/xfs_arch.h
+++ b/include/xfs_arch.h
@@ -24,6 +24,159 @@
 #undef XFS_NATIVE_HOST
 #endif
 
+/*
+ * Casts are necessary for constants, because we never know how for sure
+ * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
+ */
+#define ___swab16(x) \
+({ \
+	__u16 __x = (x); \
+	((__u16)( \
+		(((__u16)(__x) & (__u16)0x00ffU) << 8) | \
+		(((__u16)(__x) & (__u16)0xff00U) >> 8) )); \
+})
+
+#define ___swab32(x) \
+({ \
+	__u32 __x = (x); \
+	((__u32)( \
+		(((__u32)(__x) & (__u32)0x000000ffUL) << 24) | \
+		(((__u32)(__x) & (__u32)0x0000ff00UL) <<  8) | \
+		(((__u32)(__x) & (__u32)0x00ff0000UL) >>  8) | \
+		(((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); \
+})
+
+#define ___swab64(x) \
+({ \
+	__u64 __x = (x); \
+	((__u64)( \
+		(__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \
+		(__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \
+		(__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \
+		(__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) <<  8) | \
+		(__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >>  8) | \
+		(__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
+		(__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \
+		(__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \
+})
+
+#define ___constant_swab16(x) \
+	((__u16)( \
+		(((__u16)(x) & (__u16)0x00ffU) << 8) | \
+		(((__u16)(x) & (__u16)0xff00U) >> 8) ))
+#define ___constant_swab32(x) \
+	((__u32)( \
+		(((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
+		(((__u32)(x) & (__u32)0x0000ff00UL) <<  8) | \
+		(((__u32)(x) & (__u32)0x00ff0000UL) >>  8) | \
+		(((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
+#define ___constant_swab64(x) \
+	((__u64)( \
+		(__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
+		(__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
+		(__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
+		(__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) <<  8) | \
+		(__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >>  8) | \
+		(__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
+		(__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
+		(__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
+
+/*
+ * provide defaults when no architecture-specific optimization is detected
+ */
+#ifndef __arch__swab16
+#  define __arch__swab16(x) ({ __u16 __tmp = (x) ; ___swab16(__tmp); })
+#endif
+#ifndef __arch__swab32
+#  define __arch__swab32(x) ({ __u32 __tmp = (x) ; ___swab32(__tmp); })
+#endif
+#ifndef __arch__swab64
+#  define __arch__swab64(x) ({ __u64 __tmp = (x) ; ___swab64(__tmp); })
+#endif
+
+#ifndef __arch__swab16p
+#  define __arch__swab16p(x) __arch__swab16(*(x))
+#endif
+#ifndef __arch__swab32p
+#  define __arch__swab32p(x) __arch__swab32(*(x))
+#endif
+#ifndef __arch__swab64p
+#  define __arch__swab64p(x) __arch__swab64(*(x))
+#endif
+
+#ifndef __arch__swab16s
+#  define __arch__swab16s(x) do { *(x) = __arch__swab16p((x)); } while (0)
+#endif
+#ifndef __arch__swab32s
+#  define __arch__swab32s(x) do { *(x) = __arch__swab32p((x)); } while (0)
+#endif
+#ifndef __arch__swab64s
+#  define __arch__swab64s(x) do { *(x) = __arch__swab64p((x)); } while (0)
+#endif
+
+
+/*
+ * Allow constant folding
+ */
+#  define __swab16(x) \
+(__builtin_constant_p((__u16)(x)) ? \
+ ___constant_swab16((x)) : \
+ __fswab16((x)))
+#  define __swab32(x) \
+(__builtin_constant_p((__u32)(x)) ? \
+ ___constant_swab32((x)) : \
+ __fswab32((x)))
+#  define __swab64(x) \
+(__builtin_constant_p((__u64)(x)) ? \
+ ___constant_swab64((x)) : \
+ __fswab64((x)))
+
+
+static __inline__ __u16 __fswab16(__u16 x)
+{
+	return (__extension__ __arch__swab16(x));
+}
+static __inline__ __u16 __swab16p(__u16 *x)
+{
+	return (__extension__ __arch__swab16p(x));
+}
+static __inline__ void __swab16s(__u16 *addr)
+{
+	(__extension__ ({__arch__swab16s(addr);}));
+}
+
+static __inline__ __u32 __fswab32(__u32 x)
+{
+	return (__extension__ __arch__swab32(x));
+}
+static __inline__ __u32 __swab32p(__u32 *x)
+{
+	return (__extension__ __arch__swab32p(x));
+}
+static __inline__ void __swab32s(__u32 *addr)
+{
+	(__extension__ ({__arch__swab32s(addr);}));
+}
+
+static __inline__ __u64 __fswab64(__u64 x)
+{
+#  ifdef __SWAB_64_THRU_32__
+	__u32 h = x >> 32;
+	__u32 l = x & ((1ULL<<32)-1);
+	return (((__u64)__swab32(l)) << 32) | ((__u64)(__swab32(h)));
+#  else
+	return (__extension__ __arch__swab64(x));
+#  endif
+}
+static __inline__ __u64 __swab64p(__u64 *x)
+{
+	return (__extension__ __arch__swab64p(x));
+}
+static __inline__ void __swab64s(__u64 *addr)
+{
+	(__extension__ ({__arch__swab64s(addr);}));
+}
+
 #ifdef XFS_NATIVE_HOST
 #define cpu_to_be16(val)	((__force __be16)(__u16)(val))
 #define cpu_to_be32(val)	((__force __be32)(__u32)(val))
@@ -71,4 +224,42 @@ static inline void be64_add_cpu(__be64 *a, __s64 b)
 	*a = cpu_to_be64(be64_to_cpu(*a) + b);
 }
 
+static inline __uint16_t get_unaligned_be16(void *p)
+{
+	__uint8_t *__p = p;
+	return __p[0] << 8 | __p[1];
+}
+
+static inline __uint32_t get_unaligned_be32(void *p)
+{
+	__uint8_t *__p = p;
+        return __p[0] << 24 | __p[1] << 16 | __p[2] << 8 | __p[3];
+}
+
+static inline __uint64_t get_unaligned_be64(void *p)
+{
+	return (__uint64_t)get_unaligned_be32(p) << 32 |
+			   get_unaligned_be32(p + 4);
+}
+
+static inline void put_unaligned_be16(__uint16_t val, void *p)
+{
+	__uint8_t *__p = p;
+	*__p++ = val >> 8;
+	*__p++ = val;
+}
+
+static inline void put_unaligned_be32(__uint32_t val, void *p)
+{
+	__uint8_t *__p = p;
+	put_unaligned_be16(val >> 16, __p);
+	put_unaligned_be16(val, __p + 2);
+}
+
+static inline void put_unaligned_be64(__uint64_t val, void *p)
+{
+	put_unaligned_be32(val >> 32, p);
+	put_unaligned_be32(val, p + 4);
+}
+
 #endif	/* __XFS_ARCH_H__ */
diff --git a/libxfs/crc32.c b/libxfs/crc32.c
index bc1fc98..63b1467 100644
--- a/libxfs/crc32.c
+++ b/libxfs/crc32.c
@@ -34,7 +34,6 @@
  */
 
 #include "xfs/platform_defs.h"
-#include "xfs/swab.h"
 #include "xfs/xfs_arch.h"
 #include "crc32defs.h"
 
diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index 72e124b..445a6dc 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h
@@ -66,7 +66,6 @@
 #include "xfs/bitops.h"
 #include "xfs/kmem.h"
 #include "xfs/radix-tree.h"
-#include "xfs/swab.h"
 #include "xfs/atomic.h"
 
 #include "xfs/xfs_types.h"
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 04/13] xfsprogs: only install *format.h headers in install-qa
  2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
                   ` (2 preceding siblings ...)
  2015-07-03 10:12 ` [PATCH 03/13] xfsprogs: remove swab.h Christoph Hellwig
@ 2015-07-03 10:12 ` Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 05/13] xfsprogs: remove install-qa target Christoph Hellwig
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

Now that we've properly split up the headers we don't need to install all
the libxfs-internal headers for xfstests.  Just install the three headers
defining the on-disk format and xfs_arch.h which is required to compile
them instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/Makefile | 12 ++++++++----
 libxfs/Makefile  | 29 +++++++++++++++++------------
 2 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/include/Makefile b/include/Makefile
index f033245..0135860 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -18,7 +18,9 @@
 TOPDIR = ..
 include $(TOPDIR)/include/builddefs
 
-QAHFILES = libxfs.h \
+QAHFILES = xfs_arch.h
+
+LIBHFILES = libxfs.h \
 	libxlog.h \
 	atomic.h \
 	bitops.h \
@@ -28,14 +30,17 @@ QAHFILES = libxfs.h \
 	list.h \
 	parent.h \
 	radix-tree.h \
-	xfs_arch.h \
 	xfs_btree_trace.h \
 	xfs_inode.h \
 	xfs_log_recover.h \
 	xfs_metadump.h \
 	xfs_mount.h \
 	xfs_trace.h \
-	xfs_trans.h
+	xfs_trans.h \
+	command.h \
+	input.h \
+	path.h \
+	project.h
 
 HFILES = handle.h \
 	jdm.h \
@@ -46,7 +51,6 @@ HFILES = handle.h \
 
 PHFILES = darwin.h freebsd.h irix.h linux.h gnukfreebsd.h
 DKHFILES = volume.h fstyp.h dvh.h
-LIBHFILES = command.h input.h path.h project.h
 LSRCFILES = $(shell echo $(PHFILES) | sed -e "s/$(PKG_PLATFORM).h//g")
 LSRCFILES += platform_defs.h.in builddefs.in buildmacros buildrules install-sh
 LSRCFILES += $(DKHFILES) $(LIBHFILES)
diff --git a/libxfs/Makefile b/libxfs/Makefile
index c85f1ed..3d3b448 100644
--- a/libxfs/Makefile
+++ b/libxfs/Makefile
@@ -14,15 +14,14 @@ LT_AGE = 0
 PKGHFILES = xfs_fs.h \
 	xfs_types.h
 
-# headers with build dependencies
-HFILES = init.h \
-	crc32defs.h \
-	crc32table.h \
-	libxfs_priv.h \
-	xfs_dir2_priv.h \
-
 # headers installed in QA targets
-QAHFILES = xfs_alloc.h \
+QAHFILES = \
+	xfs_da_format.h \
+	xfs_format.h \
+	xfs_log_format.h
+
+LIBHFILES = \
+	xfs_alloc.h \
 	xfs_alloc_btree.h \
 	xfs_attr_leaf.h \
 	xfs_attr_sf.h \
@@ -33,14 +32,11 @@ QAHFILES = xfs_alloc.h \
 	xfs_attr_remote.h \
 	xfs_cksum.h \
 	xfs_da_btree.h \
-	xfs_da_format.h \
 	xfs_dir2.h \
-	xfs_format.h \
 	xfs_ialloc.h \
 	xfs_ialloc_btree.h \
 	xfs_inode_buf.h \
 	xfs_inode_fork.h \
-	xfs_log_format.h \
 	xfs_quota_defs.h \
 	xfs_sb.h \
 	xfs_shared.h \
@@ -49,6 +45,14 @@ QAHFILES = xfs_alloc.h \
 	libxfs_io.h \
 	libxfs_api_defs.h
 
+
+# headers with build dependencies
+HFILES = init.h \
+	crc32defs.h \
+	crc32table.h \
+	libxfs_priv.h \
+	xfs_dir2_priv.h
+
 CFILES = cache.c \
 	crc32.c \
 	init.c \
@@ -89,6 +93,7 @@ CFILES = cache.c \
 CFILES += $(PKG_PLATFORM).c
 PCFILES = darwin.c freebsd.c irix.c linux.c
 LSRCFILES = $(shell echo $(PCFILES) | sed -e "s/$(PKG_PLATFORM).c//g")
+LSRCFILES += $(LIBHFILES)
 LSRCFILES += gen_crc32table.c
 
 #
@@ -133,7 +138,7 @@ include $(BUILDRULES)
 install: default
 	$(INSTALL) -m 755 -d $(PKG_INC_DIR)
 
-install-headers: $(addsuffix -hdrs, $(PKGHFILES) $(QAHFILES))
+install-headers: $(addsuffix -hdrs, $(PKGHFILES) $(LIBHFILES) $(QAHFILES))
 
 %-hdrs:
 	$(Q)$(LN_S) -f $(PWD)/libxfs/$* $(TOPDIR)/include/xfs/$*
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 05/13] xfsprogs: remove install-qa target
  2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
                   ` (3 preceding siblings ...)
  2015-07-03 10:12 ` [PATCH 04/13] xfsprogs: only install *format.h headers in install-qa Christoph Hellwig
@ 2015-07-03 10:12 ` Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 06/13] xfsprogs: use <>-style includes in installed headers Christoph Hellwig
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

Now that we don't install all the libxfs internals but just the disk format
defintions we can install those as part of the normal install-dev target.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 Makefile           |  6 ------
 include/Makefile   | 11 +++--------
 include/buildrules |  2 +-
 libdisk/Makefile   |  2 --
 libhandle/Makefile |  2 --
 libxcmd/Makefile   |  2 +-
 libxfs/Makefile    | 10 ++--------
 libxlog/Makefile   |  2 +-
 8 files changed, 8 insertions(+), 29 deletions(-)

diff --git a/Makefile b/Makefile
index 6d6803b..111bf76 100644
--- a/Makefile
+++ b/Makefile
@@ -108,8 +108,6 @@ install: $(addsuffix -install,$(SUBDIRS))
 
 install-dev: $(addsuffix -install-dev,$(SUBDIRS))
 
-install-qa: install $(addsuffix -install-qa,$(SUBDIRS))
-
 %-install:
 	@echo "Installing $@"
 	$(Q)$(MAKE) $(MAKEOPTS) -C $* install
@@ -118,10 +116,6 @@ install-qa: install $(addsuffix -install-qa,$(SUBDIRS))
 	@echo "Installing $@"
 	$(Q)$(MAKE) $(MAKEOPTS) -C $* install-dev
 
-%-install-qa:
-	@echo "Installing $@"
-	$(Q)$(MAKE) $(MAKEOPTS) -C $* install-qa
-
 distclean: clean
 	$(Q)rm -f $(LDIRT)
 
diff --git a/include/Makefile b/include/Makefile
index 0135860..bd8b0ca 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -18,8 +18,6 @@
 TOPDIR = ..
 include $(TOPDIR)/include/builddefs
 
-QAHFILES = xfs_arch.h
-
 LIBHFILES = libxfs.h \
 	libxlog.h \
 	atomic.h \
@@ -47,7 +45,8 @@ HFILES = handle.h \
 	$(PKG_PLATFORM).h \
 	platform_defs.h \
 	xfs.h \
-	xqm.h
+	xqm.h \
+	xfs_arch.h
 
 PHFILES = darwin.h freebsd.h irix.h linux.h gnukfreebsd.h
 DKHFILES = volume.h fstyp.h dvh.h
@@ -66,7 +65,7 @@ disk:
 include $(BUILDRULES)
 
 # set up include/xfs header directory
-install-headers: $(addsuffix -hdrs, $(HFILES) $(QAHFILES) $(PHFILES) $(DKHFILES) $(LIBHFILES))
+install-headers: $(addsuffix -hdrs, $(HFILES) $(PHFILES) $(DKHFILES) $(LIBHFILES))
 
 %-hdrs: xfs
 	$(Q)$(LN_S) -f $(PWD)/include/$* xfs/$*
@@ -79,7 +78,3 @@ install: default
 
 install-dev: install
 	$(INSTALL) -m 644 $(HFILES) $(PKG_INC_DIR)
-
-install-qa: install-dev
-	$(INSTALL) -m 644 $(QAHFILES) $(PKG_INC_DIR)
-
diff --git a/include/buildrules b/include/buildrules
index 0e13f9d..72491db 100644
--- a/include/buildrules
+++ b/include/buildrules
@@ -94,7 +94,7 @@ $(_FORCE):
 # rebuild on every make invocation isn't a problem we need to care about. Just
 # do it silently so it doesn't make the build unnecessarily noisy.
 
-.PHONY : depend ltdepend install-qa
+.PHONY : depend ltdepend
 
 MAKEDEP := $(MAKEDEPEND) $(CFLAGS)
 
diff --git a/libdisk/Makefile b/libdisk/Makefile
index b058a9f..3b84a3a 100644
--- a/libdisk/Makefile
+++ b/libdisk/Makefile
@@ -32,6 +32,4 @@ install: default
 
 install-dev: default
 
-install-qa: install-dev
-
 -include .ltdep
diff --git a/libhandle/Makefile b/libhandle/Makefile
index 865ca22..cc4ad1d 100644
--- a/libhandle/Makefile
+++ b/libhandle/Makefile
@@ -25,6 +25,4 @@ install: default
 install-dev: default
 	$(INSTALL_LTLIB_DEV)
 
-install-qa: install-dev
-
 -include .ltdep
diff --git a/libxcmd/Makefile b/libxcmd/Makefile
index ce082a5..7701ed9 100644
--- a/libxcmd/Makefile
+++ b/libxcmd/Makefile
@@ -34,6 +34,6 @@ default: ltdepend $(LTLIBRARY)
 
 include $(BUILDRULES)
 
-install install-dev install-qa: default
+install install-dev: default
 
 -include .ltdep
diff --git a/libxfs/Makefile b/libxfs/Makefile
index 3d3b448..ebbe40e 100644
--- a/libxfs/Makefile
+++ b/libxfs/Makefile
@@ -12,10 +12,7 @@ LT_AGE = 0
 
 # headers to install in include/xfs
 PKGHFILES = xfs_fs.h \
-	xfs_types.h
-
-# headers installed in QA targets
-QAHFILES = \
+	xfs_types.h \
 	xfs_da_format.h \
 	xfs_format.h \
 	xfs_log_format.h
@@ -138,7 +135,7 @@ include $(BUILDRULES)
 install: default
 	$(INSTALL) -m 755 -d $(PKG_INC_DIR)
 
-install-headers: $(addsuffix -hdrs, $(PKGHFILES) $(LIBHFILES) $(QAHFILES))
+install-headers: $(addsuffix -hdrs, $(PKGHFILES) $(LIBHFILES))
 
 %-hdrs:
 	$(Q)$(LN_S) -f $(PWD)/libxfs/$* $(TOPDIR)/include/xfs/$*
@@ -146,9 +143,6 @@ install-headers: $(addsuffix -hdrs, $(PKGHFILES) $(LIBHFILES) $(QAHFILES))
 install-dev: install
 	$(INSTALL) -m 644 $(PKGHFILES) $(PKG_INC_DIR)
 
-install-qa: install-dev
-	$(INSTALL) -m 644 $(QAHFILES) $(PKG_INC_DIR)
-
 # We need to install the headers before building the dependencies.  If we
 # include the .ltdep file, the makefile decides that it needs to build the
 # dependencies to remake the makefile before running the header install target,
diff --git a/libxlog/Makefile b/libxlog/Makefile
index 4673663..3417eed 100644
--- a/libxlog/Makefile
+++ b/libxlog/Makefile
@@ -19,6 +19,6 @@ default: ltdepend $(LTLIBRARY)
 
 include $(BUILDRULES)
 
-install install-dev install-qa: default
+install install-dev: default
 
 -include .ltdep
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 06/13] xfsprogs: use <>-style includes in installed headers
  2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
                   ` (4 preceding siblings ...)
  2015-07-03 10:12 ` [PATCH 05/13] xfsprogs: remove install-qa target Christoph Hellwig
@ 2015-07-03 10:12 ` Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 07/13] xfsprogs: simplify internal includes Christoph Hellwig
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

Once installed these are system headers, so we need to use <>-style include
statements between them.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/platform_defs.h.in | 10 +++++-----
 include/xfs.h              |  6 +++---
 include/xqm.h              |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in
index 9a1782c..529c0a6 100644
--- a/include/platform_defs.h.in
+++ b/include/platform_defs.h.in
@@ -69,15 +69,15 @@ typedef __u64	__bitwise	__be64;
 typedef struct filldir		filldir_t;
 
 #if defined(__linux__)
-#include "xfs/linux.h"
+#include <xfs/linux.h>
 #elif defined(__FreeBSD__)
-#include "xfs/freebsd.h"
+#include <xfs/freebsd.h>
 #elif defined(__FreeBSD_kernel__)
-#include "xfs/gnukfreebsd.h"
+#include <xfs/gnukfreebsd.h>
 #elif defined(__APPLE__)
-#include "xfs/darwin.h"
+#include <xfs/darwin.h>
 #elif defined(__sgi__) || defined(__sgi)
-#include "xfs/irix.h"
+#include <xfs/irix.h>
 #else
 # error unknown platform... have fun porting!
 #endif
diff --git a/include/xfs.h b/include/xfs.h
index 0cb4fb8..e32c4a8 100644
--- a/include/xfs.h
+++ b/include/xfs.h
@@ -33,8 +33,8 @@
 #ifndef __XFS_H__
 #define __XFS_H__
 
-#include "xfs/platform_defs.h"
-#include "xfs/xfs_types.h"
-#include "xfs/xfs_fs.h"
+#include <xfs/platform_defs.h>
+#include <xfs/xfs_types.h>
+#include <xfs/xfs_fs.h>
 
 #endif	/* __XFS_H__ */
diff --git a/include/xqm.h b/include/xqm.h
index 0b5dfa1..47f58a0 100644
--- a/include/xqm.h
+++ b/include/xqm.h
@@ -18,7 +18,7 @@
 #ifndef __XQM_H__
 #define __XQM_H__
 
-#include "xfs/xfs.h"
+#include <xfs/xfs.h>
 
 /*
  * Disk quota - quotactl(2) commands for the XFS Quota Manager (XQM).
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 07/13] xfsprogs: simplify internal includes
  2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
                   ` (5 preceding siblings ...)
  2015-07-03 10:12 ` [PATCH 06/13] xfsprogs: use <>-style includes in installed headers Christoph Hellwig
@ 2015-07-03 10:12 ` Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 08/13] xfsprogs: move __be*/__le* types and __arch_pack to xfs_arch.h Christoph Hellwig
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

We don't need the xfs/ prefix for local includes if we just add the libxfs
directory to the include path.  Once that is done we only need to link the
installed headers into include/xfs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 copy/xfs_copy.c            |  2 +-
 db/addr.c                  |  2 +-
 db/agf.c                   |  2 +-
 db/agfl.c                  |  2 +-
 db/agi.c                   |  2 +-
 db/attr.c                  |  2 +-
 db/attrset.c               |  2 +-
 db/attrshort.c             |  2 +-
 db/bit.c                   |  2 +-
 db/block.c                 |  2 +-
 db/bmap.c                  |  2 +-
 db/bmroot.c                |  2 +-
 db/btblock.c               |  2 +-
 db/check.c                 |  2 +-
 db/command.c               |  2 +-
 db/convert.c               |  2 +-
 db/debug.c                 |  2 +-
 db/dir2.c                  |  2 +-
 db/dir2sf.c                |  2 +-
 db/dquot.c                 |  2 +-
 db/echo.c                  |  2 +-
 db/faddr.c                 |  2 +-
 db/field.c                 |  2 +-
 db/flist.c                 |  2 +-
 db/fprint.c                |  2 +-
 db/frag.c                  |  2 +-
 db/freesp.c                |  2 +-
 db/hash.c                  |  2 +-
 db/help.c                  |  2 +-
 db/init.c                  |  2 +-
 db/inode.c                 |  2 +-
 db/input.c                 |  2 +-
 db/io.c                    |  2 +-
 db/malloc.c                |  2 +-
 db/metadump.c              |  4 +--
 db/output.c                |  2 +-
 db/print.c                 |  2 +-
 db/quit.c                  |  2 +-
 db/sb.c                    |  4 +--
 db/sig.c                   |  2 +-
 db/strvec.c                |  2 +-
 db/symlink.c               |  2 +-
 db/text.c                  |  2 +-
 db/type.c                  |  2 +-
 db/write.c                 |  2 +-
 estimate/xfs_estimate.c    |  2 +-
 fsr/xfs_fsr.c              | 12 +++----
 growfs/xfs_growfs.c        |  4 +--
 include/Makefile           |  2 +-
 include/builddefs.in       |  2 +-
 include/input.h            |  2 +-
 include/libxfs.h           | 86 +++++++++++++++++++++++-----------------------
 include/libxlog.h          |  2 +-
 include/path.h             |  2 +-
 include/project.h          |  2 +-
 include/xfs_inode.h        |  4 +--
 io/attr.c                  |  6 ++--
 io/bmap.c                  |  4 +--
 io/fadvise.c               |  6 ++--
 io/fiemap.c                |  4 +--
 io/file.c                  |  6 ++--
 io/freeze.c                |  6 ++--
 io/fsync.c                 |  4 +--
 io/getrusage.c             |  6 ++--
 io/imap.c                  |  6 ++--
 io/init.c                  |  6 ++--
 io/inject.c                |  6 ++--
 io/link.c                  |  6 ++--
 io/madvise.c               |  6 ++--
 io/mincore.c               |  6 ++--
 io/mmap.c                  |  6 ++--
 io/open.c                  |  6 ++--
 io/parent.c                | 14 ++++----
 io/pread.c                 |  6 ++--
 io/prealloc.c              |  6 ++--
 io/pwrite.c                |  6 ++--
 io/readdir.c               |  6 ++--
 io/resblks.c               |  6 ++--
 io/seek.c                  |  6 ++--
 io/sendfile.c              |  6 ++--
 io/shutdown.c              |  6 ++--
 io/sync.c                  |  4 +--
 io/sync_file_range.c       |  6 ++--
 io/truncate.c              |  6 ++--
 libdisk/drivers.h          |  2 +-
 libhandle/handle.c         |  6 ++--
 libhandle/jdm.c            |  8 ++---
 libxcmd/command.c          |  6 ++--
 libxcmd/help.c             |  4 +--
 libxcmd/input.c            |  4 +--
 libxcmd/paths.c            |  6 ++--
 libxcmd/projects.c         |  2 +-
 libxcmd/quit.c             |  4 +--
 libxfs/Makefile            | 12 +++----
 libxfs/crc32.c             |  4 +--
 libxfs/darwin.c            |  2 +-
 libxfs/freebsd.c           |  2 +-
 libxfs/init.c              |  2 +-
 libxfs/irix.c              |  2 +-
 libxfs/libxfs_priv.h       | 24 ++++++-------
 libxfs/radix-tree.c        |  2 +-
 libxfs/rdwr.c              |  2 +-
 libxlog/util.c             |  4 +--
 libxlog/xfs_log_recover.c  |  4 +--
 logprint/log_copy.c        |  4 +--
 logprint/log_dump.c        |  4 +--
 logprint/log_misc.c        |  4 +--
 logprint/log_print_all.c   |  4 +--
 logprint/log_print_trans.c |  4 +--
 logprint/logprint.c        |  4 +--
 mdrestore/xfs_mdrestore.c  |  2 +-
 mkfs/fstyp.c               |  2 +-
 mkfs/maxtrres.c            |  2 +-
 mkfs/proto.c               |  2 +-
 mkfs/xfs_mkfs.c            |  2 +-
 quota/edit.c               |  4 +--
 quota/free.c               |  2 +-
 quota/init.c               |  6 ++--
 quota/path.c               |  4 +--
 quota/project.c            |  4 +--
 quota/quot.c               |  2 +-
 quota/quota.c              |  2 +-
 quota/quota.h              |  6 ++--
 quota/report.c             |  2 +-
 quota/state.c              |  2 +-
 repair/agheader.c          |  2 +-
 repair/attr_repair.c       |  2 +-
 repair/avl.c               |  2 +-
 repair/avl64.c             |  2 +-
 repair/bmap.c              |  2 +-
 repair/btree.c             |  2 +-
 repair/dino_chunks.c       |  2 +-
 repair/dinode.c            |  2 +-
 repair/dir2.c              |  2 +-
 repair/globals.c           |  2 +-
 repair/incore.c            |  2 +-
 repair/incore_bmc.c        |  2 +-
 repair/incore_ext.c        |  2 +-
 repair/incore_ino.c        |  2 +-
 repair/init.c              |  2 +-
 repair/phase1.c            |  2 +-
 repair/phase2.c            |  4 +--
 repair/phase3.c            |  2 +-
 repair/phase4.c            |  2 +-
 repair/phase5.c            |  2 +-
 repair/phase6.c            |  2 +-
 repair/phase7.c            |  2 +-
 repair/prefetch.c          |  2 +-
 repair/progress.c          |  2 +-
 repair/rt.c                |  2 +-
 repair/sb.c                |  4 +--
 repair/scan.c              |  2 +-
 repair/threads.c           |  2 +-
 repair/versions.c          |  2 +-
 repair/xfs_repair.c        |  4 +--
 rtcp/xfs_rtcp.c            |  2 +-
 156 files changed, 308 insertions(+), 312 deletions(-)

diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index 44a32e8..4a5a8a6 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <pthread.h>
diff --git a/db/addr.c b/db/addr.c
index a3ac5d6..e835dbb 100644
--- a/db/addr.c
+++ b/db/addr.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "addr.h"
 #include "command.h"
 #include "type.h"
diff --git a/db/agf.c b/db/agf.c
index e144bd6..e10526d 100644
--- a/db/agf.c
+++ b/db/agf.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "type.h"
 #include "faddr.h"
diff --git a/db/agfl.c b/db/agfl.c
index b821b13..472873e 100644
--- a/db/agfl.c
+++ b/db/agfl.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "type.h"
 #include "faddr.h"
diff --git a/db/agi.c b/db/agi.c
index 634429e..285a3c5 100644
--- a/db/agi.c
+++ b/db/agi.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "type.h"
 #include "faddr.h"
diff --git a/db/attr.c b/db/attr.c
index e14e32e..897834b 100644
--- a/db/attr.c
+++ b/db/attr.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "bit.h"
 #include "type.h"
 #include "faddr.h"
diff --git a/db/attrset.c b/db/attrset.c
index 1afadd2..ec9da5a 100644
--- a/db/attrset.c
+++ b/db/attrset.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "attrset.h"
 #include "io.h"
diff --git a/db/attrshort.c b/db/attrshort.c
index 7dc5640..d82559c 100644
--- a/db/attrshort.c
+++ b/db/attrshort.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "type.h"
 #include "faddr.h"
 #include "fprint.h"
diff --git a/db/bit.c b/db/bit.c
index b85ed6a..24872bf 100644
--- a/db/bit.c
+++ b/db/bit.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "bit.h"
 
 #undef setbit	/* defined in param.h on Linux */
diff --git a/db/block.c b/db/block.c
index 9319cce..4a357ce 100644
--- a/db/block.c
+++ b/db/block.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "block.h"
 #include "bmap.h"
 #include "command.h"
diff --git a/db/bmap.c b/db/bmap.c
index 60d6a80..92057b4 100644
--- a/db/bmap.c
+++ b/db/bmap.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "type.h"
 #include "fprint.h"
diff --git a/db/bmroot.c b/db/bmroot.c
index 95be2dd..0950e19 100644
--- a/db/bmroot.c
+++ b/db/bmroot.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "type.h"
 #include "faddr.h"
 #include "fprint.h"
diff --git a/db/btblock.c b/db/btblock.c
index 1953e05..46140fc 100644
--- a/db/btblock.c
+++ b/db/btblock.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "type.h"
 #include "faddr.h"
 #include "fprint.h"
diff --git a/db/check.c b/db/check.c
index c109f20..afeea32 100644
--- a/db/check.c
+++ b/db/check.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <math.h>
 #include <sys/time.h>
 #include "bmap.h"
diff --git a/db/command.c b/db/command.c
index eb1efb6..2189e00 100644
--- a/db/command.c
+++ b/db/command.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "addr.h"
 #include "attrset.h"
 #include "block.h"
diff --git a/db/convert.c b/db/convert.c
index d2bf1a9..09f9225 100644
--- a/db/convert.c
+++ b/db/convert.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "convert.h"
 #include "output.h"
diff --git a/db/debug.c b/db/debug.c
index 13a319f..2875858 100644
--- a/db/debug.c
+++ b/db/debug.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "debug.h"
 #include "output.h"
diff --git a/db/dir2.c b/db/dir2.c
index 75aaed5..7f69e6f 100644
--- a/db/dir2.c
+++ b/db/dir2.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "bit.h"
 #include "type.h"
 #include "faddr.h"
diff --git a/db/dir2sf.c b/db/dir2sf.c
index 831d6f2..a56590b 100644
--- a/db/dir2sf.c
+++ b/db/dir2sf.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "type.h"
 #include "faddr.h"
 #include "fprint.h"
diff --git a/db/dquot.c b/db/dquot.c
index 6118256..3adde3b 100644
--- a/db/dquot.c
+++ b/db/dquot.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "bit.h"
 #include "bmap.h"
 #include "command.h"
diff --git a/db/echo.c b/db/echo.c
index f2b7ab8..9a8ae72 100644
--- a/db/echo.c
+++ b/db/echo.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "echo.h"
 #include "output.h"
diff --git a/db/faddr.c b/db/faddr.c
index 17451c2..e368d0d 100644
--- a/db/faddr.c
+++ b/db/faddr.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "type.h"
 #include "fprint.h"
 #include "faddr.h"
diff --git a/db/field.c b/db/field.c
index f68809a..843c385 100644
--- a/db/field.c
+++ b/db/field.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "type.h"
 #include "faddr.h"
 #include "fprint.h"
diff --git a/db/flist.c b/db/flist.c
index 848478e..84065a2 100644
--- a/db/flist.c
+++ b/db/flist.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "type.h"
 #include "faddr.h"
 #include "fprint.h"
diff --git a/db/fprint.c b/db/fprint.c
index f36cdc8..f2b3794 100644
--- a/db/fprint.c
+++ b/db/fprint.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <ctype.h>
 #include <time.h>
 #include "type.h"
diff --git a/db/frag.c b/db/frag.c
index 309db7f..1cc922e 100644
--- a/db/frag.c
+++ b/db/frag.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <sys/time.h>
 #include "bmap.h"
 #include "command.h"
diff --git a/db/freesp.c b/db/freesp.c
index b0fc95e..27e9f5a 100644
--- a/db/freesp.c
+++ b/db/freesp.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "freesp.h"
 #include "io.h"
diff --git a/db/hash.c b/db/hash.c
index e02857f..c535fc9 100644
--- a/db/hash.c
+++ b/db/hash.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "addr.h"
 #include "command.h"
 #include "type.h"
diff --git a/db/help.c b/db/help.c
index d6a56b0..59a7ba6 100644
--- a/db/help.c
+++ b/db/help.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "help.h"
 #include "output.h"
diff --git a/db/init.c b/db/init.c
index 8efd883..9537a38 100644
--- a/db/init.c
+++ b/db/init.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <signal.h>
 #include "command.h"
 #include "init.h"
diff --git a/db/inode.c b/db/inode.c
index e4d80ae..e86dabd 100644
--- a/db/inode.c
+++ b/db/inode.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "type.h"
 #include "faddr.h"
diff --git a/db/input.c b/db/input.c
index ec1b986..a90de6c 100644
--- a/db/input.c
+++ b/db/input.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <signal.h>
 #include "command.h"
 #include "input.h"
diff --git a/db/io.c b/db/io.c
index 0f360a8..9fa52b8 100644
--- a/db/io.c
+++ b/db/io.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "type.h"
 #include "faddr.h"
diff --git a/db/malloc.c b/db/malloc.c
index 00cbfe1..9037bc1 100644
--- a/db/malloc.c
+++ b/db/malloc.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "init.h"
 #include "malloc.h"
 #include "output.h"
diff --git a/db/metadump.c b/db/metadump.c
index f606e35..08899da 100644
--- a/db/metadump.c
+++ b/db/metadump.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
-#include "xfs/libxlog.h"
+#include "libxfs.h"
+#include "libxlog.h"
 #include "bmap.h"
 #include "command.h"
 #include "metadump.h"
diff --git a/db/output.c b/db/output.c
index 8f6e9cd..14f7c4a 100644
--- a/db/output.c
+++ b/db/output.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <stdarg.h>
 #include "command.h"
 #include "output.h"
diff --git a/db/print.c b/db/print.c
index 9f08b9f..3ff2548 100644
--- a/db/print.c
+++ b/db/print.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "type.h"
 #include "faddr.h"
diff --git a/db/quit.c b/db/quit.c
index 7d352a6..1103a7a 100644
--- a/db/quit.c
+++ b/db/quit.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "command.h"
 #include "quit.h"
 
diff --git a/db/sb.c b/db/sb.c
index 2b78136..1a28cf2 100644
--- a/db/sb.c
+++ b/db/sb.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
-#include "xfs/libxlog.h"
+#include "libxfs.h"
+#include "libxlog.h"
 #include "command.h"
 #include "type.h"
 #include "faddr.h"
diff --git a/db/sig.c b/db/sig.c
index 025c603..031567e 100644
--- a/db/sig.c
+++ b/db/sig.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <signal.h>
 #include "sig.h"
 
diff --git a/db/strvec.c b/db/strvec.c
index 3fa10be..dd83448 100644
--- a/db/strvec.c
+++ b/db/strvec.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "strvec.h"
 #include "output.h"
 #include "malloc.h"
diff --git a/db/symlink.c b/db/symlink.c
index 01719a7..ce96556 100644
--- a/db/symlink.c
+++ b/db/symlink.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "type.h"
 #include "faddr.h"
 #include "fprint.h"
diff --git a/db/text.c b/db/text.c
index a0d4c89..f6c623c 100644
--- a/db/text.c
+++ b/db/text.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <ctype.h>
 #include "block.h"
 #include "bmap.h"
diff --git a/db/type.c b/db/type.c
index b150b53..37e0882 100644
--- a/db/type.c
+++ b/db/type.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "block.h"
 #include "command.h"
 #include "type.h"
diff --git a/db/write.c b/db/write.c
index 6a33dba..9f5b423 100644
--- a/db/write.c
+++ b/db/write.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <ctype.h>
 #include <time.h>
 #include "bit.h"
diff --git a/estimate/xfs_estimate.c b/estimate/xfs_estimate.c
index 636691b..65b7168 100644
--- a/estimate/xfs_estimate.c
+++ b/estimate/xfs_estimate.c
@@ -21,7 +21,7 @@
  *
  * XXX: assumes dirv1 format.
  */
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <sys/stat.h>
 #include <ftw.h>
 
diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index efc17a8..7c1d776 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -16,12 +16,12 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
-#include "xfs/xfs.h"
-#include "xfs/xfs_types.h"
-#include "xfs/jdm.h"
-#include "xfs/xfs_bmap_btree.h"
-#include "xfs/xfs_attr_sf.h"
+#include "libxfs.h"
+#include "xfs.h"
+#include "xfs_types.h"
+#include "jdm.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_attr_sf.h"
 
 #include <fcntl.h>
 #include <errno.h>
diff --git a/growfs/xfs_growfs.c b/growfs/xfs_growfs.c
index 309b915..56315f9 100644
--- a/growfs/xfs_growfs.c
+++ b/growfs/xfs_growfs.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
-#include "xfs/path.h"
+#include "libxfs.h"
+#include "path.h"
 
 static void
 usage(void)
diff --git a/include/Makefile b/include/Makefile
index bd8b0ca..778317e 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -65,7 +65,7 @@ disk:
 include $(BUILDRULES)
 
 # set up include/xfs header directory
-install-headers: $(addsuffix -hdrs, $(HFILES) $(PHFILES) $(DKHFILES) $(LIBHFILES))
+install-headers: $(addsuffix -hdrs, $(PHFILES) $(DKHFILES) $(HFILES))
 
 %-hdrs: xfs
 	$(Q)$(LN_S) -f $(PWD)/include/$* xfs/$*
diff --git a/include/builddefs.in b/include/builddefs.in
index 7e9f53d..6ee95b7 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -134,7 +134,7 @@ endif
 
 GCFLAGS = $(OPTIMIZER) $(DEBUG) \
 	  -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\"  \
-	  -DPACKAGE=\"$(PKG_NAME)\" -I$(TOPDIR)/include
+	  -DPACKAGE=\"$(PKG_NAME)\" -I$(TOPDIR)/include -I$(TOPDIR)/libxfs
 
 ifeq ($(ENABLE_GETTEXT),yes)
 GCFLAGS += -DENABLE_GETTEXT
diff --git a/include/input.h b/include/input.h
index ae273ad..d02170f 100644
--- a/include/input.h
+++ b/include/input.h
@@ -21,7 +21,7 @@
 #include <pwd.h>
 #include <grp.h>
 #include <sys/types.h>
-#include "xfs/project.h"
+#include "project.h"
 #include <stdbool.h>
 
 extern char	**breakline(char *input, int *count);
diff --git a/include/libxfs.h b/include/libxfs.h
index eda664f..1fb2d6d 100644
--- a/include/libxfs.h
+++ b/include/libxfs.h
@@ -19,26 +19,26 @@
 #ifndef __LIBXFS_H__
 #define __LIBXFS_H__
 
-#include "xfs/libxfs_api_defs.h"
-#include "xfs/platform_defs.h"
+#include "libxfs_api_defs.h"
+#include "platform_defs.h"
 
-#include "xfs/list.h"
-#include "xfs/hlist.h"
-#include "xfs/cache.h"
-#include "xfs/bitops.h"
-#include "xfs/kmem.h"
-#include "xfs/radix-tree.h"
-#include "xfs/atomic.h"
+#include "list.h"
+#include "hlist.h"
+#include "cache.h"
+#include "bitops.h"
+#include "kmem.h"
+#include "radix-tree.h"
+#include "atomic.h"
 
-#include "xfs/xfs_types.h"
-#include "xfs/xfs_fs.h"
-#include "xfs/xfs_arch.h"
+#include "xfs_types.h"
+#include "xfs_fs.h"
+#include "xfs_arch.h"
 
-#include "xfs/xfs_shared.h"
-#include "xfs/xfs_format.h"
-#include "xfs/xfs_log_format.h"
-#include "xfs/xfs_quota_defs.h"
-#include "xfs/xfs_trans_resv.h"
+#include "xfs_shared.h"
+#include "xfs_format.h"
+#include "xfs_log_format.h"
+#include "xfs_quota_defs.h"
+#include "xfs_trans_resv.h"
 
 
 /* CRC stuff, buffer API dependent on it */
@@ -48,33 +48,33 @@ extern uint32_t crc32c_le(uint32_t crc, unsigned char const *p, size_t len);
 #define crc32(c,p,l)	crc32_le((c),(unsigned char const *)(p),(l))
 #define crc32c(c,p,l)	crc32c_le((c),(unsigned char const *)(p),(l))
 
-#include "xfs/xfs_cksum.h"
+#include "xfs_cksum.h"
 
 /*
  * This mirrors the kernel include for xfs_buf.h - it's implicitly included in
  * every files via a similar include in the kernel xfs_linux.h.
  */
-#include "xfs/libxfs_io.h"
-
-#include "xfs/xfs_bit.h"
-#include "xfs/xfs_sb.h"
-#include "xfs/xfs_mount.h"
-#include "xfs/xfs_da_format.h"
-#include "xfs/xfs_da_btree.h"
-#include "xfs/xfs_dir2.h"
-#include "xfs/xfs_bmap_btree.h"
-#include "xfs/xfs_alloc_btree.h"
-#include "xfs/xfs_ialloc_btree.h"
-#include "xfs/xfs_attr_sf.h"
-#include "xfs/xfs_inode_fork.h"
-#include "xfs/xfs_inode_buf.h"
-#include "xfs/xfs_inode.h"
-#include "xfs/xfs_alloc.h"
-#include "xfs/xfs_btree.h"
-#include "xfs/xfs_btree_trace.h"
-#include "xfs/xfs_bmap.h"
-#include "xfs/xfs_trace.h"
-#include "xfs/xfs_trans.h"
+#include "libxfs_io.h"
+
+#include "xfs_bit.h"
+#include "xfs_sb.h"
+#include "xfs_mount.h"
+#include "xfs_da_format.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir2.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_inode_fork.h"
+#include "xfs_inode_buf.h"
+#include "xfs_inode.h"
+#include "xfs_alloc.h"
+#include "xfs_btree.h"
+#include "xfs_btree_trace.h"
+#include "xfs_bmap.h"
+#include "xfs_trace.h"
+#include "xfs_trans.h"
 
 #ifndef ARRAY_SIZE
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
@@ -173,11 +173,11 @@ enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC };
 extern int		libxfs_nproc(void);
 extern unsigned long	libxfs_physmem(void);	/* in kilobytes */
 
-#include "xfs/xfs_ialloc.h"
+#include "xfs_ialloc.h"
 
-#include "xfs/xfs_attr_leaf.h"
-#include "xfs/xfs_attr_remote.h"
-#include "xfs/xfs_trans_space.h"
+#include "xfs_attr_leaf.h"
+#include "xfs_attr_remote.h"
+#include "xfs_trans_space.h"
 
 #define XFS_INOBT_IS_FREE_DISK(rp,i)		\
 			((be64_to_cpu((rp)->ir_free) & XFS_INOBT_MASK(i)) != 0)
diff --git a/include/libxlog.h b/include/libxlog.h
index 0c55a86..05b16e8 100644
--- a/include/libxlog.h
+++ b/include/libxlog.h
@@ -44,7 +44,7 @@ struct xlog {
 	int		l_sectBBsize;   /* size of log sector in 512 byte chunks */
 };
 
-#include "xfs/xfs_log_recover.h"
+#include "xfs_log_recover.h"
 
 /*
  * macros mapping kernel code to user code
diff --git a/include/path.h b/include/path.h
index c8746cb..58955ef 100644
--- a/include/path.h
+++ b/include/path.h
@@ -18,7 +18,7 @@
 #ifndef __PATH_H__
 #define __PATH_H__
 
-#include "xfs/xfs.h"
+#include "xfs.h"
 
 /*
  * XFS Filesystem Paths
diff --git a/include/project.h b/include/project.h
index a458a61..63bdffd 100644
--- a/include/project.h
+++ b/include/project.h
@@ -18,7 +18,7 @@
 #ifndef __PROJECT_H__
 #define __PROJECT_H__
 
-#include "xfs/xfs.h"
+#include "xfs.h"
 
 extern int setprojid(const char *__name, int __fd, prid_t __id);
 extern int getprojid(const char *__name, int __fd, prid_t *__id);
diff --git a/include/xfs_inode.h b/include/xfs_inode.h
index 303efe0..71c0fb4 100644
--- a/include/xfs_inode.h
+++ b/include/xfs_inode.h
@@ -20,8 +20,8 @@
 #define __XFS_INODE_H__
 
 /* These match kernel side includes */
-#include "xfs/xfs_inode_buf.h"
-#include "xfs/xfs_inode_fork.h"
+#include "xfs_inode_buf.h"
+#include "xfs_inode_fork.h"
 
 struct xfs_trans;
 struct xfs_mount;
diff --git a/io/attr.c b/io/attr.c
index dfae36e..bc1ab56 100644
--- a/io/attr.c
+++ b/io/attr.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/bmap.c b/io/bmap.c
index d96f7d4..432ddb7 100644
--- a/io/bmap.c
+++ b/io/bmap.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
+#include "xfs.h"
+#include "command.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/fadvise.c b/io/fadvise.c
index 3b76ab9..fa586d3 100644
--- a/io/fadvise.c
+++ b/io/fadvise.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/fiemap.c b/io/fiemap.c
index 363d1d9..8482c99 100644
--- a/io/fiemap.c
+++ b/io/fiemap.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
+#include "xfs.h"
+#include "command.h"
 #include <linux/fiemap.h>
 #include <linux/fs.h>
 #include "init.h"
diff --git a/io/file.c b/io/file.c
index 0eadcab..91dd38e 100644
--- a/io/file.c
+++ b/io/file.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include <sys/mman.h>
 #include "init.h"
 #include "io.h"
diff --git a/io/freeze.c b/io/freeze.c
index a12ed67..90f5b66 100644
--- a/io/freeze.c
+++ b/io/freeze.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/fsync.c b/io/fsync.c
index d9c45f1..6c93dff 100644
--- a/io/fsync.c
+++ b/io/fsync.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
+#include "xfs.h"
+#include "command.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/getrusage.c b/io/getrusage.c
index 35dc4bf..28b8453 100644
--- a/io/getrusage.c
+++ b/io/getrusage.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include <sys/time.h>
 #include <sys/resource.h>
 #include "init.h"
diff --git a/io/imap.c b/io/imap.c
index a615467..7c24bcd 100644
--- a/io/imap.c
+++ b/io/imap.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/init.c b/io/init.c
index 78a49b6..70214f9 100644
--- a/io/init.c
+++ b/io/init.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/inject.c b/io/inject.c
index f0aaf97..23eb4a2 100644
--- a/io/inject.c
+++ b/io/inject.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/link.c b/io/link.c
index 092e0d4..7fb81e1 100644
--- a/io/link.c
+++ b/io/link.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/madvise.c b/io/madvise.c
index 4f3f91b..b30d28b 100644
--- a/io/madvise.c
+++ b/io/madvise.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include <sys/mman.h>
 #include "init.h"
 #include "io.h"
diff --git a/io/mincore.c b/io/mincore.c
index 234e0a1..670d4c8 100644
--- a/io/mincore.c
+++ b/io/mincore.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include <sys/mman.h>
 #include "init.h"
 #include "io.h"
diff --git a/io/mmap.c b/io/mmap.c
index 06f678f..33747c1 100644
--- a/io/mmap.c
+++ b/io/mmap.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include <sys/mman.h>
 #include <signal.h>
 #include "init.h"
diff --git a/io/open.c b/io/open.c
index 795adeb..33d9f8d 100644
--- a/io/open.c
+++ b/io/open.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/parent.c b/io/parent.c
index e883f65..a374b3e 100644
--- a/io/parent.c
+++ b/io/parent.c
@@ -16,13 +16,13 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
-#include "xfs/path.h"
-#include "xfs/parent.h"
-#include "xfs/handle.h"
-#include "xfs/jdm.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
+#include "path.h"
+#include "parent.h"
+#include "handle.h"
+#include "jdm.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/pread.c b/io/pread.c
index 280cc9d..9205e34 100644
--- a/io/pread.c
+++ b/io/pread.c
@@ -17,9 +17,9 @@
  */
 
 #include <sys/uio.h>
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include <ctype.h>
 #include "init.h"
 #include "io.h"
diff --git a/io/prealloc.c b/io/prealloc.c
index e458a92..b60d2dc 100644
--- a/io/prealloc.c
+++ b/io/prealloc.c
@@ -19,9 +19,9 @@
 #if defined(HAVE_FALLOCATE)
 #include <linux/falloc.h>
 #endif
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/pwrite.c b/io/pwrite.c
index 69f67af..c9d2b1a 100644
--- a/io/pwrite.c
+++ b/io/pwrite.c
@@ -17,9 +17,9 @@
  */
 
 #include <sys/uio.h>
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/readdir.c b/io/readdir.c
index 20b8898..f8b2755 100644
--- a/io/readdir.c
+++ b/io/readdir.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/resblks.c b/io/resblks.c
index 197f7e8..df032d5 100644
--- a/io/resblks.c
+++ b/io/resblks.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/seek.c b/io/seek.c
index 9b281d5..39dab61 100644
--- a/io/seek.c
+++ b/io/seek.c
@@ -16,9 +16,9 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include <sys/types.h>
 #include <unistd.h>
 #include "init.h"
diff --git a/io/sendfile.c b/io/sendfile.c
index 22a5a4f..744b618 100644
--- a/io/sendfile.c
+++ b/io/sendfile.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include <sys/sendfile.h>
 #include "init.h"
 #include "io.h"
diff --git a/io/shutdown.c b/io/shutdown.c
index 2c86cf9..b75278a 100644
--- a/io/shutdown.c
+++ b/io/shutdown.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/sync.c b/io/sync.c
index c7bbbf1..0e7b82d 100644
--- a/io/sync.c
+++ b/io/sync.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
+#include "xfs.h"
+#include "command.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/sync_file_range.c b/io/sync_file_range.c
index 6366331..8e66773 100644
--- a/io/sync_file_range.c
+++ b/io/sync_file_range.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/io/truncate.c b/io/truncate.c
index 401d2a5..5b2ac01 100644
--- a/io/truncate.c
+++ b/io/truncate.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "io.h"
 
diff --git a/libdisk/drivers.h b/libdisk/drivers.h
index 22ac1ea..4d10568 100644
--- a/libdisk/drivers.h
+++ b/libdisk/drivers.h
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <sys/stat.h>
 #include <volume.h>
 
diff --git a/libhandle/handle.c b/libhandle/handle.c
index 54e6f71..7313e3b 100644
--- a/libhandle/handle.c
+++ b/libhandle/handle.c
@@ -17,9 +17,9 @@
  */
 
 #include <libgen.h>
-#include "xfs/xfs.h"
-#include "xfs/handle.h"
-#include "xfs/parent.h"
+#include "xfs.h"
+#include "handle.h"
+#include "parent.h"
 
 /* just pick a value we know is more than big enough */
 #define	MAXHANSIZ	64
diff --git a/libhandle/jdm.c b/libhandle/jdm.c
index 2f2f3fd..13196d1 100644
--- a/libhandle/jdm.c
+++ b/libhandle/jdm.c
@@ -16,10 +16,10 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/handle.h"
-#include "xfs/jdm.h"
-#include "xfs/parent.h"
+#include "xfs.h"
+#include "handle.h"
+#include "jdm.h"
+#include "parent.h"
 
 /* internal fshandle - typecast to a void for external use */
 #define FSHANDLE_SZ		8
diff --git a/libxcmd/command.c b/libxcmd/command.c
index 148e58b..5d0649b 100644
--- a/libxcmd/command.c
+++ b/libxcmd/command.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "command.h"
+#include "input.h"
 
 cmdinfo_t	*cmdtab;
 int		ncmds;
diff --git a/libxcmd/help.c b/libxcmd/help.c
index bcd5641..023b830 100644
--- a/libxcmd/help.c
+++ b/libxcmd/help.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
+#include "xfs.h"
+#include "command.h"
 
 static cmdinfo_t help_cmd;
 static void help_onecmd(const char *cmd, const cmdinfo_t *ct);
diff --git a/libxcmd/input.c b/libxcmd/input.c
index 83aeeb5..966a7ff 100644
--- a/libxcmd/input.c
+++ b/libxcmd/input.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/input.h"
+#include "xfs.h"
+#include "input.h"
 #include <ctype.h>
 #include <stdbool.h>
 
diff --git a/libxcmd/paths.c b/libxcmd/paths.c
index c0b1ddb..c56b06b 100644
--- a/libxcmd/paths.c
+++ b/libxcmd/paths.c
@@ -24,9 +24,9 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include "xfs/path.h"
-#include "xfs/input.h"
-#include "xfs/project.h"
+#include "path.h"
+#include "input.h"
+#include "project.h"
 #include <limits.h>
 
 extern char *progname;
diff --git a/libxcmd/projects.c b/libxcmd/projects.c
index b00e4c8..24ef70a 100644
--- a/libxcmd/projects.c
+++ b/libxcmd/projects.c
@@ -19,7 +19,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "xfs/project.h"
+#include "project.h"
 
 #define PROJID		"/etc/projid"
 #define PROJECT_PATHS	"/etc/projects"
diff --git a/libxcmd/quit.c b/libxcmd/quit.c
index 0921bbb..0a2dd40 100644
--- a/libxcmd/quit.c
+++ b/libxcmd/quit.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xfs.h"
-#include "xfs/command.h"
+#include "xfs.h"
+#include "command.h"
 
 static cmdinfo_t quit_cmd;
 
diff --git a/libxfs/Makefile b/libxfs/Makefile
index ebbe40e..95de27e 100644
--- a/libxfs/Makefile
+++ b/libxfs/Makefile
@@ -17,7 +17,7 @@ PKGHFILES = xfs_fs.h \
 	xfs_format.h \
 	xfs_log_format.h
 
-LIBHFILES = \
+HFILES = \
 	xfs_alloc.h \
 	xfs_alloc_btree.h \
 	xfs_attr_leaf.h \
@@ -40,11 +40,8 @@ LIBHFILES = \
 	xfs_trans_resv.h \
 	xfs_trans_space.h \
 	libxfs_io.h \
-	libxfs_api_defs.h
-
-
-# headers with build dependencies
-HFILES = init.h \
+	libxfs_api_defs.h \
+	init.h \
 	crc32defs.h \
 	crc32table.h \
 	libxfs_priv.h \
@@ -90,7 +87,6 @@ CFILES = cache.c \
 CFILES += $(PKG_PLATFORM).c
 PCFILES = darwin.c freebsd.c irix.c linux.c
 LSRCFILES = $(shell echo $(PCFILES) | sed -e "s/$(PKG_PLATFORM).c//g")
-LSRCFILES += $(LIBHFILES)
 LSRCFILES += gen_crc32table.c
 
 #
@@ -135,7 +131,7 @@ include $(BUILDRULES)
 install: default
 	$(INSTALL) -m 755 -d $(PKG_INC_DIR)
 
-install-headers: $(addsuffix -hdrs, $(PKGHFILES) $(LIBHFILES))
+install-headers: $(addsuffix -hdrs, $(PKGHFILES))
 
 %-hdrs:
 	$(Q)$(LN_S) -f $(PWD)/libxfs/$* $(TOPDIR)/include/xfs/$*
diff --git a/libxfs/crc32.c b/libxfs/crc32.c
index 63b1467..b2c7ec0 100644
--- a/libxfs/crc32.c
+++ b/libxfs/crc32.c
@@ -33,8 +33,8 @@
  * match the hardware acceleration available on Intel CPUs.
  */
 
-#include "xfs/platform_defs.h"
-#include "xfs/xfs_arch.h"
+#include "platform_defs.h"
+#include "xfs_arch.h"
 #include "crc32defs.h"
 
 /* types specifc to this file */
diff --git a/libxfs/darwin.c b/libxfs/darwin.c
index f4a3898..b9c314f 100644
--- a/libxfs/darwin.c
+++ b/libxfs/darwin.c
@@ -21,7 +21,7 @@
 #include <sys/mount.h>
 #include <sys/ioctl.h>
 #include <sys/sysctl.h>
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 
 int platform_has_uuid = 1;
 extern char *progname;
diff --git a/libxfs/freebsd.c b/libxfs/freebsd.c
index ec131db..6c9f089 100644
--- a/libxfs/freebsd.c
+++ b/libxfs/freebsd.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <sys/stat.h>
 #include <sys/disk.h>
 #include <sys/mount.h>
diff --git a/libxfs/init.c b/libxfs/init.c
index d287c1d..2859f94 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -31,7 +31,7 @@
 #include "xfs_inode.h"
 #include "xfs_trans.h"
 
-#include "xfs/libxfs.h"		/* for now */
+#include "libxfs.h"		/* for now */
 
 char *progname = "libxfs";	/* default, changed by each tool */
 
diff --git a/libxfs/irix.c b/libxfs/irix.c
index 69e6d81..65aaa7e 100644
--- a/libxfs/irix.c
+++ b/libxfs/irix.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <diskinfo.h>
 #include <sys/sysmp.h>
 
diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index 445a6dc..7a29fd7 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h
@@ -58,20 +58,20 @@
 				 (ip)->d_ops, hdr, loghead)
 
 #include "libxfs_api_defs.h"
-#include "xfs/platform_defs.h"
+#include "platform_defs.h"
 
-#include "xfs/list.h"
-#include "xfs/hlist.h"
-#include "xfs/cache.h"
-#include "xfs/bitops.h"
-#include "xfs/kmem.h"
-#include "xfs/radix-tree.h"
-#include "xfs/atomic.h"
+#include "list.h"
+#include "hlist.h"
+#include "cache.h"
+#include "bitops.h"
+#include "kmem.h"
+#include "radix-tree.h"
+#include "atomic.h"
 
-#include "xfs/xfs_types.h"
-#include "xfs/xfs_arch.h"
+#include "xfs_types.h"
+#include "xfs_arch.h"
 
-#include "xfs/xfs_fs.h"
+#include "xfs_fs.h"
 
 /* CRC stuff, buffer API dependent on it */
 extern uint32_t crc32_le(uint32_t crc, unsigned char const *p, size_t len);
@@ -80,7 +80,7 @@ extern uint32_t crc32c_le(uint32_t crc, unsigned char const *p, size_t len);
 #define crc32(c,p,l)	crc32_le((c),(unsigned char const *)(p),(l))
 #define crc32c(c,p,l)	crc32c_le((c),(unsigned char const *)(p),(l))
 
-#include "xfs/xfs_cksum.h"
+#include "xfs_cksum.h"
 
 /*
  * This mirrors the kernel include for xfs_buf.h - it's implicitly included in
diff --git a/libxfs/radix-tree.c b/libxfs/radix-tree.c
index c859f28..9e395be 100644
--- a/libxfs/radix-tree.c
+++ b/libxfs/radix-tree.c
@@ -18,7 +18,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include "xfs/platform_defs.h"
+#include "platform_defs.h"
 #include "radix-tree.h"
 
 #ifndef ARRAY_SIZE
diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 4e0c75b..4f8212f 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -30,7 +30,7 @@
 #include "xfs_inode.h"
 #include "xfs_trans.h"
 
-#include "xfs/libxfs.h"		/* for LIBXFS_EXIT_ON_FAILURE */
+#include "libxfs.h"		/* for LIBXFS_EXIT_ON_FAILURE */
 
 /*
  * Important design/architecture note:
diff --git a/libxlog/util.c b/libxlog/util.c
index a0e35cc..2feae82 100644
--- a/libxlog/util.c
+++ b/libxlog/util.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
-#include "xfs/libxlog.h"
+#include "libxfs.h"
+#include "libxlog.h"
 
 int print_exit;
 int print_skip_uuid;
diff --git a/libxlog/xfs_log_recover.c b/libxlog/xfs_log_recover.c
index a80c431..ef7cf68 100644
--- a/libxlog/xfs_log_recover.c
+++ b/libxlog/xfs_log_recover.c
@@ -15,8 +15,8 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs/libxfs.h"
-#include "xfs/libxlog.h"
+#include "libxfs.h"
+#include "libxlog.h"
 
 #define xfs_readonly_buftarg(buftarg)			(0)
 
diff --git a/logprint/log_copy.c b/logprint/log_copy.c
index ea55a1f..1cc4c21 100644
--- a/logprint/log_copy.c
+++ b/logprint/log_copy.c
@@ -15,8 +15,8 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs/libxfs.h"
-#include "xfs/libxlog.h"
+#include "libxfs.h"
+#include "libxlog.h"
 
 #include "logprint.h"
 
diff --git a/logprint/log_dump.c b/logprint/log_dump.c
index efcf62e..2bccb50 100644
--- a/logprint/log_dump.c
+++ b/logprint/log_dump.c
@@ -15,8 +15,8 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs/libxfs.h"
-#include "xfs/libxlog.h"
+#include "libxfs.h"
+#include "libxlog.h"
 
 #include "logprint.h"
 
diff --git a/logprint/log_misc.c b/logprint/log_misc.c
index 7ea6edc..fd30679 100644
--- a/logprint/log_misc.c
+++ b/logprint/log_misc.c
@@ -15,8 +15,8 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs/libxfs.h"
-#include "xfs/libxlog.h"
+#include "libxfs.h"
+#include "libxlog.h"
 
 #include "logprint.h"
 
diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c
index 6569968..9f1a7ab 100644
--- a/logprint/log_print_all.c
+++ b/logprint/log_print_all.c
@@ -15,8 +15,8 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs/libxfs.h"
-#include "xfs/libxlog.h"
+#include "libxfs.h"
+#include "libxlog.h"
 
 #include "logprint.h"
 
diff --git a/logprint/log_print_trans.c b/logprint/log_print_trans.c
index cbd7a9c..9bf2b37 100644
--- a/logprint/log_print_trans.c
+++ b/logprint/log_print_trans.c
@@ -15,8 +15,8 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs/libxfs.h"
-#include "xfs/libxlog.h"
+#include "libxfs.h"
+#include "libxlog.h"
 
 #include "logprint.h"
 
diff --git a/logprint/logprint.c b/logprint/logprint.c
index 2ad2ec0..a5c9b32 100644
--- a/logprint/logprint.c
+++ b/logprint/logprint.c
@@ -18,8 +18,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include "xfs/libxfs.h"
-#include "xfs/libxlog.h"
+#include "libxfs.h"
+#include "libxlog.h"
 
 #include "logprint.h"
 
diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c
index ea7298d..5764616 100644
--- a/mdrestore/xfs_mdrestore.c
+++ b/mdrestore/xfs_mdrestore.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "xfs_metadump.h"
 
 char 		*progname;
diff --git a/mkfs/fstyp.c b/mkfs/fstyp.c
index 7410516..7f3da06 100644
--- a/mkfs/fstyp.c
+++ b/mkfs/fstyp.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <disk/fstyp.h>
 
 /*
diff --git a/mkfs/maxtrres.c b/mkfs/maxtrres.c
index f6bcec0..e1d5ee9 100644
--- a/mkfs/maxtrres.c
+++ b/mkfs/maxtrres.c
@@ -24,7 +24,7 @@
  * directory block size.
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "xfs_mkfs.h"
 
 int
diff --git a/mkfs/proto.c b/mkfs/proto.c
index 17308bc..cb34b28 100644
--- a/mkfs/proto.c
+++ b/mkfs/proto.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <sys/stat.h>
 #include "xfs_mkfs.h"
 
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 11e9f4b..80cdd10 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <ctype.h>
 #ifdef ENABLE_BLKID
 #include <blkid/blkid.h>
diff --git a/quota/edit.c b/quota/edit.c
index 0170d51..d226e89 100644
--- a/quota/edit.c
+++ b/quota/edit.c
@@ -19,8 +19,8 @@
 #include <pwd.h>
 #include <grp.h>
 #include <ctype.h>
-#include "xfs/input.h"
-#include "xfs/command.h"
+#include "input.h"
+#include "command.h"
 #include "init.h"
 #include "quota.h"
 
diff --git a/quota/free.c b/quota/free.c
index 72ab503..dcbe8ce 100644
--- a/quota/free.c
+++ b/quota/free.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/command.h"
+#include "command.h"
 #include "init.h"
 #include "quota.h"
 
diff --git a/quota/init.c b/quota/init.c
index 019e2c5..52f7941 100644
--- a/quota/init.c
+++ b/quota/init.c
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/path.h"
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "path.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 
 char	*progname;
diff --git a/quota/path.c b/quota/path.c
index 9a35332..bdb8c98 100644
--- a/quota/path.c
+++ b/quota/path.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "quota.h"
 
diff --git a/quota/project.c b/quota/project.c
index f30c6c6..17a83b0 100644
--- a/quota/project.c
+++ b/quota/project.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/command.h"
-#include "xfs/input.h"
+#include "command.h"
+#include "input.h"
 #include "init.h"
 #include "quota.h"
 
diff --git a/quota/quot.c b/quota/quot.c
index be41026..9116e48 100644
--- a/quota/quot.c
+++ b/quota/quot.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/command.h"
+#include "command.h"
 #include <ctype.h>
 #include <pwd.h>
 #include <grp.h>
diff --git a/quota/quota.c b/quota/quota.c
index d249740..f6b24c3 100644
--- a/quota/quota.c
+++ b/quota/quota.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/command.h"
+#include "command.h"
 #include <ctype.h>
 #include <pwd.h>
 #include <grp.h>
diff --git a/quota/quota.h b/quota/quota.h
index 974747f..a905ce5 100644
--- a/quota/quota.h
+++ b/quota/quota.h
@@ -16,9 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/xqm.h"
-#include "xfs/path.h"
-#include "xfs/project.h"
+#include "xqm.h"
+#include "path.h"
+#include "project.h"
 #include <stdbool.h>
 
 /*
diff --git a/quota/report.c b/quota/report.c
index 7c3cf45..3d84447 100644
--- a/quota/report.c
+++ b/quota/report.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/command.h"
+#include "command.h"
 #include <sys/types.h>
 #include <pwd.h>
 #include <grp.h>
diff --git a/quota/state.c b/quota/state.c
index b1827b6..0173f40 100644
--- a/quota/state.c
+++ b/quota/state.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/command.h"
+#include "command.h"
 #include "init.h"
 #include "quota.h"
 
diff --git a/repair/agheader.c b/repair/agheader.c
index a216afa..c79031f 100644
--- a/repair/agheader.c
+++ b/repair/agheader.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "globals.h"
 #include "agheader.h"
 #include "protos.h"
diff --git a/repair/attr_repair.c b/repair/attr_repair.c
index e2bfd44..62f80e7 100644
--- a/repair/attr_repair.c
+++ b/repair/attr_repair.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "globals.h"
 #include "err_protos.h"
 #include "attr_repair.h"
diff --git a/repair/avl.c b/repair/avl.c
index 83e3087..e3843ae 100644
--- a/repair/avl.c
+++ b/repair/avl.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "avl.h"
 
 #define CERT	ASSERT
diff --git a/repair/avl64.c b/repair/avl64.c
index 64f5358..51cd624 100644
--- a/repair/avl64.c
+++ b/repair/avl64.c
@@ -17,7 +17,7 @@
  */
 
 #include <stdio.h>
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "avl64.h"
 
 #define CERT	ASSERT
diff --git a/repair/bmap.c b/repair/bmap.c
index c5c50c3..2655632 100644
--- a/repair/bmap.c
+++ b/repair/bmap.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "err_protos.h"
 #include "bmap.h"
 
diff --git a/repair/btree.c b/repair/btree.c
index bc4ed98..66fb40b 100644
--- a/repair/btree.c
+++ b/repair/btree.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "btree.h"
 
 /*
diff --git a/repair/dino_chunks.c b/repair/dino_chunks.c
index d484a1d..7dbaca6 100644
--- a/repair/dino_chunks.c
+++ b/repair/dino_chunks.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "avl.h"
 #include "globals.h"
 #include "agheader.h"
diff --git a/repair/dinode.c b/repair/dinode.c
index 09db966..c6303fa 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "avl.h"
 #include "globals.h"
 #include "agheader.h"
diff --git a/repair/dir2.c b/repair/dir2.c
index c89f478..187e069 100644
--- a/repair/dir2.c
+++ b/repair/dir2.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "avl.h"
 #include "globals.h"
 #include "incore.h"
diff --git a/repair/globals.c b/repair/globals.c
index d0ca3fb..9619220 100644
--- a/repair/globals.c
+++ b/repair/globals.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 
 #define EXTERN
 #include "globals.h"
diff --git a/repair/incore.c b/repair/incore.c
index d5ecfd6..cb57316 100644
--- a/repair/incore.c
+++ b/repair/incore.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "avl.h"
 #include "btree.h"
 #include "globals.h"
diff --git a/repair/incore_bmc.c b/repair/incore_bmc.c
index c1e855d..de142ee 100644
--- a/repair/incore_bmc.c
+++ b/repair/incore_bmc.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "avl.h"
 #include "globals.h"
 #include "incore.h"
diff --git a/repair/incore_ext.c b/repair/incore_ext.c
index c15e57d..cac379c 100644
--- a/repair/incore_ext.c
+++ b/repair/incore_ext.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "avl.h"
 #include "btree.h"
 #include "globals.h"
diff --git a/repair/incore_ino.c b/repair/incore_ino.c
index 7e19657..32d7678 100644
--- a/repair/incore_ino.c
+++ b/repair/incore_ino.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "avl.h"
 #include "globals.h"
 #include "incore.h"
diff --git a/repair/init.c b/repair/init.c
index a7547cb..609229c 100644
--- a/repair/init.c
+++ b/repair/init.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "globals.h"
 #include "agheader.h"
 #include "protos.h"
diff --git a/repair/phase1.c b/repair/phase1.c
index bd9adcb..126d0b3 100644
--- a/repair/phase1.c
+++ b/repair/phase1.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "globals.h"
 #include "agheader.h"
 #include "protos.h"
diff --git a/repair/phase2.c b/repair/phase2.c
index 04c1295..4c270e5 100644
--- a/repair/phase2.c
+++ b/repair/phase2.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
-#include "xfs/libxlog.h"
+#include "libxfs.h"
+#include "libxlog.h"
 #include "avl.h"
 #include "globals.h"
 #include "agheader.h"
diff --git a/repair/phase3.c b/repair/phase3.c
index 4751e56..20786af 100644
--- a/repair/phase3.c
+++ b/repair/phase3.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "threads.h"
 #include "prefetch.h"
 #include "avl.h"
diff --git a/repair/phase4.c b/repair/phase4.c
index 8d3525c..e0571e8 100644
--- a/repair/phase4.c
+++ b/repair/phase4.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "threads.h"
 #include "prefetch.h"
 #include "avl.h"
diff --git a/repair/phase5.c b/repair/phase5.c
index 9b3d73b..b9a64b9 100644
--- a/repair/phase5.c
+++ b/repair/phase5.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "avl.h"
 #include "globals.h"
 #include "agheader.h"
diff --git a/repair/phase6.c b/repair/phase6.c
index 9a5cba7..672c6f1 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "threads.h"
 #include "prefetch.h"
 #include "avl.h"
diff --git a/repair/phase7.c b/repair/phase7.c
index 56c0379..b1e3a55 100644
--- a/repair/phase7.c
+++ b/repair/phase7.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "avl.h"
 #include "globals.h"
 #include "agheader.h"
diff --git a/repair/prefetch.c b/repair/prefetch.c
index 08c0394..8b261ae 100644
--- a/repair/prefetch.c
+++ b/repair/prefetch.c
@@ -1,4 +1,4 @@
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <pthread.h>
 #include "avl.h"
 #include "btree.h"
diff --git a/repair/progress.c b/repair/progress.c
index 1b27924..27cbaef 100644
--- a/repair/progress.c
+++ b/repair/progress.c
@@ -1,5 +1,5 @@
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "globals.h"
 #include "progress.h"
 #include "err_protos.h"
diff --git a/repair/rt.c b/repair/rt.c
index b412a0f..3290d2c 100644
--- a/repair/rt.c
+++ b/repair/rt.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "avl.h"
 #include "globals.h"
 #include "agheader.h"
diff --git a/repair/sb.c b/repair/sb.c
index f6a1f15..4eef14a 100644
--- a/repair/sb.c
+++ b/repair/sb.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
-#include "xfs/libxlog.h"
+#include "libxfs.h"
+#include "libxlog.h"
 #include "agheader.h"
 #include "globals.h"
 #include "protos.h"
diff --git a/repair/scan.c b/repair/scan.c
index e9a8ab4..dd61046 100644
--- a/repair/scan.c
+++ b/repair/scan.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include "avl.h"
 #include "globals.h"
 #include "agheader.h"
diff --git a/repair/threads.c b/repair/threads.c
index a5fb856..631531f 100644
--- a/repair/threads.c
+++ b/repair/threads.c
@@ -1,4 +1,4 @@
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 #include <pthread.h>
 #include <signal.h>
 #include "threads.h"
diff --git a/repair/versions.c b/repair/versions.c
index 0bf4ab3..fb1b3e4 100644
--- a/repair/versions.c
+++ b/repair/versions.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 
 #define EXTERN
 #include "versions.h"
diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
index df1fd78..db703d0 100644
--- a/repair/xfs_repair.c
+++ b/repair/xfs_repair.c
@@ -16,8 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
-#include "xfs/libxlog.h"
+#include "libxfs.h"
+#include "libxlog.h"
 #include <sys/resource.h>
 #include "avl.h"
 #include "avl64.h"
diff --git a/rtcp/xfs_rtcp.c b/rtcp/xfs_rtcp.c
index 7f48060..f604b46 100644
--- a/rtcp/xfs_rtcp.c
+++ b/rtcp/xfs_rtcp.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs/libxfs.h"
+#include "libxfs.h"
 
 int rtcp(char *, char *, int);
 int xfsrtextsize(char *path);
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 08/13] xfsprogs: move __be*/__le* types and __arch_pack to xfs_arch.h
  2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
                   ` (6 preceding siblings ...)
  2015-07-03 10:12 ` [PATCH 07/13] xfsprogs: simplify internal includes Christoph Hellwig
@ 2015-07-03 10:12 ` Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 09/13] xfsprogs: move __u*/__s* typedefs to per-port headers Christoph Hellwig
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

These are defines and typedefs only needed for the XFS on disk format,
so there is no need to have the available for every user of xfs.h.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/platform_defs.h.in | 23 -----------------------
 include/xfs_arch.h         | 23 +++++++++++++++++++++++
 2 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in
index 529c0a6..81741c4 100644
--- a/include/platform_defs.h.in
+++ b/include/platform_defs.h.in
@@ -50,22 +50,6 @@ typedef unsigned long long int	__u64;
 typedef signed long long int	__s64;
 #endif
 
-#ifdef __CHECKER__
-#define __bitwise		__attribute__((bitwise))
-#define __force			__attribute__((force))
-#else
-#define __bitwise
-#define __force
-#endif
-
-typedef __u16	__bitwise	__le16;
-typedef __u32	__bitwise	__le32;
-typedef __u64	__bitwise	__le64;
-
-typedef __u16	__bitwise	__be16;
-typedef __u32	__bitwise	__be32;
-typedef __u64	__bitwise	__be64;
-
 typedef struct filldir		filldir_t;
 
 #if defined(__linux__)
@@ -130,13 +114,6 @@ typedef unsigned short umode_t;
 					| (minor&IRIX_DEV_MAXMIN)))
 #define IRIX_DEV_TO_KDEVT(dev)	makedev(IRIX_DEV_MAJOR(dev),IRIX_DEV_MINOR(dev))
 
-/* ARM old ABI has some weird alignment/padding */
-#if defined(__arm__) && !defined(__ARM_EABI__)
-#define __arch_pack __attribute__((packed))
-#else
-#define __arch_pack
-#endif
-
 #ifndef min
 #define min(a,b)	(((a)<(b))?(a):(b))
 #define max(a,b)	(((a)>(b))?(a):(b))
diff --git a/include/xfs_arch.h b/include/xfs_arch.h
index 310a17e..87650f1 100644
--- a/include/xfs_arch.h
+++ b/include/xfs_arch.h
@@ -24,6 +24,22 @@
 #undef XFS_NATIVE_HOST
 #endif
 
+#ifdef __CHECKER__
+#define __bitwise		__attribute__((bitwise))
+#define __force			__attribute__((force))
+#else
+#define __bitwise
+#define __force
+#endif
+
+typedef __u16	__bitwise	__le16;
+typedef __u32	__bitwise	__le32;
+typedef __u64	__bitwise	__le64;
+
+typedef __u16	__bitwise	__be16;
+typedef __u32	__bitwise	__be32;
+typedef __u64	__bitwise	__be64;
+
 /*
  * Casts are necessary for constants, because we never know how for sure
  * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
@@ -262,4 +278,11 @@ static inline void put_unaligned_be64(__uint64_t val, void *p)
 	put_unaligned_be32(val, p + 4);
 }
 
+/* ARM old ABI has some weird alignment/padding */
+#if defined(__arm__) && !defined(__ARM_EABI__)
+#define __arch_pack __attribute__((packed))
+#else
+#define __arch_pack
+#endif
+
 #endif	/* __XFS_ARCH_H__ */
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 09/13] xfsprogs: move __u*/__s* typedefs to per-port headers
  2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
                   ` (7 preceding siblings ...)
  2015-07-03 10:12 ` [PATCH 08/13] xfsprogs: move __be*/__le* types and __arch_pack to xfs_arch.h Christoph Hellwig
@ 2015-07-03 10:12 ` Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 10/13] xfsprogs: include libxfs.h in libxfs_priv.h Christoph Hellwig
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

Currently we have to install the autoconf-generated platform_defs.h
to get the defintions for these.  But they are clearly a feature
of Linux vs non-Linux platforms so move them to the per-port headers
instead.

Note: in the long run it might be a good idea to just the standard
uint*_t/int*_t types instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 configure.ac               |  1 -
 include/darwin.h           |  9 +++++++++
 include/freebsd.h          |  9 +++++++++
 include/gnukfreebsd.h      |  9 +++++++++
 include/irix.h             |  9 +++++++++
 include/linux.h            |  1 +
 include/platform_defs.h.in | 14 --------------
 m4/package_types.m4        | 13 -------------
 8 files changed, 37 insertions(+), 28 deletions(-)

diff --git a/configure.ac b/configure.ac
index fe991cc..d6d1adc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -116,7 +116,6 @@ AC_HAVE_READDIR
 
 AC_CHECK_SIZEOF([long])
 AC_CHECK_SIZEOF([char *])
-AC_TYPE_U32
 AC_TYPE_UMODE_T
 AC_MANUAL_FORMAT
 
diff --git a/include/darwin.h b/include/darwin.h
index 30f0052..abdf4e3 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -109,6 +109,15 @@ static __inline__ void platform_uuid_copy(uuid_t *dst, uuid_t *src)
 	memcpy(dst, src, sizeof(uuid_t));
 }
 
+typedef unsigned char		__u8;
+typedef signed char		__s8;
+typedef unsigned short		__u16;
+typedef signed short		__s16;
+typedef unsigned int		__u32;
+typedef signed int		__s32;
+typedef unsigned long long int	__u64;
+typedef signed long long int	__s64;
+
 #define __int8_t	int8_t
 #define __int16_t	int16_t
 #define __int32_t	int32_t
diff --git a/include/freebsd.h b/include/freebsd.h
index e59b1e8..902b940 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -53,6 +53,15 @@ typedef __uint64_t	xfs_ino_t;
 typedef __uint32_t	xfs_dev_t;
 typedef __int64_t	xfs_daddr_t;
 
+typedef unsigned char		__u8;
+typedef signed char		__s8;
+typedef unsigned short		__u16;
+typedef signed short		__s16;
+typedef unsigned int		__u32;
+typedef signed int		__s32;
+typedef unsigned long long int	__u64;
+typedef signed long long int	__s64;
+
 #define	O_LARGEFILE	0
 
 #define HAVE_FID	1
diff --git a/include/gnukfreebsd.h b/include/gnukfreebsd.h
index b83c144..95c4c13 100644
--- a/include/gnukfreebsd.h
+++ b/include/gnukfreebsd.h
@@ -42,6 +42,15 @@ typedef __uint64_t	xfs_ino_t;
 typedef __uint32_t	xfs_dev_t;
 typedef __int64_t	xfs_daddr_t;
 
+typedef unsigned char		__u8;
+typedef signed char		__s8;
+typedef unsigned short		__u16;
+typedef signed short		__s16;
+typedef unsigned int		__u32;
+typedef signed int		__s32;
+typedef unsigned long long int	__u64;
+typedef signed long long int	__s64;
+
 #define HAVE_FID	1
 
 static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
diff --git a/include/irix.h b/include/irix.h
index 31050c4..28564c8 100644
--- a/include/irix.h
+++ b/include/irix.h
@@ -47,6 +47,15 @@ typedef __int64_t	xfs_ino_t;
 typedef __int32_t	xfs_dev_t;
 typedef __int64_t	xfs_daddr_t;
 
+typedef unsigned char		__u8;
+typedef signed char		__s8;
+typedef unsigned short		__u16;
+typedef signed short		__s16;
+typedef unsigned int		__u32;
+typedef signed int		__s32;
+typedef unsigned long long int	__u64;
+typedef signed long long int	__s64;
+
 #define xfs_flock64	flock64
 #define xfs_flock64_t	struct flock64
 
diff --git a/include/linux.h b/include/linux.h
index 31c077a..cb6298f 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -28,6 +28,7 @@
 #include <getopt.h>
 #include <endian.h>
 #include <stdbool.h>
+#include <asm/types.h>
 
 static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
 {
diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in
index 81741c4..db6cb2e 100644
--- a/include/platform_defs.h.in
+++ b/include/platform_defs.h.in
@@ -36,20 +36,6 @@
 #include <limits.h>
 #include <stdbool.h>
 
-#undef HAVE___U32
-#ifdef HAVE___U32
-#include <asm/types.h>
-#else
-typedef unsigned char		__u8;
-typedef signed char		__s8;
-typedef unsigned short		__u16;
-typedef signed short		__s16;
-typedef unsigned int		__u32;
-typedef signed int		__s32;
-typedef unsigned long long int	__u64;
-typedef signed long long int	__s64;
-#endif
-
 typedef struct filldir		filldir_t;
 
 #if defined(__linux__)
diff --git a/m4/package_types.m4 b/m4/package_types.m4
index c3645bc..4aa09a5 100644
--- a/m4/package_types.m4
+++ b/m4/package_types.m4
@@ -1,16 +1,3 @@
-# 
-# Check if we have a type for __u32
-# 
-AC_DEFUN([AC_TYPE_U32],
-  [ AC_MSG_CHECKING([for __u32 ])
-    AC_TRY_COMPILE([
-#include <asm/types.h>
-#include <stdlib.h>
-#include <stddef.h>
-    ], [
-         __u32  u32;
-    ], AC_DEFINE(HAVE___U32) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
-  ])
 #
 # Check if we have umode_t
 #
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 10/13] xfsprogs: include libxfs.h in libxfs_priv.h
  2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
                   ` (8 preceding siblings ...)
  2015-07-03 10:12 ` [PATCH 09/13] xfsprogs: move __u*/__s* typedefs to per-port headers Christoph Hellwig
@ 2015-07-03 10:12 ` Christoph Hellwig
  2015-07-03 23:42   ` Dave Chinner
  2015-07-03 10:12 ` [PATCH 11/13] xfsprogs: don't install platform_defs.h Christoph Hellwig
                   ` (2 subsequent siblings)
  12 siblings, 1 reply; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

libxfs_priv.h duplicates large parts of libxfs.h.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/libxfs.h     |  4 ----
 libxfs/libxfs_priv.h | 37 +------------------------------------
 2 files changed, 1 insertion(+), 40 deletions(-)

diff --git a/include/libxfs.h b/include/libxfs.h
index 1fb2d6d..62553f0 100644
--- a/include/libxfs.h
+++ b/include/libxfs.h
@@ -163,12 +163,8 @@ extern int	libxfs_bmap_finish(xfs_trans_t **, xfs_bmap_free_t *, int *);
 extern void 	libxfs_fs_repair_cmn_err(int, struct xfs_mount *, char *, ...);
 extern void	libxfs_fs_cmn_err(int, struct xfs_mount *, char *, ...);
 
-/* XXX: this is messy and needs fixing */
-#ifndef __LIBXFS_INTERNAL_XFS_H__
 extern void cmn_err(int, char *, ...);
 enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC };
-#endif
-
 
 extern int		libxfs_nproc(void);
 extern unsigned long	libxfs_physmem(void);	/* in kilobytes */
diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index 7a29fd7..aaa24df 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h
@@ -57,39 +57,7 @@
 	__xfs_dir2_data_freescan((ip)->i_mount->m_dir_geo, \
 				 (ip)->d_ops, hdr, loghead)
 
-#include "libxfs_api_defs.h"
-#include "platform_defs.h"
-
-#include "list.h"
-#include "hlist.h"
-#include "cache.h"
-#include "bitops.h"
-#include "kmem.h"
-#include "radix-tree.h"
-#include "atomic.h"
-
-#include "xfs_types.h"
-#include "xfs_arch.h"
-
-#include "xfs_fs.h"
-
-/* CRC stuff, buffer API dependent on it */
-extern uint32_t crc32_le(uint32_t crc, unsigned char const *p, size_t len);
-extern uint32_t crc32c_le(uint32_t crc, unsigned char const *p, size_t len);
-
-#define crc32(c,p,l)	crc32_le((c),(unsigned char const *)(p),(l))
-#define crc32c(c,p,l)	crc32c_le((c),(unsigned char const *)(p),(l))
-
-#include "xfs_cksum.h"
-
-/*
- * This mirrors the kernel include for xfs_buf.h - it's implicitly included in
- * every files via a similar include in the kernel xfs_linux.h.
- */
-#include "libxfs_io.h"
-
-/* for all the support code that uses progname in error messages */
-extern char    *progname;
+#include "libxfs.h"
 
 #undef ASSERT
 #define ASSERT(ex) assert(ex)
@@ -115,9 +83,6 @@ extern char    *progname;
 #define XFS_IGET_CREATE			0x1
 #define XFS_IGET_UNTRUSTED		0x2
 
-extern void cmn_err(int, char *, ...);
-enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC };
-
 #define xfs_notice(mp,fmt,args...)		cmn_err(CE_NOTE,fmt, ## args)
 #define xfs_warn(mp,fmt,args...)		cmn_err(CE_WARN,fmt, ## args)
 #define xfs_hex_dump(d,n)		((void) 0)
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 11/13] xfsprogs: don't install platform_defs.h
  2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
                   ` (9 preceding siblings ...)
  2015-07-03 10:12 ` [PATCH 10/13] xfsprogs: include libxfs.h in libxfs_priv.h Christoph Hellwig
@ 2015-07-03 10:12 ` Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 12/13] xfsprogs: remove filldir_t typedef Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 13/13] xfsprogs: remove the constpp define Christoph Hellwig
  12 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

---
 include/Makefile           |  4 ++--
 include/libxfs.h           |  1 +
 include/linux.h            |  1 +
 include/path.h             |  2 +-
 include/platform_defs.h.in | 27 ---------------------------
 include/project.h          |  1 +
 include/xfs.h              | 28 +++++++++++++++++++++++++++-
 io/attr.c                  |  1 -
 io/bmap.c                  |  2 +-
 io/fadvise.c               |  1 -
 io/fiemap.c                |  2 +-
 io/file.c                  |  1 -
 io/freeze.c                |  1 -
 io/fsync.c                 |  2 +-
 io/getrusage.c             |  1 -
 io/imap.c                  |  1 -
 io/init.c                  |  2 +-
 io/inject.c                |  1 -
 io/io.h                    |  2 ++
 io/link.c                  |  1 -
 io/madvise.c               |  1 -
 io/mincore.c               |  1 -
 io/mmap.c                  |  1 -
 io/open.c                  |  1 -
 io/parent.c                |  1 -
 io/pread.c                 |  1 -
 io/prealloc.c              |  1 -
 io/pwrite.c                |  1 -
 io/readdir.c               |  1 -
 io/resblks.c               |  1 -
 io/seek.c                  |  1 -
 io/sendfile.c              |  1 -
 io/shutdown.c              |  1 -
 io/sync.c                  |  2 +-
 io/sync_file_range.c       |  1 -
 io/truncate.c              |  1 -
 libhandle/handle.c         |  1 +
 libhandle/jdm.c            |  1 +
 libxcmd/command.c          |  2 +-
 libxcmd/help.c             |  2 +-
 libxcmd/input.c            |  2 +-
 libxcmd/quit.c             |  2 +-
 libxfs/crc32.c             |  1 +
 libxfs/radix-tree.c        |  1 +
 44 files changed, 48 insertions(+), 63 deletions(-)

diff --git a/include/Makefile b/include/Makefile
index 778317e..e2a4b09 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -38,12 +38,12 @@ LIBHFILES = libxfs.h \
 	command.h \
 	input.h \
 	path.h \
-	project.h
+	project.h \
+	platform_defs.h \
 
 HFILES = handle.h \
 	jdm.h \
 	$(PKG_PLATFORM).h \
-	platform_defs.h \
 	xfs.h \
 	xqm.h \
 	xfs_arch.h
diff --git a/include/libxfs.h b/include/libxfs.h
index 62553f0..67a5fa6 100644
--- a/include/libxfs.h
+++ b/include/libxfs.h
@@ -21,6 +21,7 @@
 
 #include "libxfs_api_defs.h"
 #include "platform_defs.h"
+#include "xfs.h"
 
 #include "list.h"
 #include "hlist.h"
diff --git a/include/linux.h b/include/linux.h
index cb6298f..8804c2d 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -26,6 +26,7 @@
 #include <inttypes.h>
 #include <malloc.h>
 #include <getopt.h>
+#include <errno.h>
 #include <endian.h>
 #include <stdbool.h>
 #include <asm/types.h>
diff --git a/include/path.h b/include/path.h
index 58955ef..46a887e 100644
--- a/include/path.h
+++ b/include/path.h
@@ -18,7 +18,7 @@
 #ifndef __PATH_H__
 #define __PATH_H__
 
-#include "xfs.h"
+#include "platform_defs.h"
 
 /*
  * XFS Filesystem Paths
diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in
index db6cb2e..fc7e01a 100644
--- a/include/platform_defs.h.in
+++ b/include/platform_defs.h.in
@@ -38,20 +38,6 @@
 
 typedef struct filldir		filldir_t;
 
-#if defined(__linux__)
-#include <xfs/linux.h>
-#elif defined(__FreeBSD__)
-#include <xfs/freebsd.h>
-#elif defined(__FreeBSD_kernel__)
-#include <xfs/gnukfreebsd.h>
-#elif defined(__APPLE__)
-#include <xfs/darwin.h>
-#elif defined(__sgi__) || defined(__sgi)
-#include <xfs/irix.h>
-#else
-# error unknown platform... have fun porting!
-#endif
-
 /* long and pointer must be either 32 bit or 64 bit */
 #undef SIZEOF_LONG
 #undef SIZEOF_CHAR_P
@@ -76,19 +62,6 @@ typedef unsigned short umode_t;
 #endif
 #include <locale.h>
 
-#ifdef DEBUG
-# define ASSERT(EX)	assert(EX)
-#else
-# define ASSERT(EX)	((void) 0)
-#endif
-
-/*
- * sparse kernel source annotations
- */
-#ifndef __user
-#define __user
-#endif
-
 #define IRIX_DEV_BITSMAJOR      14
 #define IRIX_DEV_BITSMINOR      18
 #define IRIX_DEV_MAXMAJ         0x1ff
diff --git a/include/project.h b/include/project.h
index 63bdffd..77ed06b 100644
--- a/include/project.h
+++ b/include/project.h
@@ -18,6 +18,7 @@
 #ifndef __PROJECT_H__
 #define __PROJECT_H__
 
+#include "platform_defs.h"
 #include "xfs.h"
 
 extern int setprojid(const char *__name, int __fd, prid_t __id);
diff --git a/include/xfs.h b/include/xfs.h
index e32c4a8..bc94068 100644
--- a/include/xfs.h
+++ b/include/xfs.h
@@ -33,7 +33,33 @@
 #ifndef __XFS_H__
 #define __XFS_H__
 
-#include <xfs/platform_defs.h>
+#if defined(__linux__)
+#include <xfs/linux.h>
+#elif defined(__FreeBSD__)
+#include <xfs/freebsd.h>
+#elif defined(__FreeBSD_kernel__)
+#include <xfs/gnukfreebsd.h>
+#elif defined(__APPLE__)
+#include <xfs/darwin.h>
+#elif defined(__sgi__) || defined(__sgi)
+#include <xfs/irix.h>
+#else
+# error unknown platform... have fun porting!
+#endif
+
+#ifdef DEBUG
+# define ASSERT(EX)	assert(EX)
+#else
+# define ASSERT(EX)	((void) 0)
+#endif
+
+/*
+ * sparse kernel source annotations
+ */
+#ifndef __user
+#define __user
+#endif
+
 #include <xfs/xfs_types.h>
 #include <xfs/xfs_fs.h>
 
diff --git a/io/attr.c b/io/attr.c
index bc1ab56..7cbcc3c 100644
--- a/io/attr.c
+++ b/io/attr.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/bmap.c b/io/bmap.c
index 432ddb7..cbeed3b 100644
--- a/io/bmap.c
+++ b/io/bmap.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
+#include "platform_defs.h"
 #include "command.h"
 #include "init.h"
 #include "io.h"
diff --git a/io/fadvise.c b/io/fadvise.c
index fa586d3..d59d1ff 100644
--- a/io/fadvise.c
+++ b/io/fadvise.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/fiemap.c b/io/fiemap.c
index 8482c99..17b38a4 100644
--- a/io/fiemap.c
+++ b/io/fiemap.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
+#include "platform_defs.h"
 #include "command.h"
 #include <linux/fiemap.h>
 #include <linux/fs.h>
diff --git a/io/file.c b/io/file.c
index 91dd38e..d4bc4f8 100644
--- a/io/file.c
+++ b/io/file.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include <sys/mman.h>
diff --git a/io/freeze.c b/io/freeze.c
index 90f5b66..3d0d2a4 100644
--- a/io/freeze.c
+++ b/io/freeze.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/fsync.c b/io/fsync.c
index 6c93dff..9fe5e2f 100644
--- a/io/fsync.c
+++ b/io/fsync.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
+#include "platform_defs.h"
 #include "command.h"
 #include "init.h"
 #include "io.h"
diff --git a/io/getrusage.c b/io/getrusage.c
index 28b8453..bccf94c 100644
--- a/io/getrusage.c
+++ b/io/getrusage.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include <sys/time.h>
diff --git a/io/imap.c b/io/imap.c
index 7c24bcd..34901cb 100644
--- a/io/imap.c
+++ b/io/imap.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/init.c b/io/init.c
index 70214f9..13f35c4 100644
--- a/io/init.c
+++ b/io/init.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
+#include "platform_defs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/inject.c b/io/inject.c
index 23eb4a2..90ccda8 100644
--- a/io/inject.c
+++ b/io/inject.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/io.h b/io/io.h
index db8b513..b115e4a 100644
--- a/io/io.h
+++ b/io/io.h
@@ -16,6 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include "xfs.h"
+
 /*
  * Read/write patterns (default is always "forward")
  */
diff --git a/io/link.c b/io/link.c
index 7fb81e1..ccf8e69 100644
--- a/io/link.c
+++ b/io/link.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/madvise.c b/io/madvise.c
index b30d28b..1d8b53c 100644
--- a/io/madvise.c
+++ b/io/madvise.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include <sys/mman.h>
diff --git a/io/mincore.c b/io/mincore.c
index 670d4c8..9e0d3a6 100644
--- a/io/mincore.c
+++ b/io/mincore.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include <sys/mman.h>
diff --git a/io/mmap.c b/io/mmap.c
index 33747c1..f26276e 100644
--- a/io/mmap.c
+++ b/io/mmap.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include <sys/mman.h>
diff --git a/io/open.c b/io/open.c
index 33d9f8d..ac5a5e0 100644
--- a/io/open.c
+++ b/io/open.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/parent.c b/io/parent.c
index a374b3e..abc3402 100644
--- a/io/parent.c
+++ b/io/parent.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "path.h"
diff --git a/io/pread.c b/io/pread.c
index 9205e34..1c77c41 100644
--- a/io/pread.c
+++ b/io/pread.c
@@ -17,7 +17,6 @@
  */
 
 #include <sys/uio.h>
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include <ctype.h>
diff --git a/io/prealloc.c b/io/prealloc.c
index b60d2dc..713ea7b 100644
--- a/io/prealloc.c
+++ b/io/prealloc.c
@@ -19,7 +19,6 @@
 #if defined(HAVE_FALLOCATE)
 #include <linux/falloc.h>
 #endif
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/pwrite.c b/io/pwrite.c
index c9d2b1a..10f78e4 100644
--- a/io/pwrite.c
+++ b/io/pwrite.c
@@ -17,7 +17,6 @@
  */
 
 #include <sys/uio.h>
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/readdir.c b/io/readdir.c
index f8b2755..7b0edbc 100644
--- a/io/readdir.c
+++ b/io/readdir.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/resblks.c b/io/resblks.c
index df032d5..73318ae 100644
--- a/io/resblks.c
+++ b/io/resblks.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/seek.c b/io/seek.c
index 39dab61..35a369e 100644
--- a/io/seek.c
+++ b/io/seek.c
@@ -16,7 +16,6 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include <sys/types.h>
diff --git a/io/sendfile.c b/io/sendfile.c
index 744b618..5c1638f 100644
--- a/io/sendfile.c
+++ b/io/sendfile.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include <sys/sendfile.h>
diff --git a/io/shutdown.c b/io/shutdown.c
index b75278a..d8507cc 100644
--- a/io/shutdown.c
+++ b/io/shutdown.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/sync.c b/io/sync.c
index 0e7b82d..28e3a15 100644
--- a/io/sync.c
+++ b/io/sync.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
+#include "platform_defs.h"
 #include "command.h"
 #include "init.h"
 #include "io.h"
diff --git a/io/sync_file_range.c b/io/sync_file_range.c
index 8e66773..7e4f3e6 100644
--- a/io/sync_file_range.c
+++ b/io/sync_file_range.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/io/truncate.c b/io/truncate.c
index 5b2ac01..f2df168 100644
--- a/io/truncate.c
+++ b/io/truncate.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
 #include "command.h"
 #include "input.h"
 #include "init.h"
diff --git a/libhandle/handle.c b/libhandle/handle.c
index 7313e3b..b1c0c10 100644
--- a/libhandle/handle.c
+++ b/libhandle/handle.c
@@ -17,6 +17,7 @@
  */
 
 #include <libgen.h>
+#include "platform_defs.h"
 #include "xfs.h"
 #include "handle.h"
 #include "parent.h"
diff --git a/libhandle/jdm.c b/libhandle/jdm.c
index 13196d1..d804423 100644
--- a/libhandle/jdm.c
+++ b/libhandle/jdm.c
@@ -16,6 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include "platform_defs.h"
 #include "xfs.h"
 #include "handle.h"
 #include "jdm.h"
diff --git a/libxcmd/command.c b/libxcmd/command.c
index 5d0649b..42a77e9 100644
--- a/libxcmd/command.c
+++ b/libxcmd/command.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
+#include "platform_defs.h"
 #include "command.h"
 #include "input.h"
 
diff --git a/libxcmd/help.c b/libxcmd/help.c
index 023b830..fad0ab9 100644
--- a/libxcmd/help.c
+++ b/libxcmd/help.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
+#include "platform_defs.h"
 #include "command.h"
 
 static cmdinfo_t help_cmd;
diff --git a/libxcmd/input.c b/libxcmd/input.c
index 966a7ff..c505ab3 100644
--- a/libxcmd/input.c
+++ b/libxcmd/input.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
+#include "platform_defs.h"
 #include "input.h"
 #include <ctype.h>
 #include <stdbool.h>
diff --git a/libxcmd/quit.c b/libxcmd/quit.c
index 0a2dd40..0183b8f 100644
--- a/libxcmd/quit.c
+++ b/libxcmd/quit.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
+#include "platform_defs.h"
 #include "command.h"
 
 static cmdinfo_t quit_cmd;
diff --git a/libxfs/crc32.c b/libxfs/crc32.c
index b2c7ec0..783d62e 100644
--- a/libxfs/crc32.c
+++ b/libxfs/crc32.c
@@ -34,6 +34,7 @@
  */
 
 #include "platform_defs.h"
+#include "xfs.h"
 #include "xfs_arch.h"
 #include "crc32defs.h"
 
diff --git a/libxfs/radix-tree.c b/libxfs/radix-tree.c
index 9e395be..4d44ab4 100644
--- a/libxfs/radix-tree.c
+++ b/libxfs/radix-tree.c
@@ -19,6 +19,7 @@
  */
 
 #include "platform_defs.h"
+#include "xfs.h"
 #include "radix-tree.h"
 
 #ifndef ARRAY_SIZE
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 12/13] xfsprogs: remove filldir_t typedef
  2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
                   ` (10 preceding siblings ...)
  2015-07-03 10:12 ` [PATCH 11/13] xfsprogs: don't install platform_defs.h Christoph Hellwig
@ 2015-07-03 10:12 ` Christoph Hellwig
  2015-07-03 10:12 ` [PATCH 13/13] xfsprogs: remove the constpp define Christoph Hellwig
  12 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/platform_defs.h.in | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in
index fc7e01a..7ded23e 100644
--- a/include/platform_defs.h.in
+++ b/include/platform_defs.h.in
@@ -36,8 +36,6 @@
 #include <limits.h>
 #include <stdbool.h>
 
-typedef struct filldir		filldir_t;
-
 /* long and pointer must be either 32 bit or 64 bit */
 #undef SIZEOF_LONG
 #undef SIZEOF_CHAR_P
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 13/13] xfsprogs: remove the constpp define
  2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
                   ` (11 preceding siblings ...)
  2015-07-03 10:12 ` [PATCH 12/13] xfsprogs: remove filldir_t typedef Christoph Hellwig
@ 2015-07-03 10:12 ` Christoph Hellwig
  12 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2015-07-03 10:12 UTC (permalink / raw)
  To: xfs

This is a workaround for the long obsolete glibc 2.0.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/darwin.h      |  1 -
 include/freebsd.h     |  2 --
 include/gnukfreebsd.h |  2 --
 include/irix.h        |  2 --
 include/linux.h       |  6 ------
 mkfs/xfs_mkfs.c       | 16 ++++++++--------
 repair/xfs_repair.c   |  4 ++--
 7 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/include/darwin.h b/include/darwin.h
index abdf4e3..fe533a2 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -154,7 +154,6 @@ typedef int64_t		xfs_daddr_t;
 #define ENOATTR		989     /* Attribute not found */
 #define EFSCORRUPTED	990	/* Filesystem is corrupted */
 #define EFSBADCRC	991	/* Bad CRC detected */
-#define constpp		char * const *
 
 #define HAVE_FID	1
 
diff --git a/include/freebsd.h b/include/freebsd.h
index 902b940..6c51d3f 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -42,8 +42,6 @@
 #define fdatasync	fsync
 #define memalign(a,sz)	valloc(sz)
 
-#define constpp	char * const *
-
 #define EFSCORRUPTED	990	/* Filesystem is corrupted */
 #define EFSBADCRC	991	/* Bad CRC detected */
 
diff --git a/include/gnukfreebsd.h b/include/gnukfreebsd.h
index 95c4c13..6686b86 100644
--- a/include/gnukfreebsd.h
+++ b/include/gnukfreebsd.h
@@ -32,8 +32,6 @@
 #include <libgen.h>
 #include <paths.h>
 
-#define constpp	char * const *
-
 #define EFSCORRUPTED	990	/* Filesystem is corrupted */
 #define EFSBADCRC	991	/* Bad CRC detected */
 
diff --git a/include/irix.h b/include/irix.h
index 28564c8..806c94f 100644
--- a/include/irix.h
+++ b/include/irix.h
@@ -183,8 +183,6 @@ typedef struct xfs_efd_log_format_32 {
 #define inline		__inline
 #endif
 
-#define constpp		char * const *
-
 /*ARGSUSED*/
 static __inline__ int xfsctl(const char *path, int fd, int cmd, void *arg)
 {
diff --git a/include/linux.h b/include/linux.h
index 8804c2d..596dab4 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -130,12 +130,6 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len)
 	return 0;
 }
 
-#if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ <= 1))
-# define constpp	const char * const *
-#else
-# define constpp	char * const *
-#endif
-
 #define ENOATTR		ENODATA	/* Attribute not found */
 #define EFSCORRUPTED	EUCLEAN	/* Filesystem is corrupted */
 #define EFSBADCRC	EBADMSG	/* Bad CRC detected */
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 80cdd10..95f29f3 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -1086,7 +1086,7 @@ main(
 			while (*p != '\0') {
 				char	*value;
 
-				switch (getsubopt(&p, (constpp)bopts, &value)) {
+				switch (getsubopt(&p, bopts, &value)) {
 				case B_LOG:
 					if (!value || *value == '\0')
 						reqval('b', bopts, B_LOG);
@@ -1127,7 +1127,7 @@ main(
 			while (*p != '\0') {
 				char	*value;
 
-				switch (getsubopt(&p, (constpp)dopts, &value)) {
+				switch (getsubopt(&p, dopts, &value)) {
 				case D_AGCOUNT:
 					if (!value || *value == '\0')
 						reqval('d', dopts, D_AGCOUNT);
@@ -1304,7 +1304,7 @@ main(
 			while (*p != '\0') {
 				char	*value;
 
-				switch (getsubopt(&p, (constpp)iopts, &value)) {
+				switch (getsubopt(&p, iopts, &value)) {
 				case I_ALIGN:
 					if (!value || *value == '\0')
 						value = "1";
@@ -1407,7 +1407,7 @@ main(
 			while (*p != '\0') {
 				char	*value;
 
-				switch (getsubopt(&p, (constpp)lopts, &value)) {
+				switch (getsubopt(&p, lopts, &value)) {
 				case L_AGNUM:
 					if (!value || *value == '\0')
 						reqval('l', lopts, L_AGNUM);
@@ -1555,7 +1555,7 @@ main(
 			while (*p != '\0') {
 				char	*value;
 
-				switch (getsubopt(&p, (constpp)mopts, &value)) {
+				switch (getsubopt(&p, mopts, &value)) {
 				case M_CRC:
 					if (!value || *value == '\0')
 						reqval('m', mopts, M_CRC);
@@ -1588,7 +1588,7 @@ _("cannot specify both crc and ftype\n"));
 			while (*p != '\0') {
 				char	*value;
 
-				switch (getsubopt(&p, (constpp)nopts, &value)) {
+				switch (getsubopt(&p, nopts, &value)) {
 				case N_LOG:
 					if (!value || *value == '\0')
 						reqval('n', nopts, N_LOG);
@@ -1672,7 +1672,7 @@ _("cannot specify both crc and ftype\n"));
 			while (*p != '\0') {
 				char	*value;
 
-				switch (getsubopt(&p, (constpp)ropts, &value)) {
+				switch (getsubopt(&p, ropts, &value)) {
 				case R_EXTSIZE:
 					if (!value || *value == '\0')
 						reqval('r', ropts, R_EXTSIZE);
@@ -1717,7 +1717,7 @@ _("cannot specify both crc and ftype\n"));
 			while (*p != '\0') {
 				char	*value;
 
-				switch (getsubopt(&p, (constpp)sopts, &value)) {
+				switch (getsubopt(&p, sopts, &value)) {
 				case S_LOG:
 				case S_SECTLOG:
 					if (!value || *value == '\0')
diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
index db703d0..9518812 100644
--- a/repair/xfs_repair.c
+++ b/repair/xfs_repair.c
@@ -224,7 +224,7 @@ process_args(int argc, char **argv)
 			while (*p != '\0')  {
 				char *val;
 
-				switch (getsubopt(&p, (constpp)o_opts, &val))  {
+				switch (getsubopt(&p, o_opts, &val))  {
 				case ASSUME_XFS:
 					if (val)
 						noval('o', o_opts, ASSUME_XFS);
@@ -275,7 +275,7 @@ process_args(int argc, char **argv)
 			while (*p) {
 				char *val;
 
-				switch (getsubopt(&p, (constpp)c_opts, &val)) {
+				switch (getsubopt(&p, c_opts, &val)) {
 				case CONVERT_LAZY_COUNT:
 					lazy_count = (int)strtol(val, NULL, 0);
 					convert_lazy_count = 1;
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 10/13] xfsprogs: include libxfs.h in libxfs_priv.h
  2015-07-03 10:12 ` [PATCH 10/13] xfsprogs: include libxfs.h in libxfs_priv.h Christoph Hellwig
@ 2015-07-03 23:42   ` Dave Chinner
  0 siblings, 0 replies; 15+ messages in thread
From: Dave Chinner @ 2015-07-03 23:42 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Fri, Jul 03, 2015 at 12:12:18PM +0200, Christoph Hellwig wrote:
> libxfs_priv.h duplicates large parts of libxfs.h.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  include/libxfs.h     |  4 ----
>  libxfs/libxfs_priv.h | 37 +------------------------------------
>  2 files changed, 1 insertion(+), 40 deletions(-)

This is the opposite of what I've been trying to get to, which is to
make libxfs compilation not be reliant on the external definitions
used by the rest of xfsprogs. i.e. libxfs_priv.h contains all the
bits that are need to compile the kernel code, libxfs_api_defs.h
contain all the swizzling needed to namespace all the externally
used libxfs code correctly, and libxfs_io.h contains all the buffer
IO interfaces.

In the end, there should be no duplication between the two files,
except for infrastructure includes like platform defs, lists, trees,
etc.  This isnt quite complete yet, which is why there is some
duplication in the code right now.

> diff --git a/include/libxfs.h b/include/libxfs.h
> index 1fb2d6d..62553f0 100644
> --- a/include/libxfs.h
> +++ b/include/libxfs.h
> @@ -163,12 +163,8 @@ extern int	libxfs_bmap_finish(xfs_trans_t **, xfs_bmap_free_t *, int *);
>  extern void 	libxfs_fs_repair_cmn_err(int, struct xfs_mount *, char *, ...);
>  extern void	libxfs_fs_cmn_err(int, struct xfs_mount *, char *, ...);
>  
> -/* XXX: this is messy and needs fixing */
> -#ifndef __LIBXFS_INTERNAL_XFS_H__
>  extern void cmn_err(int, char *, ...);
>  enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC };
> -#endif
> -

cmn_err needs to be removed from all the external utilities.  This is
only a small amount of work, cmn_err is only used in the repair AVL
code and a single call in the logprint code. Both libxfs_fs_cmn_err
and xfs_fs_repair_cmn_err are completely unused, so cmn_err() should
become a libxfs internal function, and eventually be rewritten to
have native xfs_alert() style interfaces...

> -
> -/* CRC stuff, buffer API dependent on it */
> -extern uint32_t crc32_le(uint32_t crc, unsigned char const *p, size_t len);
> -extern uint32_t crc32c_le(uint32_t crc, unsigned char const *p, size_t len);
> -
> -#define crc32(c,p,l)	crc32_le((c),(unsigned char const *)(p),(l))
> -#define crc32c(c,p,l)	crc32c_le((c),(unsigned char const *)(p),(l))

I was planning to move this to libxfs_api_defs.h, as it's swizlling
needed to allow xfs_cksum.h be included in external code.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-07-03 23:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
2015-07-03 10:12 ` [PATCH 01/13] xfsprogs: don't install internal header files Christoph Hellwig
2015-07-03 10:12 ` [PATCH 02/13] xfsprogs: remove unused macros from xfs_arch.h Christoph Hellwig
2015-07-03 10:12 ` [PATCH 03/13] xfsprogs: remove swab.h Christoph Hellwig
2015-07-03 10:12 ` [PATCH 04/13] xfsprogs: only install *format.h headers in install-qa Christoph Hellwig
2015-07-03 10:12 ` [PATCH 05/13] xfsprogs: remove install-qa target Christoph Hellwig
2015-07-03 10:12 ` [PATCH 06/13] xfsprogs: use <>-style includes in installed headers Christoph Hellwig
2015-07-03 10:12 ` [PATCH 07/13] xfsprogs: simplify internal includes Christoph Hellwig
2015-07-03 10:12 ` [PATCH 08/13] xfsprogs: move __be*/__le* types and __arch_pack to xfs_arch.h Christoph Hellwig
2015-07-03 10:12 ` [PATCH 09/13] xfsprogs: move __u*/__s* typedefs to per-port headers Christoph Hellwig
2015-07-03 10:12 ` [PATCH 10/13] xfsprogs: include libxfs.h in libxfs_priv.h Christoph Hellwig
2015-07-03 23:42   ` Dave Chinner
2015-07-03 10:12 ` [PATCH 11/13] xfsprogs: don't install platform_defs.h Christoph Hellwig
2015-07-03 10:12 ` [PATCH 12/13] xfsprogs: remove filldir_t typedef Christoph Hellwig
2015-07-03 10:12 ` [PATCH 13/13] xfsprogs: remove the constpp define Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox