Lines Matching full:zone
27 * sd_zbc_get_zone_wp_offset - Get zone write pointer offset.
28 * @zone: Zone for which to return the write pointer offset.
30 * Return: offset of the write pointer from the start of the zone.
32 static unsigned int sd_zbc_get_zone_wp_offset(struct blk_zone *zone) in sd_zbc_get_zone_wp_offset() argument
34 if (zone->type == ZBC_ZONE_TYPE_CONV) in sd_zbc_get_zone_wp_offset()
37 switch (zone->cond) { in sd_zbc_get_zone_wp_offset()
41 return zone->wp - zone->start; in sd_zbc_get_zone_wp_offset()
43 return zone->len; in sd_zbc_get_zone_wp_offset()
50 * write pointer. Use 0 as for an empty zone. in sd_zbc_get_zone_wp_offset()
56 /* Whether or not a SCSI zone descriptor describes a gap zone. */
63 * sd_zbc_parse_report - Parse a SCSI zone descriptor
65 * @buf: SCSI zone descriptor.
66 * @idx: Index of the zone relative to the first zone reported by the current
73 * Convert a SCSI zone descriptor into struct blk_zone format. Additionally,
80 struct blk_zone zone = { 0 }; in sd_zbc_parse_report() local
87 zone.type = buf[0] & 0x0f; in sd_zbc_parse_report()
88 zone.cond = (buf[1] >> 4) & 0xf; in sd_zbc_parse_report()
90 zone.reset = 1; in sd_zbc_parse_report()
92 zone.non_seq = 1; in sd_zbc_parse_report()
95 zone.start = logical_to_sectors(sdp, start_lba); in sd_zbc_parse_report()
96 zone.capacity = logical_to_sectors(sdp, get_unaligned_be64(&buf[8])); in sd_zbc_parse_report()
97 zone.len = zone.capacity; in sd_zbc_parse_report()
100 if (zone.len > gran) { in sd_zbc_parse_report()
102 "Invalid zone at LBA %llu with capacity %llu and length %llu; granularity = %llu\n", in sd_zbc_parse_report()
104 sectors_to_logical(sdp, zone.capacity), in sd_zbc_parse_report()
105 sectors_to_logical(sdp, zone.len), in sd_zbc_parse_report()
110 * Use the starting LBA granularity instead of the zone length in sd_zbc_parse_report()
113 zone.len = gran; in sd_zbc_parse_report()
115 if (zone.cond == ZBC_ZONE_COND_FULL) in sd_zbc_parse_report()
116 zone.wp = zone.start + zone.len; in sd_zbc_parse_report()
118 zone.wp = logical_to_sectors(sdp, get_unaligned_be64(&buf[24])); in sd_zbc_parse_report()
120 ret = cb(&zone, idx, data); in sd_zbc_parse_report()
125 sdkp->rev_wp_offset[idx] = sd_zbc_get_zone_wp_offset(&zone); in sd_zbc_parse_report()
209 * Report zone buffer size should be at most 64B times the number of in sd_zbc_alloc_report_buffer()
213 * Furthermore, since the report zone command cannot be split, make in sd_zbc_alloc_report_buffer()
237 * sd_zbc_zone_sectors - Get the device zone size in number of 512B sectors.
250 * @cb: Callback function called to report zone information.
253 * Called by the block layer to iterate over zone information. See also the
300 "Zone %d at LBA %llu is invalid: %llu + %llu\n", in sd_zbc_report_zones()
310 "Gap zone without constant LBA offsets\n"); in sd_zbc_report_zones()
353 static int sd_zbc_update_wp_offset_cb(struct blk_zone *zone, unsigned int idx, in sd_zbc_update_wp_offset_cb() argument
360 sdkp->zones_wp_offset[idx] = sd_zbc_get_zone_wp_offset(zone); in sd_zbc_update_wp_offset_cb()
366 * An attempt to append a zone triggered an invalid write pointer error.
367 * Reread the write pointer of the zone(s) in which the append failed.
405 * @sd_zbc_prepare_zone_append() handles the necessary zone wrote locking and
436 * We are about to schedule work to update a zone write pointer in sd_zbc_prepare_zone_append()
437 * offset, which will cause the zone append command to be in sd_zbc_prepare_zone_append()
468 * sd_zbc_setup_zone_mgmt_cmnd - Prepare a zone ZBC_OUT command. The operations
524 * sd_zbc_zone_wp_update - Update cached zone write pointer upon cmd completion
528 * Called from sd_zbc_complete() to handle the update of the cached zone write
543 * pointer offset cache, we must mark the zone wp offset entry as in sd_zbc_zone_wp_update()
544 * invalid to force an update from disk the next time a zone append in sd_zbc_zone_wp_update()
557 * Force an update of the zone write pointer offset on in sd_zbc_zone_wp_update()
558 * the next zone append access. in sd_zbc_zone_wp_update()
603 * Called from sd_done() to handle zone commands errors and updates to the
604 * device queue zone write pointer offset cahce.
617 * INVALID FIELD IN CDB error: a zone management command was in sd_zbc_complete()
618 * attempted on a conventional zone. Nothing to worry about, in sd_zbc_complete()
663 /* Check zone alignment method */ in sd_zbc_check_zoned_characteristics()
667 /* Use zone length */ in sd_zbc_check_zoned_characteristics()
676 "Invalid zone starting LBA granularity %llu\n", in sd_zbc_check_zoned_characteristics()
683 sd_printk(KERN_ERR, sdkp, "Invalid zone alignment method\n"); in sd_zbc_check_zoned_characteristics()
706 * @zblocks: zone size in logical blocks
708 * Get the device zone size and check that the device capacity as reported
722 /* Do a report zone to get max_lba and the size of the first zone */ in sd_zbc_check_capacity()
741 /* Get the size of the first reported zone */ in sd_zbc_check_capacity()
747 "Zone size too large\n"); in sd_zbc_check_capacity()
756 "Zone size %llu is not a power of two.\n", in sd_zbc_check_capacity()
773 "%u zones of %u logical blocks + 1 runt zone\n", in sd_zbc_print_zones()
838 * For all zoned disks, initialize zone append emulation data if not in sd_zbc_revalidate_zones()
901 * sd_zbc_read_zones - Read zone information and update the request queue
905 * Read zone information and update the request queue zone characteristics and
920 * required. Nevertheless, free the disk zone information in in sd_zbc_read_zones()