]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/opts.h
Fix building on musl
[bcachefs-tools-debian] / libbcachefs / opts.h
index a20a09ee570e8f65a7474caaf2edcc52308d2b3e..ba49033523434e3aa07c8eaaa8c157ba133ae76e 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef _BCACHEFS_OPTS_H
 #define _BCACHEFS_OPTS_H
 
@@ -8,8 +9,9 @@
 #include "bcachefs_format.h"
 
 extern const char * const bch2_error_actions[];
-extern const char * const bch2_csum_types[];
-extern const char * const bch2_compression_types[];
+extern const char * const bch2_sb_features[];
+extern const char * const bch2_csum_opts[];
+extern const char * const bch2_compression_opts[];
 extern const char * const bch2_str_hash_types[];
 extern const char * const bch2_data_types[];
 extern const char * const bch2_cache_replacement_policies[];
@@ -67,6 +69,12 @@ enum opt_type {
  *  - helptext
  */
 
+#ifdef __KERNEL__
+#define RATELIMIT_ERRORS true
+#else
+#define RATELIMIT_ERRORS false
+#endif
+
 #define BCH_OPTS()                                                     \
        x(block_size,                   u16,                            \
          OPT_FORMAT,                                                   \
@@ -105,28 +113,28 @@ enum opt_type {
          "#",          NULL)                                           \
        x(metadata_checksum,            u8,                             \
          OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME,                             \
-         OPT_STR(bch2_csum_types),                                     \
+         OPT_STR(bch2_csum_opts),                                      \
          BCH_SB_META_CSUM_TYPE,        BCH_CSUM_OPT_CRC32C,            \
          NULL,         NULL)                                           \
        x(data_checksum,                u8,                             \
          OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME|OPT_INODE,                   \
-         OPT_STR(bch2_csum_types),                                     \
+         OPT_STR(bch2_csum_opts),                                      \
          BCH_SB_DATA_CSUM_TYPE,        BCH_CSUM_OPT_CRC32C,            \
          NULL,         NULL)                                           \
        x(compression,                  u8,                             \
          OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME|OPT_INODE,                   \
-         OPT_STR(bch2_compression_types),                              \
-         BCH_SB_COMPRESSION_TYPE,      BCH_COMPRESSION_OPT_NONE,       \
+         OPT_STR(bch2_compression_opts),                               \
+         BCH_SB_COMPRESSION_TYPE,      BCH_COMPRESSION_OPT_none,       \
          NULL,         NULL)                                           \
        x(background_compression,       u8,                             \
          OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME|OPT_INODE,                   \
-         OPT_STR(bch2_compression_types),                              \
-         BCH_SB_BACKGROUND_COMPRESSION_TYPE,BCH_COMPRESSION_OPT_NONE,  \
+         OPT_STR(bch2_compression_opts),                               \
+         BCH_SB_BACKGROUND_COMPRESSION_TYPE,BCH_COMPRESSION_OPT_none,  \
          NULL,         NULL)                                           \
        x(str_hash,                     u8,                             \
          OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME,                             \
          OPT_STR(bch2_str_hash_types),                                 \
-         BCH_SB_STR_HASH_TYPE,         BCH_STR_HASH_SIPHASH,           \
+         BCH_SB_STR_HASH_TYPE,         BCH_STR_HASH_OPT_SIPHASH,       \
          NULL,         "Hash function for directory entries and xattrs")\
        x(foreground_target,            u16,                            \
          OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME|OPT_INODE,                   \
@@ -174,6 +182,11 @@ enum opt_type {
          OPT_BOOL(),                                                   \
          BCH_SB_128_BIT_MACS,          false,                          \
          NULL,         "Store full 128 bits of cryptographic MACs, instead of 80")\
+       x(inline_data,                  u8,                             \
+         OPT_MOUNT|OPT_RUNTIME,                                        \
+         OPT_BOOL(),                                                   \
+         NO_SB_OPT,                    false,                          \
+         NULL,         "Enable inline data extents")                   \
        x(acl,                          u8,                             \
          OPT_FORMAT|OPT_MOUNT,                                         \
          OPT_BOOL(),                                                   \
@@ -219,29 +232,34 @@ enum opt_type {
        x(fsck,                         u8,                             \
          OPT_MOUNT,                                                    \
          OPT_BOOL(),                                                   \
-         NO_SB_OPT,                    true,                           \
+         NO_SB_OPT,                    false,                          \
          NULL,         "Run fsck on mount")                            \
        x(fix_errors,                   u8,                             \
          OPT_MOUNT,                                                    \
          OPT_BOOL(),                                                   \
          NO_SB_OPT,                    false,                          \
          NULL,         "Fix errors during fsck without asking")        \
+       x(ratelimit_errors,             u8,                             \
+         OPT_MOUNT,                                                    \
+         OPT_BOOL(),                                                   \
+         NO_SB_OPT,                    RATELIMIT_ERRORS,               \
+         NULL,         "Ratelimit error messages during fsck")         \
        x(nochanges,                    u8,                             \
          OPT_MOUNT,                                                    \
          OPT_BOOL(),                                                   \
          NO_SB_OPT,                    false,                          \
          NULL,         "Super read only mode - no writes at all will be issued,\n"\
                        "even if we have to replay the journal")        \
-       x(noreplay,                     u8,                             \
+       x(norecovery,                   u8,                             \
          OPT_MOUNT,                                                    \
          OPT_BOOL(),                                                   \
          NO_SB_OPT,                    false,                          \
-         NULL,         "Don't replay the journal (only for internal tools)")\
-       x(norecovery,                   u8,                             \
+         NULL,         "Don't replay the journal")                     \
+       x(keep_journal,                 u8,                             \
          OPT_MOUNT,                                                    \
          OPT_BOOL(),                                                   \
          NO_SB_OPT,                    false,                          \
-         NULL,         NULL)                                           \
+         NULL,         "Don't free journal entries/keys after startup")\
        x(noexcl,                       u8,                             \
          OPT_MOUNT,                                                    \
          OPT_BOOL(),                                                   \
@@ -262,6 +280,11 @@ enum opt_type {
          OPT_BOOL(),                                                   \
          NO_SB_OPT,                    false,                          \
          NULL,         "Don\'t start filesystem, only open devices")   \
+       x(reconstruct_alloc,            u8,                             \
+         OPT_MOUNT,                                                    \
+         OPT_BOOL(),                                                   \
+         NO_SB_OPT,                    false,                          \
+         NULL,         "Reconstruct alloc btree")                      \
        x(version_upgrade,              u8,                             \
          OPT_MOUNT,                                                    \
          OPT_BOOL(),                                                   \
@@ -288,13 +311,7 @@ enum opt_type {
          OPT_UINT(0, BCH_REPLICAS_MAX),                                \
          NO_SB_OPT,                    1,                              \
          "n",          "Data written to this device will be considered\n"\
-                       "to have already been replicated n times")      \
-       x(new_inode_updates,            u8,                             \
-         OPT_MOUNT,                                                    \
-         OPT_BOOL(),                                                   \
-         NO_SB_OPT,                    false,                          \
-         NULL,         "Enable new btree write-cache for inode updates")
-
+                       "to have already been replicated n times")
 
 struct bch_opts {
 #define x(_name, _bits, ...)   unsigned _name##_defined:1;