Lines Matching refs:g
123 struct bucket *g = PTR_GC_BUCKET(ca, &p.ptr); in bch2_check_fix_ptr() local
124 if (!g) { in bch2_check_fix_ptr()
137 if (fsck_err_on(!g->gen_valid, in bch2_check_fix_ptr()
147 g->gen_valid = true; in bch2_check_fix_ptr()
148 g->gen = p.ptr.gen; in bch2_check_fix_ptr()
154 if (fsck_err_on(gen_cmp(p.ptr.gen, g->gen) > 0, in bch2_check_fix_ptr()
160 p.ptr.gen, g->gen, in bch2_check_fix_ptr()
164 (g->data_type != BCH_DATA_btree || in bch2_check_fix_ptr()
166 g->gen_valid = true; in bch2_check_fix_ptr()
167 g->gen = p.ptr.gen; in bch2_check_fix_ptr()
168 g->data_type = 0; in bch2_check_fix_ptr()
169 g->stripe_sectors = 0; in bch2_check_fix_ptr()
170 g->dirty_sectors = 0; in bch2_check_fix_ptr()
171 g->cached_sectors = 0; in bch2_check_fix_ptr()
177 if (fsck_err_on(gen_cmp(g->gen, p.ptr.gen) > BUCKET_GC_GEN_MAX, in bch2_check_fix_ptr()
181 p.ptr.dev, PTR_BUCKET_NR(ca, &p.ptr), g->gen, in bch2_check_fix_ptr()
188 if (fsck_err_on(!p.ptr.cached && gen_cmp(p.ptr.gen, g->gen) < 0, in bch2_check_fix_ptr()
194 p.ptr.gen, g->gen, in bch2_check_fix_ptr()
199 if (data_type != BCH_DATA_btree && p.ptr.gen != g->gen) in bch2_check_fix_ptr()
202 if (fsck_err_on(bucket_data_type_mismatch(g->data_type, data_type), in bch2_check_fix_ptr()
206 p.ptr.dev, PTR_BUCKET_NR(ca, &p.ptr), g->gen, in bch2_check_fix_ptr()
207 bch2_data_type_str(g->data_type), in bch2_check_fix_ptr()
212 g->gen_valid = true; in bch2_check_fix_ptr()
213 g->gen = p.ptr.gen; in bch2_check_fix_ptr()
214 g->data_type = data_type; in bch2_check_fix_ptr()
215 g->stripe_sectors = 0; in bch2_check_fix_ptr()
216 g->dirty_sectors = 0; in bch2_check_fix_ptr()
217 g->cached_sectors = 0; in bch2_check_fix_ptr()
297 struct bucket *g = PTR_GC_BUCKET(ca, ptr); in bch2_check_fix_ptrs() local
299 ptr->gen = g->gen; in bch2_check_fix_ptrs()
311 struct bucket *g = PTR_GC_BUCKET(ca, &p.ptr); in bch2_check_fix_ptrs() local
315 (!g->gen_valid || gen_cmp(p.ptr.gen, g->gen) > 0)) || in bch2_check_fix_ptrs()
317 gen_cmp(p.ptr.gen, g->gen) < 0) || in bch2_check_fix_ptrs()
318 gen_cmp(g->gen, p.ptr.gen) > BUCKET_GC_GEN_MAX || in bch2_check_fix_ptrs()
319 (g->data_type && in bch2_check_fix_ptrs()
320 g->data_type != data_type)) { in bch2_check_fix_ptrs()
603 struct bucket *g = gc_bucket(ca, bucket.offset); in bch2_trigger_pointer() local
604 if (bch2_fs_inconsistent_on(!g, c, "reference to invalid bucket on device %u\n %s", in bch2_trigger_pointer()
611 bucket_lock(g); in bch2_trigger_pointer()
612 struct bch_alloc_v4 old = bucket_m_to_alloc(*g), new = old; in bch2_trigger_pointer()
614 alloc_to_bucket(g, new); in bch2_trigger_pointer()
615 bucket_unlock(g); in bch2_trigger_pointer()
994 struct bucket *g = gc_bucket(ca, b); in bch2_mark_metadata_bucket() local
995 …if (bch2_fs_inconsistent_on(!g, c, "reference to invalid bucket on device %u when marking metadata… in bch2_mark_metadata_bucket()
999 bucket_lock(g); in bch2_mark_metadata_bucket()
1000 struct bch_alloc_v4 old = bucket_m_to_alloc(*g); in bch2_mark_metadata_bucket()
1002 if (bch2_fs_inconsistent_on(g->data_type && in bch2_mark_metadata_bucket()
1003 g->data_type != data_type, c, in bch2_mark_metadata_bucket()
1005 bch2_data_type_str(g->data_type), in bch2_mark_metadata_bucket()
1009 if (bch2_fs_inconsistent_on((u64) g->dirty_sectors + sectors > ca->mi.bucket_size, c, in bch2_mark_metadata_bucket()
1011 ca->dev_idx, b, g->gen, in bch2_mark_metadata_bucket()
1012 bch2_data_type_str(g->data_type ?: data_type), in bch2_mark_metadata_bucket()
1013 g->dirty_sectors, sectors)) in bch2_mark_metadata_bucket()
1016 g->data_type = data_type; in bch2_mark_metadata_bucket()
1017 g->dirty_sectors += sectors; in bch2_mark_metadata_bucket()
1018 struct bch_alloc_v4 new = bucket_m_to_alloc(*g); in bch2_mark_metadata_bucket()
1019 bucket_unlock(g); in bch2_mark_metadata_bucket()
1024 bucket_unlock(g); in bch2_mark_metadata_bucket()