Merge branch 'latency_window' of https://github.com/liu-song-6/fio
[fio.git] / zbd_types.h
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
11 #define ZBD_MAX_OPEN_ZONES      4096
12
13 /*
14  * Zoned block device models.
15  */
16 enum zbd_zoned_model {
17         ZBD_IGNORE,             /* Ignore file */
18         ZBD_NONE,               /* Regular block device */
19         ZBD_HOST_AWARE,         /* Host-aware zoned block device */
20         ZBD_HOST_MANAGED,       /* Host-managed zoned block device */
21 };
22
23 /*
24  * Zone types.
25  */
26 enum zbd_zone_type {
27         ZBD_ZONE_TYPE_CNV       = 0x1,  /* Conventional */
28         ZBD_ZONE_TYPE_SWR       = 0x2,  /* Sequential write required */
29         ZBD_ZONE_TYPE_SWP       = 0x3,  /* Sequential write preferred */
30 };
31
32 /*
33  * Zone conditions.
34  */
35 enum zbd_zone_cond {
36         ZBD_ZONE_COND_NOT_WP    = 0x0,
37         ZBD_ZONE_COND_EMPTY     = 0x1,
38         ZBD_ZONE_COND_IMP_OPEN  = 0x2,
39         ZBD_ZONE_COND_EXP_OPEN  = 0x3,
40         ZBD_ZONE_COND_CLOSED    = 0x4,
41         ZBD_ZONE_COND_READONLY  = 0xD,
42         ZBD_ZONE_COND_FULL      = 0xE,
43         ZBD_ZONE_COND_OFFLINE   = 0xF,
44 };
45
46 /*
47  * Zone descriptor.
48  */
49 struct zbd_zone {
50         uint64_t                start;
51         uint64_t                wp;
52         uint64_t                len;
53         enum zbd_zone_type      type;
54         enum zbd_zone_cond      cond;
55 };
56
57 #endif /* FIO_ZBD_TYPES_H */