Lines Matching defs:map
932 /* setup the context, map the logical blocks and alloc the pages */
2402 static int scrub_extent(struct scrub_ctx *sctx, struct map_lookup *map,
2412 if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK)
2413 blocksize = map->stripe_len;
2421 if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK)
2422 blocksize = map->stripe_len;
2596 struct map_lookup *map, u64 *offset,
2605 const int data_stripes = nr_data_stripes(map);
2607 last_offset = (physical - map->stripes[num].physical) * data_stripes;
2613 *offset = last_offset + i * map->stripe_len;
2615 stripe_nr = div64_u64(*offset, map->stripe_len);
2619 stripe_nr = div_u64_rem(stripe_nr, map->num_stripes, &rot);
2622 stripe_index = rot % map->num_stripes;
2628 *offset = last_offset + j * map->stripe_len;
2751 struct map_lookup *map,
2779 nsectors = div_u64(map->stripe_len, fs_info->sectorsize);
2790 sparity->stripe_len = map->stripe_len;
2862 while (key.objectid >= logic_start + map->stripe_len)
2863 logic_start += map->stripe_len;
2873 logic_start + map->stripe_len)) {
2892 logic_start + map->stripe_len)
2893 extent_len = logic_start + map->stripe_len -
2938 logic_start += map->stripe_len;
2959 logic_start += map->stripe_len;
2976 struct map_lookup *map,
3002 u64 increment = map->stripe_len;
3013 physical = map->stripes[num].physical;
3015 nstripes = div64_u64(length, map->stripe_len);
3016 if (map->type & BTRFS_BLOCK_GROUP_RAID0) {
3017 offset = map->stripe_len * num;
3018 increment = map->stripe_len * map->num_stripes;
3020 } else if (map->type & BTRFS_BLOCK_GROUP_RAID10) {
3021 int factor = map->num_stripes / map->sub_stripes;
3022 offset = map->stripe_len * (num / map->sub_stripes);
3023 increment = map->stripe_len * factor;
3024 mirror_num = num % map->sub_stripes + 1;
3025 } else if (map->type & BTRFS_BLOCK_GROUP_RAID1_MASK) {
3026 increment = map->stripe_len;
3027 mirror_num = num % map->num_stripes + 1;
3028 } else if (map->type & BTRFS_BLOCK_GROUP_DUP) {
3029 increment = map->stripe_len;
3030 mirror_num = num % map->num_stripes + 1;
3031 } else if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) {
3032 get_raid56_logic_offset(physical, num, map, &offset, NULL);
3033 increment = map->stripe_len * nr_data_stripes(map);
3036 increment = map->stripe_len;
3066 physical_end = physical + nstripes * map->stripe_len;
3067 if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) {
3069 map, &logic_end, NULL);
3136 if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) {
3137 ret = get_raid56_logic_offset(physical, num, map,
3145 ret = scrub_raid56_parity(sctx, map, scrub_dev,
3210 if (key.objectid >= logical + map->stripe_len) {
3239 logical + map->stripe_len)) {
3261 logical + map->stripe_len) {
3262 extent_len = logical + map->stripe_len -
3284 ret = scrub_extent(sctx, map, extent_logical, extent_len,
3296 if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) {
3302 physical += map->stripe_len;
3304 num, map, &logical,
3313 map, scrub_dev, ppath,
3321 physical += map->stripe_len;
3340 physical += map->stripe_len;
3343 sctx->stat.last_physical = map->stripes[num].physical +
3372 struct map_lookup *map;
3394 map = em->map_lookup;
3401 for (i = 0; i < map->num_stripes; ++i) {
3402 if (map->stripes[i].dev->bdev == scrub_dev->bdev &&
3403 map->stripes[i].physical == dev_offset) {
3404 ret = scrub_stripe(sctx, map, scrub_dev, i,