@@ -513,6 +513,7 @@ struct bch_sb_field {
513513#include "snapshot_format.h"
514514#include "subvolume_format.h"
515515#include "sb-counters_format.h"
516+ #include "sb-members_format.h"
516517
517518enum bch_sb_field_type {
518519#define x(f, nr) BCH_SB_FIELD_##f = nr,
@@ -545,106 +546,6 @@ struct bch_sb_field_journal_v2 {
545546 } d [];
546547};
547548
548- /* BCH_SB_FIELD_members_v1: */
549-
550- #define BCH_MIN_NR_NBUCKETS (1 << 6)
551-
552- #define BCH_IOPS_MEASUREMENTS () \
553- x(seqread, 0) \
554- x(seqwrite, 1) \
555- x(randread, 2) \
556- x(randwrite, 3)
557-
558- enum bch_iops_measurement {
559- #define x(t, n) BCH_IOPS_##t = n,
560- BCH_IOPS_MEASUREMENTS ()
561- #undef x
562- BCH_IOPS_NR
563- };
564-
565- #define BCH_MEMBER_ERROR_TYPES () \
566- x(read, 0) \
567- x(write, 1) \
568- x(checksum, 2)
569-
570- enum bch_member_error_type {
571- #define x(t, n) BCH_MEMBER_ERROR_##t = n,
572- BCH_MEMBER_ERROR_TYPES ()
573- #undef x
574- BCH_MEMBER_ERROR_NR
575- };
576-
577- struct bch_member {
578- __uuid_t uuid ;
579- __le64 nbuckets ; /* device size */
580- __le16 first_bucket ; /* index of first bucket used */
581- __le16 bucket_size ; /* sectors */
582- __u8 btree_bitmap_shift ;
583- __u8 pad [3 ];
584- __le64 last_mount ; /* time_t */
585-
586- __le64 flags ;
587- __le32 iops [4 ];
588- __le64 errors [BCH_MEMBER_ERROR_NR ];
589- __le64 errors_at_reset [BCH_MEMBER_ERROR_NR ];
590- __le64 errors_reset_time ;
591- __le64 seq ;
592- __le64 btree_allocated_bitmap ;
593- /*
594- * On recovery from a clean shutdown we don't normally read the journal,
595- * but we still want to resume writing from where we left off so we
596- * don't overwrite more than is necessary, for list journal debugging:
597- */
598- __le32 last_journal_bucket ;
599- __le32 last_journal_bucket_offset ;
600- };
601-
602- /*
603- * This limit comes from the bucket_gens array - it's a single allocation, and
604- * kernel allocation are limited to INT_MAX
605- */
606- #define BCH_MEMBER_NBUCKETS_MAX (INT_MAX - 64)
607-
608- #define BCH_MEMBER_V1_BYTES 56
609-
610- LE64_BITMASK (BCH_MEMBER_STATE , struct bch_member , flags , 0 , 4 )
611- /* 4-14 unused, was TIER, HAS_(META)DATA, REPLACEMENT */
612- LE64_BITMASK (BCH_MEMBER_DISCARD , struct bch_member , flags , 14 , 15 )
613- LE64_BITMASK (BCH_MEMBER_DATA_ALLOWED , struct bch_member , flags , 15 , 20 )
614- LE64_BITMASK (BCH_MEMBER_GROUP , struct bch_member , flags , 20 , 28 )
615- LE64_BITMASK (BCH_MEMBER_DURABILITY , struct bch_member , flags , 28 , 30 )
616- LE64_BITMASK (BCH_MEMBER_FREESPACE_INITIALIZED ,
617- struct bch_member , flags , 30 , 31 )
618-
619- #if 0
620- LE64_BITMASK (BCH_MEMBER_NR_READ_ERRORS , struct bch_member , flags [1 ], 0 , 20 );
621- LE64_BITMASK (BCH_MEMBER_NR_WRITE_ERRORS ,struct bch_member , flags [1 ], 20 , 40 );
622- #endif
623-
624- #define BCH_MEMBER_STATES () \
625- x(rw, 0) \
626- x(ro, 1) \
627- x(failed, 2) \
628- x(spare, 3)
629-
630- enum bch_member_state {
631- #define x(t, n) BCH_MEMBER_STATE_##t = n,
632- BCH_MEMBER_STATES ()
633- #undef x
634- BCH_MEMBER_STATE_NR
635- };
636-
637- struct bch_sb_field_members_v1 {
638- struct bch_sb_field field ;
639- struct bch_member _members []; //Members are now variable size
640- };
641-
642- struct bch_sb_field_members_v2 {
643- struct bch_sb_field field ;
644- __le16 member_bytes ; //size of single member entry
645- u8 pad [6 ];
646- struct bch_member _members [];
647- };
648549
649550/* BCH_SB_FIELD_crypt: */
650551
@@ -909,7 +810,6 @@ unsigned bcachefs_metadata_required_upgrade_below = bcachefs_metadata_version_re
909810#define bcachefs_metadata_version_current (bcachefs_metadata_version_max - 1)
910811
911812#define BCH_SB_SECTOR 8
912- #define BCH_SB_MEMBERS_MAX 64 /* XXX kill */
913813
914814#define BCH_SB_LAYOUT_SIZE_BITS_MAX 16 /* 32 MB */
915815
0 commit comments