xref: /spdk/lib/bdev/bdev_internal.h (revision 8ddc102a311a0d4eb4a0f8c527197b585a273215)
1 /*   SPDX-License-Identifier: BSD-3-Clause
2  *   Copyright (C) 2019 Intel Corporation.
3  *   All rights reserved.
4  */
5 
6 #ifndef SPDK_BDEV_INTERNAL_H
7 #define SPDK_BDEV_INTERNAL_H
8 
9 #include "spdk/bdev.h"
10 
11 #define ZERO_BUFFER_SIZE	0x100000
12 
13 struct spdk_bdev;
14 struct spdk_bdev_io;
15 struct spdk_bdev_channel;
16 
17 struct spdk_bdev_io *bdev_channel_get_io(struct spdk_bdev_channel *channel);
18 
19 void bdev_io_init(struct spdk_bdev_io *bdev_io, struct spdk_bdev *bdev, void *cb_arg,
20 		  spdk_bdev_io_completion_cb cb);
21 
22 void bdev_io_submit(struct spdk_bdev_io *bdev_io);
23 
24 struct spdk_bdev_io_stat *bdev_alloc_io_stat(bool io_error_stat);
25 void bdev_free_io_stat(struct spdk_bdev_io_stat *stat);
26 
27 enum spdk_bdev_reset_stat_mode;
28 
29 typedef void (*bdev_reset_device_stat_cb)(struct spdk_bdev *bdev, void *cb_arg, int rc);
30 
31 void bdev_reset_device_stat(struct spdk_bdev *bdev, enum spdk_bdev_reset_stat_mode mode,
32 			    bdev_reset_device_stat_cb cb, void *cb_arg);
33 
34 #endif /* SPDK_BDEV_INTERNAL_H */
35