Lines Matching full:zone
13 #define DM_MSG_PREFIX "zone"
18 * For internal zone reports bypassing the top BIO submission path.
51 * User facing dm device block device report zone operation. This calls the
76 static int dm_report_zones_cb(struct blk_zone *zone, unsigned int idx, in dm_report_zones_cb() argument
85 if (zone->start >= args->start + args->tgt->len) in dm_report_zones_cb()
89 * Remap the start sector and write pointer position of the zone in dm_report_zones_cb()
92 zone->start += sector_diff; in dm_report_zones_cb()
93 if (zone->type != BLK_ZONE_TYPE_CONVENTIONAL) { in dm_report_zones_cb()
94 if (zone->cond == BLK_ZONE_COND_FULL) in dm_report_zones_cb()
95 zone->wp = zone->start + zone->len; in dm_report_zones_cb()
96 else if (zone->cond == BLK_ZONE_COND_EMPTY) in dm_report_zones_cb()
97 zone->wp = zone->start; in dm_report_zones_cb()
99 zone->wp += sector_diff; in dm_report_zones_cb()
102 args->next_sector = zone->start + zone->len; in dm_report_zones_cb()
103 return args->orig_cb(zone, args->zone_idx++, args->orig_data); in dm_report_zones_cb()
115 * dm_report_zones_cb() can correctly remap zone information. in dm_report_zones()
157 static unsigned int dm_get_zone_wp_offset(struct blk_zone *zone) in dm_get_zone_wp_offset() argument
159 switch (zone->cond) { in dm_get_zone_wp_offset()
163 return zone->wp - zone->start; in dm_get_zone_wp_offset()
165 return zone->len; in dm_get_zone_wp_offset()
173 * write pointer. Use 0 as for an empty zone. in dm_get_zone_wp_offset()
179 static int dm_zone_revalidate_cb(struct blk_zone *zone, unsigned int idx, in dm_zone_revalidate_cb() argument
185 switch (zone->type) { in dm_zone_revalidate_cb()
212 md->zwp_offset[idx] = dm_get_zone_wp_offset(zone); in dm_zone_revalidate_cb()
216 DMERR("Invalid zone type 0x%x at sectors %llu", in dm_zone_revalidate_cb()
217 (int)zone->type, zone->start); in dm_zone_revalidate_cb()
226 * for zone append emulation. Note that we cannot simply use the block layer
307 /* Check if zone append is natively supported */ in dm_set_zones_restrictions()
315 * Mark the mapped device as needing zone append emulation and in dm_set_zones_restrictions()
325 static int dm_update_zone_wp_offset_cb(struct blk_zone *zone, unsigned int idx, in dm_update_zone_wp_offset_cb() argument
330 *wp_offset = dm_get_zone_wp_offset(zone); in dm_update_zone_wp_offset_cb()
365 * First phase of BIO mapping for targets with zone append emulation:
366 * check all BIO that change a zone writer pointer and change zone
377 * If the target zone is in an error state, recover by inspecting the in dm_zone_map_bio_begin()
378 * zone to get its current write pointer position. Note that since the in dm_zone_map_bio_begin()
379 * target zone is already locked, a BIO issuing context should never in dm_zone_map_bio_begin()
380 * see the zone write in the DM_ZONE_UPDATING_WP_OFST state. in dm_zone_map_bio_begin()
395 /* Writes must be aligned to the zone write pointer */ in dm_zone_map_bio_begin()
401 * Change zone append operations into a non-mergeable regular in dm_zone_map_bio_begin()
403 * target zone. in dm_zone_map_bio_begin()
415 /* Cannot write to a full zone */ in dm_zone_map_bio_begin()
423 * Second phase of BIO mapping for targets with zone append emulation:
424 * update the zone write pointer offset array to account for the additional
425 * data written to a zone. Note that at this point, the remapped clone BIO
439 /* Update the zone wp offset */ in dm_zone_map_bio_end()
456 * emulating a zone append. in dm_zone_map_bio_end()
459 DMWARN_LIMIT("Truncated write for zone append"); in dm_zone_map_bio_end()
498 * zone write lock, that is, all operations that target conventional in dm_need_zone_wp_tracking()
500 * zone write pointer. in dm_need_zone_wp_tracking()
518 * Special IO mapping for targets needing zone append emulation.
533 * IOs that do not change a zone write pointer do not need in dm_zone_map_bio()
539 /* Lock the target zone */ in dm_zone_map_bio()
544 * Check that the bio and the target zone write pointer offset are in dm_zone_map_bio()
545 * both valid, and if the bio is a zone append, remap it to a write. in dm_zone_map_bio()
564 * The target submitted the clone BIO. The target zone will in dm_zone_map_bio()
572 * unlock the target zone here as the clone will not be in dm_zone_map_bio()
608 * For targets that do not emulate zone append, we only need to in dm_zone_endio()
609 * handle native zone-append bios. in dm_zone_endio()
613 * Get the offset within the zone of the written sector in dm_zone_endio()
628 * For targets that do emulate zone append, if the clone BIO does not in dm_zone_endio()
629 * own the target zone write lock, we have nothing to do. in dm_zone_endio()
638 * BIOs that modify a zone write pointer may leave the zone in dm_zone_endio()
641 * the target zone write pointer as invalid unless it is in dm_zone_endio()
647 * Get the written sector for zone append operation that were in dm_zone_endio()