filesetup: create zbd_info before jumping to done label
[fio.git] / zbd_types.h
CommitLineData
b7694961
DLM
1/*
2 * Copyright (C) 2020 Western Digital Corporation or its affiliates.
3 *
4 * This file is released under the GPL.
5 */
6#ifndef FIO_ZBD_TYPES_H
7#define FIO_ZBD_TYPES_H
8
9#include <inttypes.h>
10
af7be579 11#define ZBD_MAX_OPEN_ZONES 4096
b7694961
DLM
12
13/*
14 * Zoned block device models.
15 */
16enum zbd_zoned_model {
2c7dd23e
NC
17 ZBD_NONE = 0x1, /* No zone support. Emulate zones. */
18 ZBD_HOST_AWARE = 0x2, /* Host-aware zoned block device */
19 ZBD_HOST_MANAGED = 0x3, /* Host-managed zoned block device */
b7694961
DLM
20};
21
22/*
23 * Zone types.
24 */
25enum zbd_zone_type {
26 ZBD_ZONE_TYPE_CNV = 0x1, /* Conventional */
27 ZBD_ZONE_TYPE_SWR = 0x2, /* Sequential write required */
28 ZBD_ZONE_TYPE_SWP = 0x3, /* Sequential write preferred */
29};
30
31/*
32 * Zone conditions.
33 */
34enum zbd_zone_cond {
35 ZBD_ZONE_COND_NOT_WP = 0x0,
36 ZBD_ZONE_COND_EMPTY = 0x1,
37 ZBD_ZONE_COND_IMP_OPEN = 0x2,
38 ZBD_ZONE_COND_EXP_OPEN = 0x3,
39 ZBD_ZONE_COND_CLOSED = 0x4,
40 ZBD_ZONE_COND_READONLY = 0xD,
41 ZBD_ZONE_COND_FULL = 0xE,
42 ZBD_ZONE_COND_OFFLINE = 0xF,
43};
44
45/*
46 * Zone descriptor.
47 */
48struct zbd_zone {
49 uint64_t start;
50 uint64_t wp;
51 uint64_t len;
236d23a8 52 uint64_t capacity;
b7694961
DLM
53 enum zbd_zone_type type;
54 enum zbd_zone_cond cond;
55};
56
57#endif /* FIO_ZBD_TYPES_H */