diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-04-30 16:48:21 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2021-04-30 18:23:38 -0400 |
commit | bb74624daa138837d04c2a9931723115b9b6d645 (patch) | |
tree | 8c2c310f0d08fc731f573d21f20494a87a686300 /libbcachefs/super-io.c | |
parent | a14d39d7ac45eebe45ed0772d1ed837f15b15af4 (diff) |
Update bcachefs sources to a5c0e1bb30 bcachefs: Clean up bch2_btree_and_journal_walk()
Diffstat (limited to 'libbcachefs/super-io.c')
-rw-r--r-- | libbcachefs/super-io.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libbcachefs/super-io.c b/libbcachefs/super-io.c index 11d7167b..74a75ced 100644 --- a/libbcachefs/super-io.c +++ b/libbcachefs/super-io.c @@ -367,9 +367,15 @@ static void bch2_sb_update(struct bch_fs *c) c->sb.clean = BCH_SB_CLEAN(src); c->sb.encryption_type = BCH_SB_ENCRYPTION_TYPE(src); c->sb.encoded_extent_max= 1 << BCH_SB_ENCODED_EXTENT_MAX_BITS(src); - c->sb.time_base_lo = le64_to_cpu(src->time_base_lo); + + c->sb.nsec_per_time_unit = le32_to_cpu(src->time_precision); + c->sb.time_units_per_sec = NSEC_PER_SEC / c->sb.nsec_per_time_unit; + + /* XXX this is wrong, we need a 96 or 128 bit integer type */ + c->sb.time_base_lo = div_u64(le64_to_cpu(src->time_base_lo), + c->sb.nsec_per_time_unit); c->sb.time_base_hi = le32_to_cpu(src->time_base_hi); - c->sb.time_precision = le32_to_cpu(src->time_precision); + c->sb.features = le64_to_cpu(src->features[0]); c->sb.compat = le64_to_cpu(src->compat[0]); |