Lines Matching refs:map
2470 static int scrub_extent(struct scrub_ctx *sctx, struct map_lookup *map, in scrub_extent() argument
2480 if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) in scrub_extent()
2481 blocksize = map->stripe_len; in scrub_extent()
2489 if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) in scrub_extent()
2490 blocksize = map->stripe_len; in scrub_extent()
2664 struct map_lookup *map, u64 *offset, in get_raid56_logic_offset() argument
2673 const int data_stripes = nr_data_stripes(map); in get_raid56_logic_offset()
2675 last_offset = (physical - map->stripes[num].physical) * data_stripes; in get_raid56_logic_offset()
2681 *offset = last_offset + i * map->stripe_len; in get_raid56_logic_offset()
2683 stripe_nr = div64_u64(*offset, map->stripe_len); in get_raid56_logic_offset()
2687 stripe_nr = div_u64_rem(stripe_nr, map->num_stripes, &rot); in get_raid56_logic_offset()
2690 stripe_index = rot % map->num_stripes; in get_raid56_logic_offset()
2696 *offset = last_offset + j * map->stripe_len; in get_raid56_logic_offset()
2819 struct map_lookup *map, in scrub_raid56_parity() argument
2847 nsectors = div_u64(map->stripe_len, fs_info->sectorsize); in scrub_raid56_parity()
2858 sparity->stripe_len = map->stripe_len; in scrub_raid56_parity()
2930 while (key.objectid >= logic_start + map->stripe_len) in scrub_raid56_parity()
2931 logic_start += map->stripe_len; in scrub_raid56_parity()
2941 logic_start + map->stripe_len)) { in scrub_raid56_parity()
2960 logic_start + map->stripe_len) in scrub_raid56_parity()
2961 extent_len = logic_start + map->stripe_len - in scrub_raid56_parity()
3006 logic_start += map->stripe_len; in scrub_raid56_parity()
3027 logic_start += map->stripe_len; in scrub_raid56_parity()
3044 struct map_lookup *map, in scrub_stripe() argument
3069 u64 increment = map->stripe_len; in scrub_stripe()
3080 physical = map->stripes[num].physical; in scrub_stripe()
3082 nstripes = div64_u64(length, map->stripe_len); in scrub_stripe()
3083 if (map->type & BTRFS_BLOCK_GROUP_RAID0) { in scrub_stripe()
3084 offset = map->stripe_len * num; in scrub_stripe()
3085 increment = map->stripe_len * map->num_stripes; in scrub_stripe()
3087 } else if (map->type & BTRFS_BLOCK_GROUP_RAID10) { in scrub_stripe()
3088 int factor = map->num_stripes / map->sub_stripes; in scrub_stripe()
3089 offset = map->stripe_len * (num / map->sub_stripes); in scrub_stripe()
3090 increment = map->stripe_len * factor; in scrub_stripe()
3091 mirror_num = num % map->sub_stripes + 1; in scrub_stripe()
3092 } else if (map->type & BTRFS_BLOCK_GROUP_RAID1_MASK) { in scrub_stripe()
3093 increment = map->stripe_len; in scrub_stripe()
3094 mirror_num = num % map->num_stripes + 1; in scrub_stripe()
3095 } else if (map->type & BTRFS_BLOCK_GROUP_DUP) { in scrub_stripe()
3096 increment = map->stripe_len; in scrub_stripe()
3097 mirror_num = num % map->num_stripes + 1; in scrub_stripe()
3098 } else if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) { in scrub_stripe()
3099 get_raid56_logic_offset(physical, num, map, &offset, NULL); in scrub_stripe()
3100 increment = map->stripe_len * nr_data_stripes(map); in scrub_stripe()
3103 increment = map->stripe_len; in scrub_stripe()
3133 physical_end = physical + nstripes * map->stripe_len; in scrub_stripe()
3134 if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) { in scrub_stripe()
3136 map, &logic_end, NULL); in scrub_stripe()
3203 if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) { in scrub_stripe()
3204 ret = get_raid56_logic_offset(physical, num, map, in scrub_stripe()
3212 ret = scrub_raid56_parity(sctx, map, scrub_dev, in scrub_stripe()
3277 if (key.objectid >= logical + map->stripe_len) { in scrub_stripe()
3292 logical + map->stripe_len)) { in scrub_stripe()
3314 logical + map->stripe_len) { in scrub_stripe()
3315 extent_len = logical + map->stripe_len - in scrub_stripe()
3336 ret = scrub_extent(sctx, map, extent_logical, extent_len, in scrub_stripe()
3348 if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) { in scrub_stripe()
3354 physical += map->stripe_len; in scrub_stripe()
3356 num, map, &logical, in scrub_stripe()
3365 map, scrub_dev, ppath, in scrub_stripe()
3373 physical += map->stripe_len; in scrub_stripe()
3392 physical += map->stripe_len; in scrub_stripe()
3395 sctx->stat.last_physical = map->stripes[num].physical + in scrub_stripe()
3424 struct map_lookup *map; in scrub_chunk() local
3446 map = em->map_lookup; in scrub_chunk()
3453 for (i = 0; i < map->num_stripes; ++i) { in scrub_chunk()
3454 if (map->stripes[i].dev->bdev == scrub_dev->bdev && in scrub_chunk()
3455 map->stripes[i].physical == dev_offset) { in scrub_chunk()
3456 ret = scrub_stripe(sctx, map, scrub_dev, i, in scrub_chunk()