]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - include/linux.h
2 * Copyright (c) 2004-2005 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, write the Free Software Foundation,
15 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 #ifndef __XFS_LINUX_H__
18 #define __XFS_LINUX_H__
20 #include <uuid/uuid.h>
22 #include <sys/ioctl.h>
23 #include <sys/param.h>
24 #include <linux/types.h>
30 static __inline__
int xfsctl(const char *path
, int fd
, int cmd
, void *p
)
32 return ioctl(fd
, cmd
, p
);
35 static __inline__
int platform_test_xfs_fd(int fd
)
38 if (fstatfs(fd
, &buf
) < 0)
40 return (buf
.f_type
== 0x58465342); /* XFSB */
43 static __inline__
int platform_test_xfs_path(const char *path
)
46 if (statfs(path
, &buf
) < 0)
48 return (buf
.f_type
== 0x58465342); /* XFSB */
51 static __inline__
int platform_fstatfs(int fd
, struct statfs
*buf
)
53 return fstatfs(fd
, buf
);
56 static __inline__
void platform_getoptreset(void)
63 # if defined (__powerpc__)
64 # define O_DIRECT 0400000
65 # elif defined (__sparc__)
66 # define O_DIRECT 0x100000
70 #if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ <= 1))
71 # define constpp const char * const *
73 # define constpp char * const *
76 #define ENOATTR ENODATA /* Attribute not found */
77 #define EFSCORRUPTED 990 /* Filesystem is corrupted */
79 typedef loff_t xfs_off_t
;
80 typedef __uint64_t xfs_ino_t
;
81 typedef __uint32_t xfs_dev_t
;
82 typedef __int64_t xfs_daddr_t
;
83 typedef char* xfs_caddr_t
;
85 #ifndef _UCHAR_T_DEFINED
86 typedef unsigned char uchar_t
;
87 #define _UCHAR_T_DEFINED 1
90 #ifndef _BOOLEAN_T_DEFINED
91 typedef enum {B_FALSE
, B_TRUE
} boolean_t
;
92 #define _BOOLEAN_T_DEFINED 1
95 #endif /* __XFS_IRIX_H__ */