bdev_zone.h File Reference

Zoned device public interface. More...

Data Structures

struct  spdk_bdev_zone_info
 

Enumerations

enum  spdk_bdev_zone_type { SPDK_BDEV_ZONE_TYPE_CNV = 0x1 , SPDK_BDEV_ZONE_TYPE_SEQWR = 0x2 , SPDK_BDEV_ZONE_TYPE_SEQWP = 0x3 }
 
enum  spdk_bdev_zone_action {
  SPDK_BDEV_ZONE_CLOSE , SPDK_BDEV_ZONE_FINISH , SPDK_BDEV_ZONE_OPEN , SPDK_BDEV_ZONE_RESET ,
  SPDK_BDEV_ZONE_OFFLINE
}
 
enum  spdk_bdev_zone_state {
  SPDK_BDEV_ZONE_STATE_EMPTY = 0x0 , SPDK_BDEV_ZONE_STATE_IMP_OPEN = 0x1 , SPDK_BDEV_ZONE_STATE_OPEN = SPDK_BDEV_ZONE_STATE_IMP_OPEN , SPDK_BDEV_ZONE_STATE_FULL = 0x2 ,
  SPDK_BDEV_ZONE_STATE_CLOSED = 0x3 , SPDK_BDEV_ZONE_STATE_READ_ONLY = 0x4 , SPDK_BDEV_ZONE_STATE_OFFLINE = 0x5 , SPDK_BDEV_ZONE_STATE_EXP_OPEN = 0x6 ,
  SPDK_BDEV_ZONE_STATE_NOT_WP = 0x7
}
 

Functions

uint64_t spdk_bdev_get_zone_size (const struct spdk_bdev *bdev)
 Get device zone size in logical blocks. More...
 
uint64_t spdk_bdev_get_num_zones (const struct spdk_bdev *bdev)
 Get the number of zones for the given device. More...
 
uint64_t spdk_bdev_get_zone_id (const struct spdk_bdev *bdev, uint64_t offset_blocks)
 Get the first logical block of a zone (known as zone_id or zslba) for a given offset. More...
 
uint32_t spdk_bdev_get_max_zone_append_size (const struct spdk_bdev *bdev)
 Get device maximum zone append data transfer size in logical blocks. More...
 
uint32_t spdk_bdev_get_max_open_zones (const struct spdk_bdev *bdev)
 Get device maximum number of open zones. More...
 
uint32_t spdk_bdev_get_max_active_zones (const struct spdk_bdev *bdev)
 Get device maximum number of active zones. More...
 
uint32_t spdk_bdev_get_optimal_open_zones (const struct spdk_bdev *bdev)
 Get device optimal number of open zones. More...
 
int spdk_bdev_get_zone_info (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, uint64_t zone_id, size_t num_zones, struct spdk_bdev_zone_info *info, spdk_bdev_io_completion_cb cb, void *cb_arg)
 Submit a get_zone_info request to the bdev. More...
 
int spdk_bdev_zone_management (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, uint64_t zone_id, enum spdk_bdev_zone_action action, spdk_bdev_io_completion_cb cb, void *cb_arg)
 Submit a zone_management request to the bdev. More...
 
int spdk_bdev_zone_append (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *buf, uint64_t zone_id, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg)
 Submit a zone_append request to the bdev. More...
 
int spdk_bdev_zone_appendv (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, uint64_t zone_id, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg)
 Submit a zone_append request to the bdev. More...
 
int spdk_bdev_zone_append_with_md (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *buf, void *md, uint64_t zone_id, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg)
 Submit a zone_append request with metadata to the bdev. More...
 
int spdk_bdev_zone_appendv_with_md (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, void *md, uint64_t zone_id, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg)
 Submit a zone_append request with metadata to the bdev. More...
 
uint64_t spdk_bdev_io_get_append_location (struct spdk_bdev_io *bdev_io)
 Get append location (offset in blocks of the bdev) for this I/O. More...
 

Detailed Description

Zoned device public interface.

Function Documentation

◆ spdk_bdev_get_max_active_zones()

uint32_t spdk_bdev_get_max_active_zones ( const struct spdk_bdev bdev)

Get device maximum number of active zones.

An active zone is defined as a zone being in zone state SPDK_BDEV_ZONE_STATE_IMP_OPEN, SPDK_BDEV_ZONE_STATE_EXP_OPEN or SPDK_BDEV_ZONE_STATE_CLOSED.

If this value is 0, there is no limit.

Parameters
bdevBlock device to query.
Returns
Maximum number of active zones for this zoned device.

◆ spdk_bdev_get_max_open_zones()

uint32_t spdk_bdev_get_max_open_zones ( const struct spdk_bdev bdev)

Get device maximum number of open zones.

An open zone is defined as a zone being in zone state SPDK_BDEV_ZONE_STATE_IMP_OPEN or SPDK_BDEV_ZONE_STATE_EXP_OPEN.

If this value is 0, there is no limit.

Parameters
bdevBlock device to query.
Returns
Maximum number of open zones for this zoned device.

◆ spdk_bdev_get_max_zone_append_size()

uint32_t spdk_bdev_get_max_zone_append_size ( const struct spdk_bdev bdev)

Get device maximum zone append data transfer size in logical blocks.

If this value is 0, there is no limit.

Parameters
bdevBlock device to query.
Returns
Maximum zone append data transfer size for this zoned device in logical blocks.

◆ spdk_bdev_get_num_zones()

uint64_t spdk_bdev_get_num_zones ( const struct spdk_bdev bdev)

Get the number of zones for the given device.

Parameters
bdevBlock device to query.
Returns
The number of zones.

◆ spdk_bdev_get_optimal_open_zones()

uint32_t spdk_bdev_get_optimal_open_zones ( const struct spdk_bdev bdev)

Get device optimal number of open zones.

Parameters
bdevBlock device to query.
Returns
Optimal number of open zones for this zoned device.

◆ spdk_bdev_get_zone_id()

uint64_t spdk_bdev_get_zone_id ( const struct spdk_bdev bdev,
uint64_t  offset_blocks 
)

Get the first logical block of a zone (known as zone_id or zslba) for a given offset.

Parameters
bdevBlock device to query.
offset_blocksThe offset, in blocks, from the start of the block device.
Returns
The zone_id (also known as zslba) for the given offset.

◆ spdk_bdev_get_zone_size()

uint64_t spdk_bdev_get_zone_size ( const struct spdk_bdev bdev)

Get device zone size in logical blocks.

Parameters
bdevBlock device to query.
Returns
Size of zone for this zoned device in logical blocks.

◆ spdk_bdev_io_get_append_location()

uint64_t spdk_bdev_io_get_append_location ( struct spdk_bdev_io bdev_io)

Get append location (offset in blocks of the bdev) for this I/O.

Parameters
bdev_ioI/O to get append location from.