btrfs-progs: fsck-tests: Introduce test case with keyed data backref with the extent...
[platform/upstream/btrfs-progs.git] / libbtrfsutil / btrfsutil_internal.h
1 /*
2  * Copyright (C) 2018 Facebook
3  *
4  * This file is part of libbtrfsutil.
5  *
6  * libbtrfsutil is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * libbtrfsutil is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with libbtrfsutil.  If not, see <http://www.gnu.org/licenses/>.
18  */
19
20 #ifndef BTRFS_UTIL_INTERNAL_H
21 #define BTRFS_UTIL_INTERNAL_H
22
23 #include <asm/byteorder.h>
24
25 #include "btrfsutil.h"
26 #include "btrfs.h"
27 #include "btrfs_tree.h"
28
29 #define PUBLIC __attribute__((visibility("default")))
30
31 #define le16_to_cpu __le16_to_cpu
32 #define le32_to_cpu __le32_to_cpu
33 #define le64_to_cpu __le64_to_cpu
34
35 #define SAVE_ERRNO_AND_CLOSE(fd) do {   \
36         int saved_errno = errno;        \
37                                         \
38         close(fd);                      \
39         errno = saved_errno;            \
40 } while (0)
41
42 #endif /* BTRFS_UTIL_INTERNAL_H */