Lines Matching refs:bioc
83 queue_work(rbio->bioc->fs_info->rmw_workers, &rbio->work); in start_async_work()
157 rbio->bioc->fs_info->sectorsize); in cache_rbio_pages()
168 u64 num = rbio->bioc->raid_map[0]; in rbio_bucket()
184 const u32 sectorsize = rbio->bioc->fs_info->sectorsize; in full_page_sectors_uptodate()
206 const u32 sectorsize = rbio->bioc->fs_info->sectorsize; in index_stripe_sectors()
222 const u32 sectorsize = src->bioc->fs_info->sectorsize; in steal_rbio_page()
298 table = rbio->bioc->fs_info->stripe_hash_table; in __remove_rbio_from_cache()
353 table = rbio->bioc->fs_info->stripe_hash_table; in remove_rbio_from_cache()
413 table = rbio->bioc->fs_info->stripe_hash_table; in cache_rbio()
512 if (last->bioc->raid_map[0] != cur->bioc->raid_map[0]) in rbio_can_merge()
621 h = rbio->bioc->fs_info->stripe_hash_table->table + rbio_bucket(rbio); in lock_stripe_add()
625 if (cur->bioc->raid_map[0] != rbio->bioc->raid_map[0]) in lock_stripe_add()
703 h = rbio->bioc->fs_info->stripe_hash_table->table + bucket; in unlock_stripe()
790 btrfs_put_bioc(rbio->bioc); in __free_raid_bio()
862 0 : rbio->bioc->max_errors; in raid_write_end_io()
913 struct btrfs_io_context *bioc) in alloc_rbio() argument
915 const unsigned int real_stripes = bioc->num_stripes - bioc->num_tgtdevs; in alloc_rbio()
946 btrfs_get_bioc(bioc); in alloc_rbio()
947 rbio->bioc = bioc; in alloc_rbio()
974 ASSERT(btrfs_nr_parity_stripes(bioc->map_type)); in alloc_rbio()
975 rbio->nr_data = real_stripes - btrfs_nr_parity_stripes(bioc->map_type); in alloc_rbio()
1021 const u32 sectorsize = rbio->bioc->fs_info->sectorsize; in rbio_add_io_sector()
1033 ASSERT(stripe_nr >= 0 && stripe_nr < rbio->bioc->num_stripes); in rbio_add_io_sector()
1037 stripe = &rbio->bioc->stripes[stripe_nr]; in rbio_add_io_sector()
1093 const u32 sectorsize = rbio->bioc->fs_info->sectorsize; in index_one_bio()
1097 rbio->bioc->raid_map[0]; in index_one_bio()
1136 const struct btrfs_io_context *bioc = rbio->bioc; in bio_get_trace_info() local
1139 ASSERT(bioc); in bio_get_trace_info()
1145 for (i = 0; i < bioc->num_stripes; i++) { in bio_get_trace_info()
1146 if (bio->bi_bdev != bioc->stripes[i].dev->bdev) in bio_get_trace_info()
1149 trace_info->devid = bioc->stripes[i].dev->devid; in bio_get_trace_info()
1151 bioc->stripes[i].physical; in bio_get_trace_info()
1171 struct btrfs_io_context *bioc = rbio->bioc; in finish_rmw() local
1172 const u32 sectorsize = bioc->fs_info->sectorsize; in finish_rmw()
1291 if (likely(!bioc->num_tgtdevs)) in finish_rmw()
1301 if (!bioc->tgtdev_map[stripe]) { in finish_rmw()
1324 rbio->bioc->tgtdev_map[stripe], in finish_rmw()
1368 for (i = 0; i < rbio->bioc->num_stripes; i++) { in find_bio_stripe()
1369 stripe = &rbio->bioc->stripes[i]; in find_bio_stripe()
1390 u64 stripe_start = rbio->bioc->raid_map[i]; in find_logical_bio_stripe()
1469 const u32 sectorsize = rbio->bioc->fs_info->sectorsize; in set_bio_pages_uptodate()
1501 queue_work(rbio->bioc->fs_info->endio_raid56_workers, in raid56_bio_end_io()
1518 if (atomic_read(&rbio->error) > rbio->bioc->max_errors) { in raid56_rmw_end_io_work()
1775 const struct btrfs_fs_info *fs_info = rbio->bioc->fs_info; in rbio_add_bio()
1777 const u64 full_stripe_start = rbio->bioc->raid_map[0]; in rbio_add_bio()
1802 void raid56_parity_write(struct bio *bio, struct btrfs_io_context *bioc) in raid56_parity_write() argument
1804 struct btrfs_fs_info *fs_info = bioc->fs_info; in raid56_parity_write()
1810 rbio = alloc_rbio(fs_info, bioc); in raid56_parity_write()
1861 const u32 sectorsize = rbio->bioc->fs_info->sectorsize; in __raid_recover_end_io()
1937 if (rbio->bioc->map_type & BTRFS_BLOCK_GROUP_RAID6) { in __raid_recover_end_io()
1966 if (rbio->bioc->raid_map[failb] == RAID6_Q_STRIPE) { in __raid_recover_end_io()
1967 if (rbio->bioc->raid_map[faila] == in __raid_recover_end_io()
1979 if (rbio->bioc->raid_map[failb] == RAID5_P_STRIPE) { in __raid_recover_end_io()
2086 if (atomic_read(&rbio->error) > rbio->bioc->max_errors) in raid_recover_end_io_work()
2151 if (atomic_read(&rbio->error) <= rbio->bioc->max_errors) { in __raid56_parity_recover()
2196 void raid56_parity_recover(struct bio *bio, struct btrfs_io_context *bioc, in raid56_parity_recover() argument
2199 struct btrfs_fs_info *fs_info = bioc->fs_info; in raid56_parity_recover()
2202 rbio = alloc_rbio(fs_info, bioc); in raid56_parity_recover()
2216 (u64)bio->bi_iter.bi_size, bioc->map_type); in raid56_parity_recover()
2280 struct btrfs_io_context *bioc, in raid56_parity_alloc_scrub_rbio() argument
2284 struct btrfs_fs_info *fs_info = bioc->fs_info; in raid56_parity_alloc_scrub_rbio()
2288 rbio = alloc_rbio(fs_info, bioc); in raid56_parity_alloc_scrub_rbio()
2305 if (bioc->stripes[i].dev == scrub_dev) { in raid56_parity_alloc_scrub_rbio()
2320 const u32 sectorsize = rbio->bioc->fs_info->sectorsize; in raid56_add_scrub_pages()
2324 ASSERT(logical >= rbio->bioc->raid_map[0]); in raid56_add_scrub_pages()
2325 ASSERT(logical + sectorsize <= rbio->bioc->raid_map[0] + in raid56_add_scrub_pages()
2327 stripe_offset = (int)(logical - rbio->bioc->raid_map[0]); in raid56_add_scrub_pages()
2339 const u32 sectorsize = rbio->bioc->fs_info->sectorsize; in alloc_rbio_essential_pages()
2364 struct btrfs_io_context *bioc = rbio->bioc; in finish_parity_scrub() local
2365 const u32 sectorsize = bioc->fs_info->sectorsize; in finish_parity_scrub()
2388 if (bioc->num_tgtdevs && bioc->tgtdev_map[rbio->scrubp]) { in finish_parity_scrub()
2495 bioc->tgtdev_map[rbio->scrubp], in finish_parity_scrub()
2547 if (atomic_read(&rbio->error) > rbio->bioc->max_errors) in validate_rbio_for_parity_scrub()
2568 if (dfail > rbio->bioc->max_errors - 1) in validate_rbio_for_parity_scrub()
2728 raid56_alloc_missing_rbio(struct bio *bio, struct btrfs_io_context *bioc) in raid56_alloc_missing_rbio() argument
2730 struct btrfs_fs_info *fs_info = bioc->fs_info; in raid56_alloc_missing_rbio()
2733 rbio = alloc_rbio(fs_info, bioc); in raid56_alloc_missing_rbio()
2749 bioc->raid_map[0]); in raid56_alloc_missing_rbio()