Lines Matching defs: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,
86 if (zone->start >= args->start + args->tgt->len)
90 * Remap the start sector and write pointer position of the zone
93 zone->start += sector_diff;
94 if (zone->type != BLK_ZONE_TYPE_CONVENTIONAL) {
95 if (zone->cond == BLK_ZONE_COND_FULL)
96 zone->wp = zone->start + zone->len;
97 else if (zone->cond == BLK_ZONE_COND_EMPTY)
98 zone->wp = zone->start;
100 zone->wp += sector_diff;
103 args->next_sector = zone->start + zone->len;
104 return args->orig_cb(zone, args->zone_idx++, args->orig_data);
116 * dm_report_zones_cb() can correctly remap zone information.
155 static unsigned int dm_get_zone_wp_offset(struct blk_zone *zone)
157 switch (zone->cond) {
161 return zone->wp - zone->start;
163 return zone->len;
171 * write pointer. Use 0 as for an empty zone.
177 static int dm_zone_revalidate_cb(struct blk_zone *zone, unsigned int idx,
183 switch (zone->type) {
208 md->zwp_offset[idx] = dm_get_zone_wp_offset(zone);
212 DMERR("Invalid zone type 0x%x at sectors %llu",
213 (int)zone->type, zone->start);
222 * for zone append emulation. Note that we cannot simply use the block layer
300 /* Check if zone append is natively supported */
308 * Mark the mapped device as needing zone append emulation and
318 static int dm_update_zone_wp_offset_cb(struct blk_zone *zone, unsigned int idx,
323 *wp_offset = dm_get_zone_wp_offset(zone);
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
375 * zone to get its current write pointer position. Note that since the
376 * target zone is already locked, a BIO issuing context should never
377 * see the zone write in the DM_ZONE_UPDATING_WP_OFST state.
391 /* Writes must be aligned to the zone write pointer */
397 * Change zone append operations into a non-mergeable regular
399 * target zone.
410 /* Cannot write to a full zone */
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 */
449 * emulating a zone append.
452 DMWARN_LIMIT("Truncated write for zone append");
491 * zone write lock, that is, all operations that target conventional
493 * zone write pointer.
510 * Special IO mapping for targets needing zone append emulation.
524 * IOs that do not change a zone write pointer do not need
530 /* Lock the target zone */
538 * Check that the bio and the target zone write pointer offset are
539 * both valid, and if the bio is a zone append, remap it to a write.
551 * The target submitted the clone BIO. The target zone will
560 * unlock the target zone here as the clone will not be
594 * For targets that do not emulate zone append, we only need to
595 * handle native zone-append bios.
599 * Get the offset within the zone of the written sector
615 * For targets that do emulate zone append, if the clone BIO does not
616 * own the target zone write lock, we have nothing to do.
625 * BIOs that modify a zone write pointer may leave the zone
628 * the target zone write pointer as invalid unless it is
634 * Get the written sector for zone append operation that were