bdev_zone.h File Reference

Zoned device public interface. More...

Data Structures

struct  spdk_bdev_zone_info
 

Enumerations

enum  spdk_bdev_zone_action { SPDK_BDEV_ZONE_CLOSE, SPDK_BDEV_ZONE_FINISH, SPDK_BDEV_ZONE_OPEN, SPDK_BDEV_ZONE_RESET }
 
enum  spdk_bdev_zone_state {
  SPDK_BDEV_ZONE_STATE_EMPTY, SPDK_BDEV_ZONE_STATE_OPEN, SPDK_BDEV_ZONE_STATE_FULL, SPDK_BDEV_ZONE_STATE_CLOSED,
  SPDK_BDEV_ZONE_STATE_READ_ONLY, SPDK_BDEV_ZONE_STATE_OFFLINE
}
 

Functions

uint64_t spdk_bdev_get_zone_size (const struct spdk_bdev *bdev)
 Get device zone 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_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_open_zones()

uint32_t spdk_bdev_get_max_open_zones ( const struct spdk_bdev bdev)

Get device maximum number of open zones.

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_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_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.