Lines Matching refs:map

1292 				   struct btrfs_chunk_map *map, u64 *offset,
1298 const int data_stripes = nr_data_stripes(map);
1300 last_offset = (physical - map->stripes[num].physical) * data_stripes;
1315 rot = stripe_nr % map->num_stripes;
1318 stripe_index = rot % map->num_stripes;
1926 struct btrfs_chunk_map *map,
1938 const int data_stripes = nr_data_stripes(map);
1963 stripe_index = (i + rot) % map->num_stripes;
1964 physical = map->stripes[stripe_index].physical +
1970 map->stripes[stripe_index].dev, physical, 1,
1982 stripe->dev = map->stripes[stripe_index].dev;
2095 struct btrfs_chunk_map *map,
2156 static u64 simple_stripe_full_stripe_len(const struct btrfs_chunk_map *map)
2158 ASSERT(map->type & (BTRFS_BLOCK_GROUP_RAID0 |
2161 return btrfs_stripe_nr_to_offset(map->num_stripes / map->sub_stripes);
2165 static u64 simple_stripe_get_logical(struct btrfs_chunk_map *map,
2169 ASSERT(map->type & (BTRFS_BLOCK_GROUP_RAID0 |
2171 ASSERT(stripe_index < map->num_stripes);
2177 return btrfs_stripe_nr_to_offset(stripe_index / map->sub_stripes) +
2182 static int simple_stripe_mirror_num(struct btrfs_chunk_map *map, int stripe_index)
2184 ASSERT(map->type & (BTRFS_BLOCK_GROUP_RAID0 |
2186 ASSERT(stripe_index < map->num_stripes);
2189 return stripe_index % map->sub_stripes + 1;
2194 struct btrfs_chunk_map *map,
2198 const u64 logical_increment = simple_stripe_full_stripe_len(map);
2199 const u64 orig_logical = simple_stripe_get_logical(map, bg, stripe_index);
2200 const u64 orig_physical = map->stripes[stripe_index].physical;
2201 const int mirror_num = simple_stripe_mirror_num(map, stripe_index);
2212 ret = scrub_simple_mirror(sctx, bg, map, cur_logical,
2227 struct btrfs_chunk_map *map,
2232 const u64 profile = map->type & BTRFS_BLOCK_GROUP_PROFILE_MASK;
2236 u64 physical = map->stripes[stripe_index].physical;
2237 const u64 dev_stripe_len = btrfs_calc_stripe_length(map);
2264 sctx->raid56_data_stripes = kcalloc(nr_data_stripes(map),
2271 for (int i = 0; i < nr_data_stripes(map); i++) {
2297 ret = scrub_simple_mirror(sctx, bg, map, bg->start, bg->length,
2298 scrub_dev, map->stripes[stripe_index].physical,
2304 ret = scrub_simple_stripe(sctx, bg, map, scrub_dev, stripe_index);
2305 offset = btrfs_stripe_nr_to_offset(stripe_index / map->sub_stripes);
2310 ASSERT(map->type & BTRFS_BLOCK_GROUP_RAID56_MASK);
2315 map, &logic_end, NULL);
2319 get_raid56_logic_offset(physical, stripe_index, map, &offset, NULL);
2320 increment = btrfs_stripe_nr_to_offset(nr_data_stripes(map));
2327 ret = get_raid56_logic_offset(physical, stripe_index, map,
2334 map, stripe_logical);
2348 ret = scrub_simple_mirror(sctx, bg, map, logical, BTRFS_STRIPE_LEN,
2358 map->stripes[stripe_index].physical + dev_stripe_len;
2373 for (int i = 0; i < nr_data_stripes(map); i++)
2384 map->stripes[stripe_index].physical,
2400 struct btrfs_chunk_map *map;
2404 map = btrfs_find_chunk_map(fs_info, bg->start, bg->length);
2405 if (!map) {
2417 if (map->start != bg->start)
2419 if (map->chunk_len < dev_extent_len)
2422 for (i = 0; i < map->num_stripes; ++i) {
2423 if (map->stripes[i].dev->bdev == scrub_dev->bdev &&
2424 map->stripes[i].physical == dev_offset) {
2425 ret = scrub_stripe(sctx, bg, map, scrub_dev, i);
2431 btrfs_free_chunk_map(map);