SOURCES: xfsprogs-diet.patch (NEW) - changes required to build with dietlib...

baggins baggins at pld-linux.org
Thu Mar 19 16:49:02 CET 2009


Author: baggins                      Date: Thu Mar 19 15:49:02 2009 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- changes required to build with dietlibc (all with proper #ifdef __dietlibc)

---- Files affected:
SOURCES:
   xfsprogs-diet.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/xfsprogs-diet.patch
diff -u /dev/null SOURCES/xfsprogs-diet.patch:1.1
--- /dev/null	Thu Mar 19 16:49:03 2009
+++ SOURCES/xfsprogs-diet.patch	Thu Mar 19 16:48:57 2009
@@ -0,0 +1,164 @@
+--- xfsprogs-3.0.0/include/linux.h~	2009-02-04 23:29:25.000000000 +0100
++++ xfsprogs-3.0.0/include/linux.h	2009-03-19 16:19:35.000000000 +0100
+@@ -25,6 +25,9 @@
+ #include <malloc.h>
+ #include <getopt.h>
+ #include <endian.h>
++#ifdef __dietlibc__
++#include <xfs/xfs_types.h>
++#endif
+ 
+ static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
+ {
+diff -ur xfsprogs-3.0.0/include/project.h xfsprogs-3.0.0-diet/include/project.h
+--- xfsprogs-3.0.0/include/project.h	2009-02-04 23:29:25.000000000 +0100
++++ xfsprogs-3.0.0-diet/include/project.h	2009-03-19 12:55:05.000000000 +0100
+@@ -19,6 +19,9 @@
+ #define __PROJECT_H__
+ 
+ #include <xfs/xfs.h>
++#ifdef __dietlibc__
++#include <xfs/xfs_types.h>
++#endif
+ 
+ #if !defined(__sgi__)
+ typedef __uint32_t	prid_t;
+diff -ur xfsprogs-3.0.0/include/xfs_ialloc_btree.h xfsprogs-3.0.0-diet/include/xfs_ialloc_btree.h
+--- xfsprogs-3.0.0/include/xfs_ialloc_btree.h	2009-02-04 23:29:25.000000000 +0100
++++ xfsprogs-3.0.0-diet/include/xfs_ialloc_btree.h	2009-03-19 12:49:55.000000000 +0100
+@@ -18,6 +18,9 @@
+ #ifndef __XFS_IALLOC_BTREE_H__
+ #define	__XFS_IALLOC_BTREE_H__
+ 
++#ifdef __dietlibc__
++#define NBBY            CHAR_BIT
++#endif
+ /*
+  * Inode map on-disk structures
+  */
+diff -ur xfsprogs-3.0.0/include/xfs_types.h xfsprogs-3.0.0-diet/include/xfs_types.h
+--- xfsprogs-3.0.0/include/xfs_types.h	2009-02-04 23:29:25.000000000 +0100
++++ xfsprogs-3.0.0-diet/include/xfs_types.h	2009-03-19 12:40:08.000000000 +0100
+@@ -28,18 +28,6 @@
+ typedef unsigned int		uint_t;
+ typedef unsigned long		ulong_t;
+ 
+-/*
+- * Additional type declarations for XFS
+- */
+-typedef signed char		__int8_t;
+-typedef unsigned char		__uint8_t;
+-typedef signed short int	__int16_t;
+-typedef unsigned short int	__uint16_t;
+-typedef signed int		__int32_t;
+-typedef unsigned int		__uint32_t;
+-typedef signed long long int	__int64_t;
+-typedef unsigned long long int	__uint64_t;
+-
+ typedef enum { B_FALSE,B_TRUE }	boolean_t;
+ typedef __uint32_t		prid_t;		/* project ID */
+ typedef __uint32_t		inst_t;		/* an instruction */
+@@ -64,6 +52,20 @@
+ 
+ #endif	/* __KERNEL__ */
+ 
++#if defined(__dietlibc__) || defined(__KERNEL__)
++/*
++ * Additional type declarations for XFS
++ */
++typedef signed char		__int8_t;
++typedef unsigned char		__uint8_t;
++typedef signed short int	__int16_t;
++typedef unsigned short int	__uint16_t;
++typedef signed int		__int32_t;
++typedef unsigned int		__uint32_t;
++typedef signed long long int	__int64_t;
++typedef unsigned long long int	__uint64_t;
++#endif
++
+ typedef __uint32_t	xfs_agblock_t;	/* blockno in alloc. group */
+ typedef	__uint32_t	xfs_extlen_t;	/* extent length in blocks */
+ typedef	__uint32_t	xfs_agnumber_t;	/* allocation group number */
+diff -ur xfsprogs-3.0.0/libdisk/xvm.h xfsprogs-3.0.0-diet/libdisk/xvm.h
+--- xfsprogs-3.0.0/libdisk/xvm.h	2009-02-04 23:29:25.000000000 +0100
++++ xfsprogs-3.0.0-diet/libdisk/xvm.h	2009-03-19 12:56:54.000000000 +0100
+@@ -15,6 +15,9 @@
+  * along with this program; if not, write the Free Software Foundation,
+  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+  */
++#ifdef __dietlibc__
++#include <xfs/xfs_types.h>
++#endif
+ 
+ #define _DIOC_(x)        (('d'<<8) | x)
+ #define DIOCGETVOLDEV    _DIOC_(36) /* subvolume devices */
+diff -ur xfsprogs-3.0.0/libhandle/handle.c xfsprogs-3.0.0-diet/libhandle/handle.c
+--- xfsprogs-3.0.0/libhandle/handle.c	2009-02-04 23:29:25.000000000 +0100
++++ xfsprogs-3.0.0-diet/libhandle/handle.c	2009-03-19 12:56:03.000000000 +0100
+@@ -17,6 +17,10 @@
+ #include <xfs/xfs.h>
+ #include <xfs/handle.h>
+ #include <xfs/parent.h>
++#ifdef __dietlibc__
++#include <xfs/xfs_types.h>
++#include <linux/limits.h>
++#endif
+ 
+ /* just pick a value we know is more than big enough */
+ #define	MAXHANSIZ	64
+diff -ur xfsprogs-3.0.0/libhandle/jdm.c xfsprogs-3.0.0-diet/libhandle/jdm.c
+--- xfsprogs-3.0.0/libhandle/jdm.c	2009-02-04 23:29:25.000000000 +0100
++++ xfsprogs-3.0.0-diet/libhandle/jdm.c	2009-03-19 12:56:28.000000000 +0100
+@@ -17,6 +17,10 @@
+ #include <xfs/handle.h>
+ #include <xfs/jdm.h>
+ #include <xfs/parent.h>
++#ifdef __dietlibc__
++#include <xfs/xfs_types.h>
++#include <linux/limits.h>
++#endif
+ 
+ /* internal fshandle - typecast to a void for external use */
+ #define FSHANDLE_SZ		8
+diff -ur xfsprogs-3.0.0/libxfs/linux.c xfsprogs-3.0.0-diet/libxfs/linux.c
+--- xfsprogs-3.0.0/libxfs/linux.c	2009-02-04 23:29:25.000000000 +0100
++++ xfsprogs-3.0.0-diet/libxfs/linux.c	2009-03-19 13:30:12.000000000 +0100
+@@ -21,10 +21,23 @@
+ #include <mntent.h>
+ #include <sys/stat.h>
+ #undef ustat
++#ifndef __dietlibc__
+ #include <sys/ustat.h>
++#endif
+ #include <sys/mount.h>
+ #include <sys/ioctl.h>
+ #include <sys/sysinfo.h>
++#ifdef __dietlibc__
++#include <sys/types.h>
++
++struct ustat
++{
++	__daddr_t f_tfree;	/* Number of free blocks.  */
++	ino_t f_tinode;		/* Number of free inodes.  */
++	char f_fname[6];
++	char f_fpack[6];
++};
++#endif
+ 
+ int platform_has_uuid = 1;
+ extern char *progname;
+diff -ur xfsprogs-3.0.0/repair/prefetch.c xfsprogs-3.0.0-diet/repair/prefetch.c
+--- xfsprogs-3.0.0/repair/prefetch.c	2009-02-04 23:29:26.000000000 +0100
++++ xfsprogs-3.0.0-diet/repair/prefetch.c	2009-03-19 16:00:01.000000000 +0100
+@@ -735,7 +735,11 @@
+ {
+ 	mp = pmp;
+ 	mp_fd = libxfs_device_to_fd(mp->m_dev);
++#ifdef __dietlibc__
++	pf_max_bytes = sysconf(_SC_PAGESIZE) << 7;
++#else
+ 	pf_max_bytes = sysconf(_SC_PAGE_SIZE) << 7;
++#endif
+ 	pf_max_bbs = pf_max_bytes >> BBSHIFT;
+ 	pf_max_fsbs = pf_max_bytes >> mp->m_sb.sb_blocklog;
+ 	pf_batch_bytes = DEF_BATCH_BYTES;
================================================================


More information about the pld-cvs-commit mailing list