From: Tim Shimmin Date: Fri, 22 Oct 2004 14:38:06 +0000 (+0000) Subject: Get xfstests building on irix using root/toolroot. X-Git-Tag: v2.7.0~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb0c6f879eb00477c5ac2cb0a0479613e3c67d65;p=thirdparty%2Fxfsprogs-dev.git Get xfstests building on irix using root/toolroot. Merge of xfs-cmds-melb:slinx:19868a by kenmcd. Update to work with xfstests/src and ltp code. --- diff --git a/include/irix.h b/include/irix.h index 37d92eb35..dee627953 100644 --- a/include/irix.h +++ b/include/irix.h @@ -33,10 +33,14 @@ #ifndef __XFS_IRIX_H__ #define __XFS_IRIX_H__ +#include +#include #include #include #include #include +#include +#include #include #include #include @@ -67,7 +71,22 @@ typedef __int64_t xfs_ino_t; typedef __int32_t xfs_dev_t; typedef __int64_t xfs_daddr_t; typedef char* xfs_caddr_t; -typedef flock64_t xfs_flock64_t; + +#define xfs_flock64 flock64 +#define xfs_flock64_t struct flock64 + +typedef struct xfs_error_injection { + __int32_t fd; + __int32_t errtag; +} xfs_error_injection_t; + + +typedef struct xfs_fsop_bulkreq { + ino64_t *lastip; + __int32_t icount; + xfs_bstat_t *ubuffer; + __int32_t *ocount; +} xfs_fsop_bulkreq_t; #include #define __BYTE_ORDER BYTE_ORDER @@ -83,16 +102,40 @@ typedef flock64_t xfs_flock64_t; #define __inline__ __inline #endif -#define INT_MAX INT32_MAX -#define UINT_MAX UINT32_MAX -#define PATH_MAX MAXPATHLEN #define constpp char * const * -static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) +static __inline__ int xfsctl(const char *path, int fd, int cmd, void *arg) { - if (cmd >= 0 && cmd < XFS_FSOPS_COUNT) - return syssgi(SGI_XFS_FSOPERATIONS, fd, cmd, (void *)0, p); - return fcntl(fd, cmd, p); + if (cmd >= 0 && cmd < XFS_FSOPS_COUNT) { + /* + * We have a problem in that xfsctl takes 1 arg but + * some sgi xfs ops take an input arg and/or an output arg + * So have to special case the ops to decide if xfsctl arg + * is an input or an output argument. + */ + if (cmd == XFS_FS_GOINGDOWN) + return syssgi(SGI_XFS_FSOPERATIONS, fd, cmd, arg, 0); + return syssgi(SGI_XFS_FSOPERATIONS, fd, cmd, 0, arg); + } + switch (cmd) { + case SGI_FS_BULKSTAT: + return syssgi(SGI_FS_BULKSTAT, fd, + ((xfs_fsop_bulkreq_t*)arg)->lastip, + ((xfs_fsop_bulkreq_t*)arg)->icount, + ((xfs_fsop_bulkreq_t*)arg)->ubuffer, + ((xfs_fsop_bulkreq_t*)arg)->ocount); + case SGI_FS_BULKSTAT_SINGLE: + return syssgi(SGI_FS_BULKSTAT_SINGLE, fd, + ((xfs_fsop_bulkreq_t*)arg)->lastip, + ((xfs_fsop_bulkreq_t*)arg)->ubuffer); + case SGI_XFS_INJECT_ERROR: + return syssgi(SGI_XFS_INJECT_ERROR, + ((xfs_error_injection_t*)arg)->errtag, + fd); + case SGI_XFS_CLEARALL_ERROR: + return syssgi(SGI_XFS_CLEARALL_ERROR, fd); + } + return fcntl(fd, cmd, arg); } static __inline__ int platform_test_xfs_fd(int fd) @@ -152,15 +195,17 @@ static __inline__ char * strsep(char **s, const char *ct) #define XFS_IOC_FREESP64 F_FREESP64 #define XFS_IOC_GETBMAP F_GETBMAP #define XFS_IOC_FSSETDM F_FSSETDM +#define XFS_IOC_RESVSP F_RESVSP #define XFS_IOC_RESVSP64 F_RESVSP64 +#define XFS_IOC_UNRESVSP F_UNRESVSP #define XFS_IOC_UNRESVSP64 F_UNRESVSP64 #define XFS_IOC_GETBMAPA F_GETBMAPA #define XFS_IOC_FSGETXATTRA F_FSGETXATTRA #define XFS_IOC_GETBMAPX F_GETBMAPX #define XFS_IOC_FSGEOMETRY_V1 XFS_FS_GEOMETRY -#define XFS_IOC_FSBULKSTAT /* TODO */ -#define XFS_IOC_FSBULKSTAT_SINGLE /* TODO */ +#define XFS_IOC_FSBULKSTAT SGI_FS_BULKSTAT +#define XFS_IOC_FSBULKSTAT_SINGLE SGI_FS_BULKSTAT_SINGLE #define XFS_IOC_FSINUMBERS /* TODO */ #define XFS_IOC_PATH_TO_FSHANDLE /* TODO */ #define XFS_IOC_PATH_TO_HANDLE /* TODO */ @@ -174,8 +219,8 @@ static __inline__ char * strsep(char **s, const char *ct) #define XFS_IOC_FSCOUNTS XFS_FS_COUNTS #define XFS_IOC_SET_RESBLKS XFS_SET_RESBLKS #define XFS_IOC_GET_RESBLKS XFS_GET_RESBLKS -#define XFS_IOC_ERROR_INJECTION /* TODO */ -#define XFS_IOC_ERROR_CLEARALL /* TODO */ +#define XFS_IOC_ERROR_INJECTION SGI_XFS_INJECT_ERROR +#define XFS_IOC_ERROR_CLEARALL SGI_XFS_CLEARALL_ERROR #define XFS_IOC_FREEZE XFS_FS_FREEZE #define XFS_IOC_THAW XFS_FS_THAW #define XFS_IOC_FSSETDM_BY_HANDLE /* TODO */