diff mbox series

[05/11] block: introduce BLK_STS_ZONE_RESOURCE

Message ID 20200310094653.33257-6-johannes.thumshirn@wdc.com (mailing list archive)
State New, archived
Headers show
Series Introduce Zone Append for writing to zoned block devices | expand

Commit Message

Johannes Thumshirn March 10, 2020, 9:46 a.m. UTC
BLK_STS_ZONE_RESOURCE is returned from the driver to the block layer if
zone related resources are unavailable, but the driver can guarantee the
queue will be rerun in the future once the resources become available
again.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 include/linux/blk_types.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Christoph Hellwig March 10, 2020, 4:43 p.m. UTC | #1
On Tue, Mar 10, 2020 at 06:46:47PM +0900, Johannes Thumshirn wrote:
> BLK_STS_ZONE_RESOURCE is returned from the driver to the block layer if
> zone related resources are unavailable, but the driver can guarantee the
> queue will be rerun in the future once the resources become available
> again.

This needs to go into the main zone append patch.
diff mbox series

Patch

diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index ae809f07aa27..824ec2d89954 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -63,6 +63,18 @@  typedef u8 __bitwise blk_status_t;
  */
 #define BLK_STS_DEV_RESOURCE	((__force blk_status_t)13)
 
+/*
+ * BLK_STS_ZONE_RESOURCE is returned from the driver to the block layer if zone
+ * related resources are unavailable, but the driver can guarantee the queue
+ * will be rerun in the future once the resources become available again.
+ *
+ * This is different from BLK_STS_DEV_RESOURCE in that it explicitly references
+ * a zone specific resource and IO to a different zone on the same device could
+ * still be served. Examples of that are zones that are write-locked, but a read
+ * to the same zone could be served.
+ */
+#define BLK_STS_ZONE_RESOURCE	((__force blk_status_t)14)
+
 /**
  * blk_path_error - returns true if error may be path related
  * @error: status the request was completed with