Lines Matching full:zone

14 #define DM_MSG_PREFIX "zone"
19 * For internal zone reports bypassing the top BIO submission path.
52 * User facing dm device block device report zone operation. This calls the
77 static int dm_report_zones_cb(struct blk_zone *zone, unsigned int idx, in dm_report_zones_cb() argument
86 if (zone->start >= args->start + args->tgt->len) in dm_report_zones_cb()
90 * Remap the start sector and write pointer position of the zone in dm_report_zones_cb()
93 zone->start += sector_diff; in dm_report_zones_cb()
94 if (zone->type != BLK_ZONE_TYPE_CONVENTIONAL) { in dm_report_zones_cb()
95 if (zone->cond == BLK_ZONE_COND_FULL) in dm_report_zones_cb()
96 zone->wp = zone->start + zone->len; in dm_report_zones_cb()
97 else if (zone->cond == BLK_ZONE_COND_EMPTY) in dm_report_zones_cb()
98 zone->wp = zone->start; in dm_report_zones_cb()
100 zone->wp += sector_diff; in dm_report_zones_cb()
103 args->next_sector = zone->start + zone->len; in dm_report_zones_cb()
104 return args->orig_cb(zone, args->zone_idx++, args->orig_data); in dm_report_zones_cb()
116 * dm_report_zones_cb() can correctly remap zone information. in dm_report_zones()
155 static unsigned int dm_get_zone_wp_offset(struct blk_zone *zone) in dm_get_zone_wp_offset() argument
157 switch (zone->cond) { in dm_get_zone_wp_offset()
161 return zone->wp - zone->start; in dm_get_zone_wp_offset()
163 return zone->len; in dm_get_zone_wp_offset()
171 * write pointer. Use 0 as for an empty zone. in dm_get_zone_wp_offset()
177 static int dm_zone_revalidate_cb(struct blk_zone *zone, unsigned int idx, in dm_zone_revalidate_cb() argument
183 switch (zone->type) { in dm_zone_revalidate_cb()
208 md->zwp_offset[idx] = dm_get_zone_wp_offset(zone); in dm_zone_revalidate_cb()
212 DMERR("Invalid zone type 0x%x at sectors %llu", in dm_zone_revalidate_cb()
213 (int)zone->type, zone->start); in dm_zone_revalidate_cb()
222 * for zone append emulation. Note that we cannot simply use the block layer
300 /* Check if zone append is natively supported */ in dm_set_zones_restrictions()
308 * Mark the mapped device as needing zone append emulation and in dm_set_zones_restrictions()
318 static int dm_update_zone_wp_offset_cb(struct blk_zone *zone, unsigned int idx, in dm_update_zone_wp_offset_cb() argument
323 *wp_offset = dm_get_zone_wp_offset(zone); in dm_update_zone_wp_offset_cb()
363 * First phase of BIO mapping for targets with zone append emulation:
364 * check all BIO that change a zone writer pointer and change zone
374 * If the target zone is in an error state, recover by inspecting the in dm_zone_map_bio_begin()
375 * zone to get its current write pointer position. Note that since the in dm_zone_map_bio_begin()
376 * target zone is already locked, a BIO issuing context should never in dm_zone_map_bio_begin()
377 * see the zone write in the DM_ZONE_UPDATING_WP_OFST state. in dm_zone_map_bio_begin()
391 /* Writes must be aligned to the zone write pointer */ in dm_zone_map_bio_begin()
397 * Change zone append operations into a non-mergeable regular in dm_zone_map_bio_begin()
399 * target zone. in dm_zone_map_bio_begin()
410 /* Cannot write to a full zone */ in dm_zone_map_bio_begin()
418 * Second phase of BIO mapping for targets with zone append emulation:
419 * update the zone write pointer offset array to account for the additional
420 * data written to a zone. Note that at this point, the remapped clone BIO
433 /* Update the zone wp offset */ in dm_zone_map_bio_end()
449 * emulating a zone append. in dm_zone_map_bio_end()
452 DMWARN_LIMIT("Truncated write for zone append"); in dm_zone_map_bio_end()
491 * zone write lock, that is, all operations that target conventional in dm_need_zone_wp_tracking()
493 * zone write pointer. in dm_need_zone_wp_tracking()
510 * Special IO mapping for targets needing zone append emulation.
524 * IOs that do not change a zone write pointer do not need in dm_zone_map_bio()
530 /* Lock the target zone */ in dm_zone_map_bio()
538 * Check that the bio and the target zone write pointer offset are in dm_zone_map_bio()
539 * both valid, and if the bio is a zone append, remap it to a write. in dm_zone_map_bio()
551 * The target submitted the clone BIO. The target zone will in dm_zone_map_bio()
560 * unlock the target zone here as the clone will not be in dm_zone_map_bio()
594 * For targets that do not emulate zone append, we only need to in dm_zone_endio()
595 * handle native zone-append bios. in dm_zone_endio()
599 * Get the offset within the zone of the written sector in dm_zone_endio()
615 * For targets that do emulate zone append, if the clone BIO does not in dm_zone_endio()
616 * own the target zone write lock, we have nothing to do. in dm_zone_endio()
625 * BIOs that modify a zone write pointer may leave the zone in dm_zone_endio()
628 * the target zone write pointer as invalid unless it is in dm_zone_endio()
634 * Get the written sector for zone append operation that were in dm_zone_endio()