• Kent Overstreet's avatar
    bcachefs: Fold bucket_state in to BCH_DATA_TYPES() · 822835ff
    Kent Overstreet authored
    Previously, we were missing accounting for buckets in need_gc_gens and
    need_discard states. This matters because buckets in those states need
    other btree operations done before they can be used, so they can't be
    conuted when checking current number of free buckets against the
    allocation watermark.
    
    Also, we weren't directly counting free buckets at all. Now, data type 0
    == BCH_DATA_free, and free buckets are counted; this means we can get
    rid of the separate (poorly defined) count of unavailable buckets.
    
    This is a new on disk format version, with upgrade and fsck required for
    the accounting changes.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
    822835ff
buckets.h 8.26 KB