btrfs-progs: updated and add missing function attributes to the definition
[platform/upstream/btrfs-progs.git] / fsfeatures.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public
4  * License v2 as published by the Free Software Foundation.
5  *
6  * This program is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9  * General Public License for more details.
10  *
11  * You should have received a copy of the GNU General Public
12  * License along with this program; if not, write to the
13  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
14  * Boston, MA 021110-1307, USA.
15  */
16
17 #ifndef __BTRFS_FSFEATURES_H__
18 #define __BTRFS_FSFEATURES_H__
19
20 #include "kerncompat.h"
21
22 #define BTRFS_MKFS_DEFAULT_NODE_SIZE SZ_16K
23 #define BTRFS_MKFS_DEFAULT_FEATURES                             \
24                 (BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF           \
25                 | BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA)
26
27 /*
28  * Avoid multi-device features (RAID56) and mixed block groups
29  */
30 #define BTRFS_CONVERT_ALLOWED_FEATURES                          \
31         (BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF                   \
32         | BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL                 \
33         | BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO                   \
34         | BTRFS_FEATURE_INCOMPAT_COMPRESS_ZSTD                  \
35         | BTRFS_FEATURE_INCOMPAT_BIG_METADATA                   \
36         | BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF                  \
37         | BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA                \
38         | BTRFS_FEATURE_INCOMPAT_NO_HOLES)
39
40 #define BTRFS_FEATURE_LIST_ALL          (1ULL << 63)
41
42 void btrfs_list_all_fs_features(u64 mask_disallowed);
43 char* btrfs_parse_fs_features(char *namelist, u64 *flags);
44 void btrfs_process_fs_features(u64 flags);
45 void btrfs_parse_features_to_string(char *buf, u64 flags);
46 void print_kernel_version(FILE *stream, u32 version);
47 u32 get_running_kernel_version(void);
48 int btrfs_check_nodesize(u32 nodesize, u32 sectorsize, u64 features);
49
50 #endif