Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: Remove BLK_STS_ZONE_RESOURCE

The zone append emulation of the scsi disk driver was the only driver
using BLK_STS_ZONE_RESOURCE. With this code removed,
BLK_STS_ZONE_RESOURCE is now unused. Remove this macro definition and
simplify blk_mq_dispatch_rq_list() where this status code was handled.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Hans Holmberg <hans.holmberg@wdc.com>
Tested-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20240408014128.205141-20-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Damien Le Moal and committed by
Jens Axboe
63b5385e d2a9b5fd

+4 -43
-26
block/blk-mq.c
··· 1921 1921 __blk_mq_requeue_request(rq); 1922 1922 } 1923 1923 1924 - static void blk_mq_handle_zone_resource(struct request *rq, 1925 - struct list_head *zone_list) 1926 - { 1927 - /* 1928 - * If we end up here it is because we cannot dispatch a request to a 1929 - * specific zone due to LLD level zone-write locking or other zone 1930 - * related resource not being available. In this case, set the request 1931 - * aside in zone_list for retrying it later. 1932 - */ 1933 - list_add(&rq->queuelist, zone_list); 1934 - __blk_mq_requeue_request(rq); 1935 - } 1936 - 1937 1924 enum prep_dispatch { 1938 1925 PREP_DISPATCH_OK, 1939 1926 PREP_DISPATCH_NO_TAG, ··· 2006 2019 struct request *rq; 2007 2020 int queued; 2008 2021 blk_status_t ret = BLK_STS_OK; 2009 - LIST_HEAD(zone_list); 2010 2022 bool needs_resource = false; 2011 2023 2012 2024 if (list_empty(list)) ··· 2047 2061 case BLK_STS_DEV_RESOURCE: 2048 2062 blk_mq_handle_dev_resource(rq, list); 2049 2063 goto out; 2050 - case BLK_STS_ZONE_RESOURCE: 2051 - /* 2052 - * Move the request to zone_list and keep going through 2053 - * the dispatch list to find more requests the drive can 2054 - * accept. 2055 - */ 2056 - blk_mq_handle_zone_resource(rq, &zone_list); 2057 - needs_resource = true; 2058 - break; 2059 2064 default: 2060 2065 blk_mq_end_request(rq, ret); 2061 2066 } 2062 2067 } while (!list_empty(list)); 2063 2068 out: 2064 - if (!list_empty(&zone_list)) 2065 - list_splice_tail_init(&zone_list, list); 2066 - 2067 2069 /* If we didn't flush the entire list, we could have told the driver 2068 2070 * there was more coming, but that turned out to be a lie. 2069 2071 */
-1
drivers/scsi/scsi_lib.c
··· 1870 1870 case BLK_STS_OK: 1871 1871 break; 1872 1872 case BLK_STS_RESOURCE: 1873 - case BLK_STS_ZONE_RESOURCE: 1874 1873 if (scsi_device_blocked(sdev)) 1875 1874 ret = BLK_STS_DEV_RESOURCE; 1876 1875 break;
+4 -16
include/linux/blk_types.h
··· 137 137 #define BLK_STS_DEV_RESOURCE ((__force blk_status_t)13) 138 138 139 139 /* 140 - * BLK_STS_ZONE_RESOURCE is returned from the driver to the block layer if zone 141 - * related resources are unavailable, but the driver can guarantee the queue 142 - * will be rerun in the future once the resources become available again. 143 - * 144 - * This is different from BLK_STS_DEV_RESOURCE in that it explicitly references 145 - * a zone specific resource and IO to a different zone on the same device could 146 - * still be served. Examples of that are zones that are write-locked, but a read 147 - * to the same zone could be served. 148 - */ 149 - #define BLK_STS_ZONE_RESOURCE ((__force blk_status_t)14) 150 - 151 - /* 152 140 * BLK_STS_ZONE_OPEN_RESOURCE is returned from the driver in the completion 153 141 * path if the device returns a status indicating that too many zone resources 154 142 * are currently open. The same command should be successful if resubmitted 155 143 * after the number of open zones decreases below the device's limits, which is 156 144 * reported in the request_queue's max_open_zones. 157 145 */ 158 - #define BLK_STS_ZONE_OPEN_RESOURCE ((__force blk_status_t)15) 146 + #define BLK_STS_ZONE_OPEN_RESOURCE ((__force blk_status_t)14) 159 147 160 148 /* 161 149 * BLK_STS_ZONE_ACTIVE_RESOURCE is returned from the driver in the completion ··· 152 164 * after the number of active zones decreases below the device's limits, which 153 165 * is reported in the request_queue's max_active_zones. 154 166 */ 155 - #define BLK_STS_ZONE_ACTIVE_RESOURCE ((__force blk_status_t)16) 167 + #define BLK_STS_ZONE_ACTIVE_RESOURCE ((__force blk_status_t)15) 156 168 157 169 /* 158 170 * BLK_STS_OFFLINE is returned from the driver when the target device is offline 159 171 * or is being taken offline. This could help differentiate the case where a 160 172 * device is intentionally being shut down from a real I/O error. 161 173 */ 162 - #define BLK_STS_OFFLINE ((__force blk_status_t)17) 174 + #define BLK_STS_OFFLINE ((__force blk_status_t)16) 163 175 164 176 /* 165 177 * BLK_STS_DURATION_LIMIT is returned from the driver when the target device 166 178 * aborted the command because it exceeded one of its Command Duration Limits. 167 179 */ 168 - #define BLK_STS_DURATION_LIMIT ((__force blk_status_t)18) 180 + #define BLK_STS_DURATION_LIMIT ((__force blk_status_t)17) 169 181 170 182 /** 171 183 * blk_path_error - returns true if error may be path related