update for bcachefs changes

This commit is contained in:
Kent Overstreet 2017-12-27 20:35:45 -05:00
parent d77921a153
commit 9d2dfea54b

View File

@ -105,7 +105,8 @@ static void mark_unreserved_space(struct bch_fs *c, ranges extents)
b = sector_to_bucket(ca, i.start >> 9); b = sector_to_bucket(ca, i.start >> 9);
do { do {
bucket_cmpxchg(&ca->buckets[b], new, new.nouse = 1); struct bucket *g = bucket(ca, b);
bucket_cmpxchg(g, new, new.nouse = 1);
b++; b++;
} while (bucket_to_sector(ca, b) << 9 < i.end); } while (bucket_to_sector(ca, b) << 9 < i.end);
} }
@ -324,7 +325,7 @@ static void link_data(struct bch_fs *c, struct bch_inode_unpacked *dst,
extent_ptr_append(e, (struct bch_extent_ptr) { extent_ptr_append(e, (struct bch_extent_ptr) {
.offset = physical, .offset = physical,
.dev = 0, .dev = 0,
.gen = ca->buckets[b].mark.gen, .gen = bucket(ca, b)->mark.gen,
}); });
ret = bch2_disk_reservation_get(c, &res, sectors, ret = bch2_disk_reservation_get(c, &res, sectors,