]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - include/gnukfreebsd.h
2 * Copyright (c) 2004-2006 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #ifndef __XFS_KFREEBSD_H__
19 #define __XFS_KFREEBSD_H__
21 #include <uuid/uuid.h>
23 #include <sys/ioctl.h>
24 #include <sys/sysmacros.h>
29 #include <sys/param.h>
30 #include <sys/mount.h>
36 #define constpp char * const *
38 #define EFSCORRUPTED 990 /* Filesystem is corrupted */
39 #define EFSBADCRC 991 /* Bad CRC detected */
41 typedef off_t xfs_off_t
;
42 typedef __uint64_t xfs_ino_t
;
43 typedef __uint32_t xfs_dev_t
;
44 typedef __int64_t xfs_daddr_t
;
48 static __inline__
int xfsctl(const char *path
, int fd
, int cmd
, void *p
)
50 return ioctl(fd
, cmd
, p
);
53 static __inline__
int platform_test_xfs_fd(int fd
)
56 if (fstatfs(fd
, &buf
) < 0)
58 return strncmp(buf
.f_fstypename
, "xfs", 4) == 0;
61 static __inline__
int platform_test_xfs_path(const char *path
)
64 if (statfs(path
, &buf
) < 0)
66 return strncmp(buf
.f_fstypename
, "xfs", 4) == 0;
69 static __inline__
int platform_fstatfs(int fd
, struct statfs
*buf
)
71 return fstatfs(fd
, buf
);
74 static __inline__
void platform_getoptreset(void)
80 static __inline__
int platform_uuid_compare(uuid_t
*uu1
, uuid_t
*uu2
)
82 return uuid_compare(*uu1
, *uu2
);
85 static __inline__
void platform_uuid_unparse(uuid_t
*uu
, char *buffer
)
87 uuid_unparse(*uu
, buffer
);
90 static __inline__
int platform_uuid_parse(char *buffer
, uuid_t
*uu
)
92 return uuid_parse(buffer
, *uu
);
95 static __inline__
int platform_uuid_is_null(uuid_t
*uu
)
97 return uuid_is_null(*uu
);
100 static __inline__
void platform_uuid_generate(uuid_t
*uu
)
105 static __inline__
void platform_uuid_clear(uuid_t
*uu
)
110 static __inline__
void platform_uuid_copy(uuid_t
*dst
, uuid_t
*src
)
112 uuid_copy(*dst
, *src
);
115 static __inline__
int
116 platform_discard_blocks(int fd
, uint64_t start
, uint64_t len
)
121 #endif /* __XFS_KFREEBSD_H__ */