]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/opts.h
Update bcachefs sources to bee7b5a4fa21 bcachefs: Pin btree cache in ram for random...
[bcachefs-tools-debian] / libbcachefs / opts.h
index 2307cdd2a23cd18ad324d223aefef231ea7cb857..f8c2341e8d3d32aff0e1536efcc189dd1088e863 100644 (file)
@@ -10,7 +10,6 @@
 
 struct bch_fs;
 
-extern const char * const bch2_iops_measurements[];
 extern const char * const bch2_error_actions[];
 extern const char * const bch2_fsck_fix_opts[];
 extern const char * const bch2_version_upgrade_opts[];
@@ -19,11 +18,11 @@ extern const char * const bch2_sb_compat[];
 extern const char * const __bch2_btree_ids[];
 extern const char * const bch2_csum_types[];
 extern const char * const bch2_csum_opts[];
-extern const char * const bch2_compression_types[];
+extern const char * const __bch2_compression_types[];
 extern const char * const bch2_compression_opts[];
 extern const char * const bch2_str_hash_types[];
 extern const char * const bch2_str_hash_opts[];
-extern const char * const bch2_data_types[];
+extern const char * const __bch2_data_types[];
 extern const char * const bch2_member_states[];
 extern const char * const bch2_jset_entry_types[];
 extern const char * const bch2_fs_usage_types[];
@@ -234,11 +233,6 @@ enum fsck_err_opts {
          OPT_BOOL(),                                                   \
          BCH2_NO_SB_OPT,               true,                           \
          NULL,         "Stash pointer to in memory btree node in btree ptr")\
-       x(btree_write_buffer_size, u32,                                 \
-         OPT_FS|OPT_MOUNT,                                             \
-         OPT_UINT(16, (1U << 20) - 1),                                 \
-         BCH2_NO_SB_OPT,               1U << 13,                       \
-         NULL,         "Number of btree write buffer entries")         \
        x(gc_reserve_percent,           u8,                             \
          OPT_FS|OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME,                      \
          OPT_UINT(5, 21),                                              \
@@ -338,6 +332,11 @@ enum fsck_err_opts {
          OPT_BOOL(),                                                   \
          BCH2_NO_SB_OPT,               false,                          \
          NULL,         "Run fsck on mount")                            \
+       x(fsck_memory_usage_percent,    u8,                             \
+         OPT_FS|OPT_MOUNT,                                             \
+         OPT_UINT(20, 70),                                             \
+         BCH2_NO_SB_OPT,               50,                             \
+         NULL,         "Maximum percentage of system ram fsck is allowed to pin")\
        x(fix_errors,                   u8,                             \
          OPT_FS|OPT_MOUNT,                                             \
          OPT_FN(bch2_opt_fix_errors),                                  \
@@ -395,7 +394,7 @@ enum fsck_err_opts {
          BCH2_NO_SB_OPT,               BCH_SB_SECTOR,                  \
          "offset",     "Sector offset of superblock")                  \
        x(read_only,                    u8,                             \
-         OPT_FS,                                                       \
+         OPT_FS|OPT_MOUNT,                                             \
          OPT_BOOL(),                                                   \
          BCH2_NO_SB_OPT,               false,                          \
          NULL,         NULL)                                           \
@@ -420,6 +419,11 @@ enum fsck_err_opts {
          OPT_BOOL(),                                                   \
          BCH2_NO_SB_OPT,               false,                          \
          NULL,         "Allocate the buckets_nouse bitmap")            \
+       x(stdio,                        u64,                            \
+         0,                                                            \
+         OPT_UINT(0, S64_MAX),                                         \
+         BCH2_NO_SB_OPT,               false,                          \
+         NULL,         "Pointer to a struct stdio_redirect")           \
        x(project,                      u8,                             \
          OPT_INODE,                                                    \
          OPT_BOOL(),                                                   \
@@ -459,7 +463,13 @@ enum fsck_err_opts {
          OPT_UINT(0, BCH_REPLICAS_MAX),                                \
          BCH2_NO_SB_OPT,               1,                              \
          "n",          "Data written to this device will be considered\n"\
-                       "to have already been replicated n times")
+                       "to have already been replicated n times")      \
+       x(btree_node_prefetch,          u8,                             \
+         OPT_FS|OPT_MOUNT|OPT_RUNTIME,                                 \
+         OPT_BOOL(),                                                   \
+         BCH2_NO_SB_OPT,               true,                           \
+         NULL,         "BTREE_ITER_PREFETCH casuse btree nodes to be\n"\
+         " prefetched sequentially")
 
 struct bch_opts {
 #define x(_name, _bits, ...)   unsigned _name##_defined:1;
@@ -559,6 +569,11 @@ struct bch_io_opts {
 #undef x
 };
 
+static inline unsigned background_compression(struct bch_io_opts opts)
+{
+       return opts.background_compression ?: opts.compression;
+}
+
 struct bch_io_opts bch2_opts_to_inode_opts(struct bch_opts);
 bool bch2_opt_is_inode_opt(enum bch_opt_id);