Lines Matching defs:bioc
5886 struct btrfs_io_context *bioc;
5888 bioc = kzalloc(
5895 if (!bioc)
5898 refcount_set(&bioc->refs, 1);
5900 bioc->fs_info = fs_info;
5901 bioc->replace_stripe_src = -1;
5902 bioc->full_stripe_logical = (u64)-1;
5904 return bioc;
5907 void btrfs_get_bioc(struct btrfs_io_context *bioc)
5909 WARN_ON(!refcount_read(&bioc->refs));
5910 refcount_inc(&bioc->refs);
5913 void btrfs_put_bioc(struct btrfs_io_context *bioc)
5915 if (!bioc)
5917 if (refcount_dec_and_test(&bioc->refs))
5918 kfree(bioc);
6083 struct btrfs_io_context *bioc,
6116 struct btrfs_io_stripe *old = &bioc->stripes[i];
6117 struct btrfs_io_stripe *new = &bioc->stripes[num_stripes + nr_extra_stripes];
6124 if (bioc->map_type & BTRFS_BLOCK_GROUP_RAID56_MASK)
6125 bioc->replace_stripe_src = i;
6137 struct btrfs_io_stripe *first = &bioc->stripes[num_stripes];
6138 struct btrfs_io_stripe *second = &bioc->stripes[num_stripes + 1];
6141 ASSERT(bioc->map_type & BTRFS_BLOCK_GROUP_DUP);
6156 bioc->replace_nr_stripes = nr_extra_stripes;
6273 struct btrfs_io_context *bioc = NULL;
6437 bioc = alloc_btrfs_io_context(fs_info, num_alloc_stripes);
6438 if (!bioc) {
6442 bioc->map_type = map->type;
6461 bioc->full_stripe_logical = em->start +
6464 set_io_stripe(&bioc->stripes[i], map,
6470 * stripe into the bioc.
6473 set_io_stripe(&bioc->stripes[i], map, stripe_index,
6484 handle_ops_on_dev_replace(op, bioc, dev_replace, logical,
6488 *bioc_ret = bioc;
6489 bioc->num_stripes = num_stripes;
6490 bioc->max_errors = max_errors;
6491 bioc->mirror_num = mirror_num;
8033 static void map_raid56_repair_block(struct btrfs_io_context *bioc,
8037 int data_stripes = nr_bioc_data_stripes(bioc);
8041 u64 stripe_start = bioc->full_stripe_logical +
8049 smap->dev = bioc->stripes[i].dev;
8050 smap->physical = bioc->stripes[i].physical +
8051 ((logical - bioc->full_stripe_logical) &
8072 struct btrfs_io_context *bioc = NULL;
8080 &bioc, smap, &mirror_ret, true);
8088 if (!bioc)
8092 if (bioc->map_type & BTRFS_BLOCK_GROUP_RAID56_MASK) {
8093 map_raid56_repair_block(bioc, smap, logical);
8097 ASSERT(mirror_num <= bioc->num_stripes);
8098 smap->dev = bioc->stripes[mirror_num - 1].dev;
8099 smap->physical = bioc->stripes[mirror_num - 1].physical;
8101 btrfs_put_bioc(bioc);