Spdk/module/bdev/ocf/volume.h
Ben Walker 8dd1cd2104 check_format: For C files only, fix return type breaks
In SPDK, declarations have the return type on the same line. Definitions
have the return type on a separate line. Astyle has an option for
enforcing this. Unfortunately, it seems to have two bugs:

1) It doesn't work correctly at all on C++ files.
2) It often fails on functions that return enums, or long type names

Deal with 1) by adjusting the check_format.sh script to only tell astyle
to fix return type line breaks for C files and not C++. Deal with 2) by
adding a few typedefs to work around the problem.

Change-Id: Idf28281466cab8411ce252d5f02ab384166790c6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13437
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2022-06-27 09:33:48 +00:00

36 lines
624 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) Intel Corporation.
* All rights reserved.
*/
#ifndef VBDEV_OCF_DOBJ_H
#define VBDEV_OCF_DOBJ_H
#include <ocf/ocf.h>
#include "ctx.h"
#include "data.h"
/* ocf_io context
* It is initialized from io size and offset */
struct ocf_io_ctx {
struct bdev_ocf_data *data;
struct spdk_io_channel *ch;
uint32_t offset;
int ref;
int rq_cnt;
int error;
bool iovs_allocated;
};
int vbdev_ocf_volume_init(void);
void vbdev_ocf_volume_cleanup(void);
static inline struct ocf_io_ctx *
ocf_get_io_ctx(struct ocf_io *io)
{
return ocf_io_get_priv(io);
}
#endif