Spdk/lib/bdev/bdev_internal.h
Shuhei Matsumoto cf4e8664bb bdev: Add bdev_reset_iostat RPC
Add a helper function bdev_reset_device_stat() to reset I/O statistics.
This funciton is used for the bdev_reset_iostat RPC.

We do not have any plan to use bdev_reset_device_stat() outside
lib/bdev. Hence, we do not add this as a public API.

Then, add a new RPC bdev_reset_iostat to reset I/O statistics of a
single bdev or all bdevs.

Resetting I/O statistics affects all consumers. Add a note to CHANGELOG
and doc/jsonrpc.md.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I97af09107b5c3ad1f9c19bf3cbf027457c4fbae7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15350
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-12-08 12:54:23 +00:00

34 lines
984 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (C) 2019 Intel Corporation.
* All rights reserved.
*/
#ifndef SPDK_BDEV_INTERNAL_H
#define SPDK_BDEV_INTERNAL_H
#include "spdk/bdev.h"
#define ZERO_BUFFER_SIZE 0x100000
struct spdk_bdev;
struct spdk_bdev_io;
struct spdk_bdev_channel;
struct spdk_bdev_io *bdev_channel_get_io(struct spdk_bdev_channel *channel);
void bdev_io_init(struct spdk_bdev_io *bdev_io, struct spdk_bdev *bdev, void *cb_arg,
spdk_bdev_io_completion_cb cb);
void bdev_io_submit(struct spdk_bdev_io *bdev_io);
struct spdk_bdev_io_stat *bdev_io_stat_alloc(void);
void bdev_io_stat_free(struct spdk_bdev_io_stat *stat);
void bdev_io_stat_dump_json(struct spdk_bdev_io_stat *stat, struct spdk_json_write_ctx *w);
typedef void (*bdev_reset_device_stat_cb)(struct spdk_bdev *bdev, void *cb_arg, int rc);
void bdev_reset_device_stat(struct spdk_bdev *bdev, bdev_reset_device_stat_cb cb,
void *cb_arg);
#endif /* SPDK_BDEV_INTERNAL_H */