Merge branch 'enable-dataplacement-while-replaying-io' of https://github.com/parkvibe...
[fio.git] / oslib / blkzoned.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_BLKZONED_H
7#define FIO_BLKZONED_H
8
9#include "zbd_types.h"
10
11#ifdef CONFIG_HAS_BLKZONED
12extern int blkzoned_get_zoned_model(struct thread_data *td,
13 struct fio_file *f, enum zbd_zoned_model *model);
14extern int blkzoned_report_zones(struct thread_data *td,
15 struct fio_file *f, uint64_t offset,
16 struct zbd_zone *zones, unsigned int nr_zones);
17extern int blkzoned_reset_wp(struct thread_data *td, struct fio_file *f,
18 uint64_t offset, uint64_t length);
d2f442bc
NC
19extern int blkzoned_get_max_open_zones(struct thread_data *td, struct fio_file *f,
20 unsigned int *max_open_zones);
9e523ef8
SK
21extern int blkzoned_get_max_active_zones(struct thread_data *td,
22 struct fio_file *f,
23 unsigned int *max_active_zones);
f8ec93e4
SK
24extern int blkzoned_finish_zone(struct thread_data *td, struct fio_file *f,
25 uint64_t offset, uint64_t length);
b7694961
DLM
26#else
27/*
28 * Define stubs for systems that do not have zoned block device support.
29 */
30static inline int blkzoned_get_zoned_model(struct thread_data *td,
31 struct fio_file *f, enum zbd_zoned_model *model)
32{
33 /*
34 * If this is a block device file, allow zbd emulation.
35 */
36 if (f->filetype == FIO_TYPE_BLOCK) {
37 *model = ZBD_NONE;
38 return 0;
39 }
40
41 return -ENODEV;
42}
43static inline int blkzoned_report_zones(struct thread_data *td,
44 struct fio_file *f, uint64_t offset,
45 struct zbd_zone *zones, unsigned int nr_zones)
46{
47 return -EIO;
48}
49static inline int blkzoned_reset_wp(struct thread_data *td, struct fio_file *f,
50 uint64_t offset, uint64_t length)
51{
52 return -EIO;
53}
d2f442bc
NC
54static inline int blkzoned_get_max_open_zones(struct thread_data *td, struct fio_file *f,
55 unsigned int *max_open_zones)
56{
57 return -EIO;
58}
9e523ef8
SK
59static inline int blkzoned_get_max_active_zones(struct thread_data *td,
60 struct fio_file *f,
61 unsigned int *max_open_zones)
62{
63 return -EIO;
64}
f8ec93e4
SK
65static inline int blkzoned_finish_zone(struct thread_data *td,
66 struct fio_file *f,
67 uint64_t offset, uint64_t length)
68{
69 return -EIO;
70}
b7694961
DLM
71#endif
72
73#endif /* FIO_BLKZONED_H */