diff --git a/env/posix/ocf_env_list.h b/env/posix/ocf_env_list.h index 90348af55..7937226ae 100644 --- a/env/posix/ocf_env_list.h +++ b/env/posix/ocf_env_list.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __OCF_ENV_LIST__ -#define __OCF_ENV_LIST__ +#ifndef __OCF_ENV_LIST_H__ +#define __OCF_ENV_LIST_H__ #define LIST_POISON1 ((void *)0x101) #define LIST_POISON2 ((void *)0x202) @@ -165,4 +165,4 @@ static inline void list_move_tail(struct list_head *it, struct list_head *l1) _list_entry_helper(item, (plist)->next, field_name); \ item = q, q = _list_entry_helper(q, (q)->field_name.next, field_name)) -#endif // __OCF_ENV_LIST__ +#endif /* __OCF_ENV_LIST_H__ */ diff --git a/env/posix/ocf_env_refcnt.h b/env/posix/ocf_env_refcnt.h index 0395ed6e4..2be9baa73 100644 --- a/env/posix/ocf_env_refcnt.h +++ b/env/posix/ocf_env_refcnt.h @@ -51,4 +51,4 @@ bool env_refcnt_zeroed(struct env_refcnt *rc); void env_refcnt_register_zero_cb(struct env_refcnt *rc, env_refcnt_cb_t cb, void *priv); -#endif // __OCF_ENV_REFCNT_H__ +#endif /* __OCF_ENV_REFCNT_H__ */ diff --git a/env/posix/utils_mpool.h b/env/posix/utils_mpool.h index 75bb8427f..680188be8 100644 --- a/env/posix/utils_mpool.h +++ b/env/posix/utils_mpool.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef UTILS_MPOOL_H_ -#define UTILS_MPOOL_H_ +#ifndef __UTILS_MPOOL_H__ +#define __UTILS_MPOOL_H__ #include #include @@ -88,4 +88,4 @@ void *env_mpool_new_f(struct env_mpool *mpool, uint32_t count, int flags); */ bool env_mpool_del(struct env_mpool *mpool, void *items, uint32_t count); -#endif /* UTILS_MPOOL_H_ */ +#endif /* __UTILS_MPOOL_H__ */ diff --git a/example/simple/src/ctx.h b/example/simple/src/ctx.h index 57d4f8b3d..e134163db 100644 --- a/example/simple/src/ctx.h +++ b/example/simple/src/ctx.h @@ -16,4 +16,4 @@ void ctx_data_free(ctx_data_t *ctx_data); int ctx_init(ocf_ctx_t *ocf_ctx); void ctx_cleanup(ocf_ctx_t ctx); -#endif +#endif /* __CTX_H__ */ diff --git a/example/simple/src/data.h b/example/simple/src/data.h index 53968c43f..65c50795b 100644 --- a/example/simple/src/data.h +++ b/example/simple/src/data.h @@ -11,4 +11,4 @@ struct volume_data { int offset; }; -#endif +#endif /* __DATA_H__ */ diff --git a/example/simple/src/volume.h b/example/simple/src/volume.h index 6f2e4233d..437748f78 100644 --- a/example/simple/src/volume.h +++ b/example/simple/src/volume.h @@ -20,4 +20,4 @@ struct myvolume { int volume_init(ocf_ctx_t ocf_ctx); void volume_cleanup(ocf_ctx_t ocf_ctx); -#endif +#endif /* __VOLUME_H__ */ diff --git a/inc/ocf_cleaner.h b/inc/ocf_cleaner.h index 43e467338..cde5c818d 100644 --- a/inc/ocf_cleaner.h +++ b/inc/ocf_cleaner.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef OCF_CLEANER_H_ -#define OCF_CLEANER_H_ +#ifndef __OCF_CLEANER_H__ +#define __OCF_CLEANER_H__ /** * @file @@ -64,4 +64,4 @@ void *ocf_cleaner_get_priv(ocf_cleaner_t c); */ ocf_cache_t ocf_cleaner_get_cache(ocf_cleaner_t c); -#endif +#endif /* __OCF_CLEANER_H__ */ diff --git a/inc/ocf_mngt.h b/inc/ocf_mngt.h index a4f234104..27917b268 100644 --- a/inc/ocf_mngt.h +++ b/inc/ocf_mngt.h @@ -1446,4 +1446,4 @@ int ocf_mngt_core_pool_visit(ocf_ctx_t ctx, */ void ocf_mngt_core_pool_remove(ocf_ctx_t ctx, ocf_volume_t volume); -#endif /* __OCF_CACHE_H__ */ +#endif /* __OCF_MNGT_H__ */ diff --git a/inc/ocf_queue.h b/inc/ocf_queue.h index 47d9d4c21..9303a138b 100644 --- a/inc/ocf_queue.h +++ b/inc/ocf_queue.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef OCF_QUEUE_H_ -#define OCF_QUEUE_H_ +#ifndef __OCF_QUEUE_H__ +#define __OCF_QUEUE_H__ /** * @file @@ -161,4 +161,4 @@ uint32_t ocf_queue_pending_io(ocf_queue_t q); */ bool ocf_queue_is_mngt(ocf_queue_t queue); -#endif +#endif /* __OCF_QUEUE_H__ */ diff --git a/inc/ocf_types.h b/inc/ocf_types.h index 64d419da5..911c40ca6 100644 --- a/inc/ocf_types.h +++ b/inc/ocf_types.h @@ -8,8 +8,8 @@ * @file * @brief OCF types */ -#ifndef __OCF_TYPES_H_ -#define __OCF_TYPES_H_ +#ifndef __OCF_TYPES_H__ +#define __OCF_TYPES_H__ #include "ocf_env_headers.h" @@ -110,4 +110,4 @@ typedef struct ocf_metadata_updater *ocf_metadata_updater_t; */ typedef struct ocf_logger *ocf_logger_t; -#endif +#endif /* __OCF_TYPES_H__ */ diff --git a/src/cleaning/acp.h b/src/cleaning/acp.h index 3d5a4b7f3..e20e338a4 100644 --- a/src/cleaning/acp.h +++ b/src/cleaning/acp.h @@ -4,9 +4,9 @@ * Copyright(c) 2026 Unvertical * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __LAYER_CLEANING_POLICY_AGGRESSIVE_H__ +#ifndef __CLEANING_ACP_H__ -#define __LAYER_CLEANING_POLICY_AGGRESSIVE_H__ +#define __CLEANING_ACP_H__ #include "cleaning.h" @@ -50,5 +50,5 @@ int cleaning_policy_acp_add_core(ocf_cache_t cache, ocf_core_id_t core_id); void cleaning_policy_acp_remove_core(ocf_cache_t cache, ocf_core_id_t core_id); -#endif +#endif /* __CLEANING_ACP_H__ */ diff --git a/src/cleaning/acp_structs.h b/src/cleaning/acp_structs.h deleted file mode 100644 index ca29f8f63..000000000 --- a/src/cleaning/acp_structs.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright(c) 2012-2021 Intel Corporation - * Copyright(c) 2023-2025 Huawei Technologies Co., Ltd. - * Copyright(c) 2026 Unvertical - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef __CLEANING_AGGRESSIVE_STRUCTS_H__ -#define __CLEANING_AGGRESSIVE_STRUCTS_H__ - -#include "../metadata/metadata_cleaning_policy.h" - - -#endif - - diff --git a/src/cleaning/alru.h b/src/cleaning/alru.h index 6b06c1f1e..cba16c9c9 100644 --- a/src/cleaning/alru.h +++ b/src/cleaning/alru.h @@ -4,12 +4,11 @@ * Copyright(c) 2026 Unvertical * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __LAYER_CLEANING_POLICY_ALRU_H__ +#ifndef __CLEANING_ALRU_H__ -#define __LAYER_CLEANING_POLICY_ALRU_H__ +#define __CLEANING_ALRU_H__ #include "cleaning.h" -#include "alru_structs.h" void cleaning_policy_alru_setup(ocf_cache_t cache); int cleaning_policy_alru_initialize(ocf_cache_t cache); @@ -34,5 +33,5 @@ int cleaning_policy_alru_get_cleaning_param(ocf_cache_t cache, uint32_t param_id, uint32_t *param_value); void cleaning_alru_perform_cleaning(ocf_cache_t cache, ocf_cleaner_end_t cmpl); -#endif +#endif /* __CLEANING_ALRU_H__ */ diff --git a/src/cleaning/alru_structs.h b/src/cleaning/alru_structs.h deleted file mode 100644 index 7df658c26..000000000 --- a/src/cleaning/alru_structs.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright(c) 2012-2021 Intel Corporation - * Copyright(c) 2022 David Lee - * Copyright(c) 2025 Huawei Technologies - * Copyright(c) 2026 Unvertical - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef __CLEANING_ALRU_STRUCTS_H__ -#define __CLEANING_ALRU_STRUCTS_H__ - -#include "../metadata/metadata_cleaning_policy.h" - - - -#endif diff --git a/src/cleaning/cleaning.h b/src/cleaning/cleaning.h index 5a0220437..a46a21bc3 100644 --- a/src/cleaning/cleaning.h +++ b/src/cleaning/cleaning.h @@ -5,12 +5,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __LAYER_CLEANING_POLICY_H__ -#define __LAYER_CLEANING_POLICY_H__ +#ifndef __CLEANING_H__ +#define __CLEANING_H__ -#include "alru_structs.h" -#include "nop_structs.h" -#include "acp_structs.h" #include "../metadata/metadata_cleaning_policy.h" #include "ocf_env_refcnt.h" #include "ocf/ocf_cleaner.h" @@ -36,4 +33,4 @@ void ocf_stop_cleaner(ocf_cache_t cache); typedef void (*ocf_cleaning_op_end_t)(void *priv, int error); -#endif +#endif /* __CLEANING_H__ */ diff --git a/src/cleaning/cleaning_ops.h b/src/cleaning/cleaning_ops.h index 6e98da5f0..bb8b2274e 100644 --- a/src/cleaning/cleaning_ops.h +++ b/src/cleaning/cleaning_ops.h @@ -5,6 +5,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#ifndef __CLEANING_OPS_H__ +#define __CLEANING_OPS_H__ + #include "alru.h" #include "nop.h" #include "acp.h" @@ -337,3 +340,5 @@ static inline const char *ocf_cleaning_get_name(ocf_cleaning_t policy) return cleaning_policy_ops[policy].name; } + +#endif /* __CLEANING_OPS_H__ */ diff --git a/src/cleaning/cleaning_priv.h b/src/cleaning/cleaning_priv.h index d43144cdf..78078491f 100644 --- a/src/cleaning/cleaning_priv.h +++ b/src/cleaning/cleaning_priv.h @@ -3,6 +3,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#ifndef __CLEANING_PRIV_H__ +#define __CLEANING_PRIV_H__ + static inline void cleaning_policy_param_error(ocf_cache_t cache, const char *param_name, uint32_t min, uint32_t max) { @@ -17,3 +20,5 @@ static inline void cleaning_policy_param_error(ocf_cache_t cache, return -OCF_ERR_INVAL; \ } \ }) + +#endif /* __CLEANING_PRIV_H__ */ diff --git a/src/cleaning/nop.h b/src/cleaning/nop.h index 599ec97b4..64fe1a58d 100644 --- a/src/cleaning/nop.h +++ b/src/cleaning/nop.h @@ -3,12 +3,11 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __LAYER_CLEANING_POLICY_NOP_H__ -#define __LAYER_CLEANING_POLICY_NOP_H__ +#ifndef __CLEANING_NOP_H__ +#define __CLEANING_NOP_H__ #include "cleaning.h" -#include "nop_structs.h" void cleaning_nop_perform_cleaning(ocf_cache_t cache, ocf_cleaner_end_t cmpl); -#endif +#endif /* __CLEANING_NOP_H__ */ diff --git a/src/cleaning/nop_structs.h b/src/cleaning/nop_structs.h deleted file mode 100644 index 93be0d79e..000000000 --- a/src/cleaning/nop_structs.h +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright(c) 2012-2021 Intel Corporation - * Copyright(c) 2026 Unvertical - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef __LAYER_CLEANING_POLICY_NOP_STRUCTS_H__ - -#define __LAYER_CLEANING_POLICY_NOP_STRUCTS_H__ - - -#endif diff --git a/src/concurrency/ocf_cache_line_concurrency.h b/src/concurrency/ocf_cache_line_concurrency.h index ece2079d6..6ceb3b9ad 100644 --- a/src/concurrency/ocf_cache_line_concurrency.h +++ b/src/concurrency/ocf_cache_line_concurrency.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef OCF_CACHE_CONCURRENCY_H_ -#define OCF_CACHE_CONCURRENCY_H_ +#ifndef __OCF_CACHE_LINE_CONCURRENCY_H__ +#define __OCF_CACHE_LINE_CONCURRENCY_H__ #include "../utils/utils_alock.h" @@ -189,4 +189,4 @@ ocf_cache_line_concurrency(ocf_cache_t cache) return cache->device->concurrency.cache_line; } -#endif /* OCF_CONCURRENCY_H_ */ +#endif /* __OCF_CACHE_LINE_CONCURRENCY_H__ */ diff --git a/src/concurrency/ocf_concurrency.h b/src/concurrency/ocf_concurrency.h index 8ec6bf1b3..c22725a2a 100644 --- a/src/concurrency/ocf_concurrency.h +++ b/src/concurrency/ocf_concurrency.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef OCF_CONCURRENCY_H_ -#define OCF_CONCURRENCY_H_ +#ifndef __OCF_CONCURRENCY_H__ +#define __OCF_CONCURRENCY_H__ #include "../ocf_cache_priv.h" @@ -30,4 +30,4 @@ void ocf_concurrency_deinit(struct ocf_cache *cache); #include "ocf_cache_line_concurrency.h" -#endif /* OCF_CONCURRENCY_H_ */ +#endif /* __OCF_CONCURRENCY_H__ */ diff --git a/src/concurrency/ocf_metadata_concurrency.h b/src/concurrency/ocf_metadata_concurrency.h index 234aecbb2..c4db69bad 100644 --- a/src/concurrency/ocf_metadata_concurrency.h +++ b/src/concurrency/ocf_metadata_concurrency.h @@ -4,13 +4,13 @@ * Copyright(c) 2026 Unvertical * SPDX-License-Identifier: BSD-3-Clause */ +#ifndef __OCF_METADATA_CONCURRENCY_H__ +#define __OCF_METADATA_CONCURRENCY_H__ + #include "../ocf_cache_priv.h" #include "../ocf_space.h" #include "../ocf_queue_priv.h" -#ifndef __OCF_METADATA_CONCURRENCY_H__ -#define __OCF_METADATA_CONCURRENCY_H__ - #define OCF_METADATA_RD 0 #define OCF_METADATA_WR 1 @@ -163,4 +163,4 @@ void ocf_collision_start_exclusive_access(struct ocf_metadata_lock *metadata_loc uint32_t page); void ocf_collision_end_exclusive_access(struct ocf_metadata_lock *metadata_lock, uint32_t page); -#endif +#endif /* __OCF_METADATA_CONCURRENCY_H__ */ diff --git a/src/concurrency/ocf_mio_concurrency.h b/src/concurrency/ocf_mio_concurrency.h index f285ac083..f4e7d635e 100644 --- a/src/concurrency/ocf_mio_concurrency.h +++ b/src/concurrency/ocf_mio_concurrency.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef OCF_MIO_CONCURRENCY_H_ -#define OCF_MIO_CONCURRENCY_H_ +#ifndef __OCF_MIO_CONCURRENCY_H__ +#define __OCF_MIO_CONCURRENCY_H__ #include "../utils/utils_alock.h" @@ -23,4 +23,4 @@ int ocf_mio_concurrency_init(struct ocf_alock **self, void ocf_mio_concurrency_deinit(struct ocf_alock **self); -#endif +#endif /* __OCF_MIO_CONCURRENCY_H__ */ diff --git a/src/concurrency/ocf_pio_concurrency.h b/src/concurrency/ocf_pio_concurrency.h index 7318bdbe9..1c6fbc737 100644 --- a/src/concurrency/ocf_pio_concurrency.h +++ b/src/concurrency/ocf_pio_concurrency.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __OCF_PIO_CONCURRENCY_H_ -#define __OCF_PIO_CONCURRENCY_H_ +#ifndef __OCF_PIO_CONCURRENCY_H__ +#define __OCF_PIO_CONCURRENCY_H__ #include "../utils/utils_alock.h" @@ -17,4 +17,4 @@ int ocf_pio_concurrency_init(struct ocf_alock **self, ocf_cache_t cache); void ocf_pio_concurrency_deinit(struct ocf_alock **self); -#endif +#endif /* __OCF_PIO_CONCURRENCY_H__ */ diff --git a/src/engine/cache_engine.h b/src/engine/cache_engine.h index 65b5495b1..0bcb09412 100644 --- a/src/engine/cache_engine.h +++ b/src/engine/cache_engine.h @@ -5,8 +5,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __CACHE_ENGINE_H_ -#define __CACHE_ENGINE_H_ +#ifndef __CACHE_ENGINE_H__ +#define __CACHE_ENGINE_H__ #include "../ocf_request.h" @@ -49,4 +49,4 @@ void ocf_engine_hndl_flush_req(struct ocf_request *req); void ocf_engine_hndl_discard_req(struct ocf_request *req); -#endif +#endif /* __CACHE_ENGINE_H__ */ diff --git a/src/engine/engine_bf.h b/src/engine/engine_bf.h index 17d17c9b0..ca5eb7ca2 100644 --- a/src/engine/engine_bf.h +++ b/src/engine/engine_bf.h @@ -3,9 +3,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_BF_H_ -#define ENGINE_BF_H_ +#ifndef __ENGINE_BF_H__ +#define __ENGINE_BF_H__ void ocf_engine_backfill(struct ocf_request *req); -#endif /* ENGINE_BF_H_ */ +#endif /* __ENGINE_BF_H__ */ diff --git a/src/engine/engine_common.h b/src/engine/engine_common.h index 392900a0d..0c2d67ba7 100644 --- a/src/engine/engine_common.h +++ b/src/engine/engine_common.h @@ -5,8 +5,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_COMMON_H_ -#define ENGINE_COMMON_H_ +#ifndef __ENGINE_COMMON_H__ +#define __ENGINE_COMMON_H__ #include "../ocf_request.h" #include "../utils/utils_cache_line.h" @@ -304,4 +304,4 @@ void ocf_engine_on_resume(struct ocf_request *req); void ocf_engine_set_hot(struct ocf_request *req); -#endif /* ENGINE_COMMON_H_ */ +#endif /* __ENGINE_COMMON_H__ */ diff --git a/src/engine/engine_d2c.h b/src/engine/engine_d2c.h index 9e0673bad..3bd9290bf 100644 --- a/src/engine/engine_d2c.h +++ b/src/engine/engine_d2c.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_2DC_H_ -#define ENGINE_2DC_H_ +#ifndef __ENGINE_D2C_H__ +#define __ENGINE_D2C_H__ int ocf_d2c_io_fast(struct ocf_request *req); @@ -13,4 +13,4 @@ int ocf_d2c_flush_fast(struct ocf_request *req); int ocf_d2c_discard_fast(struct ocf_request *req); -#endif /* ENGINE_2DC_H_ */ +#endif /* __ENGINE_D2C_H__ */ diff --git a/src/engine/engine_debug.h b/src/engine/engine_debug.h index 8f54e485c..aa6a42c3a 100644 --- a/src/engine/engine_debug.h +++ b/src/engine/engine_debug.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_DEBUG_H_ -#define ENGINE_DEBUG_H_ +#ifndef __ENGINE_DEBUG_H__ +#define __ENGINE_DEBUG_H__ #ifndef OCF_ENGINE_DEBUG #define OCF_ENGINE_DEBUG 0 @@ -46,4 +46,4 @@ #define OCF_DEBUG_RQ(req, format, ...) #endif -#endif /* ENGINE_DEBUG_H_ */ +#endif /* __ENGINE_DEBUG_H__ */ diff --git a/src/engine/engine_discard.h b/src/engine/engine_discard.h index ec6335557..f7816fdb0 100644 --- a/src/engine/engine_discard.h +++ b/src/engine/engine_discard.h @@ -9,4 +9,4 @@ int ocf_engine_discard(struct ocf_request *req); -#endif +#endif /* __ENGINE_DISCARD_H__ */ diff --git a/src/engine/engine_fast.h b/src/engine/engine_fast.h index 1767f3cb2..674d7f3ed 100644 --- a/src/engine/engine_fast.h +++ b/src/engine/engine_fast.h @@ -3,10 +3,10 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_FAST_H_ -#define ENGINE_FAST_H_ +#ifndef __ENGINE_FAST_H__ +#define __ENGINE_FAST_H__ int ocf_read_fast(struct ocf_request *req); int ocf_write_fast(struct ocf_request *req); -#endif /* ENGINE_WI_H_ */ +#endif /* __ENGINE_FAST_H__ */ diff --git a/src/engine/engine_flush.h b/src/engine/engine_flush.h index b074c7c90..4dc9faf36 100644 --- a/src/engine/engine_flush.h +++ b/src/engine/engine_flush.h @@ -4,9 +4,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __CACHE_ENGINE_FLUSH_H_ -#define __CACHE_ENGINE_FLUSH_H_ +#ifndef __ENGINE_FLUSH_H__ +#define __ENGINE_FLUSH_H__ int ocf_engine_flush(struct ocf_request *req); -#endif /* __CACHE_ENGINE_FLUSH_H_ */ +#endif /* __ENGINE_FLUSH_H__ */ diff --git a/src/engine/engine_inv.h b/src/engine/engine_inv.h index cb28a7332..a74eb1f58 100644 --- a/src/engine/engine_inv.h +++ b/src/engine/engine_inv.h @@ -3,9 +3,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_INV_H_ -#define ENGINE_INV_H_ +#ifndef __ENGINE_INV_H__ +#define __ENGINE_INV_H__ void ocf_engine_invalidate(struct ocf_request *req); -#endif /* ENGINE_INV_H_ */ +#endif /* __ENGINE_INV_H__ */ diff --git a/src/engine/engine_io.h b/src/engine/engine_io.h index 16a2a3382..de9ed9570 100644 --- a/src/engine/engine_io.h +++ b/src/engine/engine_io.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_IO_H_ -#define ENGINE_IO_H_ +#ifndef __ENGINE_IO_H__ +#define __ENGINE_IO_H__ #include "../ocf_request.h" @@ -29,4 +29,4 @@ void ocf_engine_forward_core_flush_req(struct ocf_request *req, void ocf_engine_forward_core_discard_req(struct ocf_request *req, ocf_req_end_t callback); -#endif /* ENGINE_IO_H_ */ +#endif /* __ENGINE_IO_H__ */ diff --git a/src/engine/engine_pt.h b/src/engine/engine_pt.h index 9bea3bb17..4742d6c4a 100644 --- a/src/engine/engine_pt.h +++ b/src/engine/engine_pt.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_OFF_H_ -#define ENGINE_OFF_H_ +#ifndef __ENGINE_PT_H__ +#define __ENGINE_PT_H__ int ocf_read_pt(struct ocf_request *req); @@ -13,4 +13,4 @@ int ocf_read_pt_do(struct ocf_request *req); void ocf_queue_push_req_pt(struct ocf_request *req); -#endif /* ENGINE_OFF_H_ */ +#endif /* __ENGINE_PT_H__ */ diff --git a/src/engine/engine_rd.h b/src/engine/engine_rd.h index 8cb4007a8..ae5c025d0 100644 --- a/src/engine/engine_rd.h +++ b/src/engine/engine_rd.h @@ -3,11 +3,11 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_RD_H_ -#define ENGINE_RD_H_ +#ifndef __ENGINE_RD_H__ +#define __ENGINE_RD_H__ int ocf_read_generic(struct ocf_request *req); void ocf_read_generic_submit_hit(struct ocf_request *req); -#endif /* ENGINE_RD_H_ */ +#endif /* __ENGINE_RD_H__ */ diff --git a/src/engine/engine_wa.h b/src/engine/engine_wa.h index 0c39916c7..902d816ee 100644 --- a/src/engine/engine_wa.h +++ b/src/engine/engine_wa.h @@ -3,9 +3,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_WA_H_ -#define ENGINE_WA_H_ +#ifndef __ENGINE_WA_H__ +#define __ENGINE_WA_H__ int ocf_write_wa(struct ocf_request *req); -#endif /* ENGINE_WA_H_ */ +#endif /* __ENGINE_WA_H__ */ diff --git a/src/engine/engine_wb.h b/src/engine/engine_wb.h index f9b4a8c5d..b7ffa6102 100644 --- a/src/engine/engine_wb.h +++ b/src/engine/engine_wb.h @@ -3,11 +3,11 @@ * Copyright(c) 2026 Unvertical * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_WB_H_ -#define ENGINE_WB_H_ +#ifndef __ENGINE_WB_H__ +#define __ENGINE_WB_H__ int ocf_write_wb(struct ocf_request *req); int ocf_write_wb_do(struct ocf_request *req); -#endif /* ENGINE_WB_H_ */ +#endif /* __ENGINE_WB_H__ */ diff --git a/src/engine/engine_wi.h b/src/engine/engine_wi.h index 624336acf..5bdbe7f14 100644 --- a/src/engine/engine_wi.h +++ b/src/engine/engine_wi.h @@ -3,9 +3,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_WI_H_ -#define ENGINE_WI_H_ +#ifndef __ENGINE_WI_H__ +#define __ENGINE_WI_H__ int ocf_write_wi(struct ocf_request *req); -#endif /* ENGINE_WI_H_ */ +#endif /* __ENGINE_WI_H__ */ diff --git a/src/engine/engine_wo.h b/src/engine/engine_wo.h index 3c53e43cd..9f3c365f8 100644 --- a/src/engine/engine_wo.h +++ b/src/engine/engine_wo.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_WO_H_ -#define ENGINE_WO_H_ +#ifndef __ENGINE_WO_H__ +#define __ENGINE_WO_H__ #include "engine_common.h" int ocf_read_wo(struct ocf_request *req); -#endif /* ENGINE_WO_H_ */ +#endif /* __ENGINE_WO_H__ */ diff --git a/src/engine/engine_wt.h b/src/engine/engine_wt.h index 6d609eebe..2135f993a 100644 --- a/src/engine/engine_wt.h +++ b/src/engine/engine_wt.h @@ -3,9 +3,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_WT_H_ -#define ENGINE_WT_H_ +#ifndef __ENGINE_WT_H__ +#define __ENGINE_WT_H__ int ocf_write_wt(struct ocf_request *req); -#endif /* ENGINE_WT_H_ */ +#endif /* __ENGINE_WT_H__ */ diff --git a/src/engine/engine_zero.h b/src/engine/engine_zero.h index 5a24336a7..b3eeaae01 100644 --- a/src/engine/engine_zero.h +++ b/src/engine/engine_zero.h @@ -3,9 +3,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ENGINE_ZERO_H_ -#define ENGINE_ZERO_H_ +#ifndef __ENGINE_ZERO_H__ +#define __ENGINE_ZERO_H__ void ocf_engine_zero_line(struct ocf_request *req); -#endif /* ENGINE_ZERO_H_ */ +#endif /* __ENGINE_ZERO_H__ */ diff --git a/src/metadata/metadata.h b/src/metadata/metadata.h index d27103aed..3c95933b8 100644 --- a/src/metadata/metadata.h +++ b/src/metadata/metadata.h @@ -60,13 +60,6 @@ int ocf_metadata_init_variable_size(struct ocf_cache *cache, uint64_t device_size, ocf_cache_line_size_t line_size, bool cleaner_disabled); -/** - * @brief Initialize collision table - * - * @param cache - Cache instance - */ -void ocf_metadata_init_freelist_partition(struct ocf_cache *cache); - /** * @brief Initialize hash table * @@ -243,4 +236,4 @@ bool ocf_metadata_check(struct ocf_cache *cache, ocf_cache_line_t line); bool ocf_metadata_is_hit_no_lock(ocf_cache_t cache, ocf_core_id_t core_id, uint64_t core_line); -#endif /* METADATA_H_ */ +#endif /* __METADATA_H__ */ diff --git a/src/metadata/metadata_cleaning_policy.h b/src/metadata/metadata_cleaning_policy.h index ddc7cb9e0..a3f9bfe2d 100644 --- a/src/metadata/metadata_cleaning_policy.h +++ b/src/metadata/metadata_cleaning_policy.h @@ -84,4 +84,4 @@ ocf_metadata_get_cleaning_policy(struct ocf_cache *cache, ocf_cache_line_t line); -#endif /* METADATA_CLEANING_POLICY_H_ */ +#endif /* __METADATA_CLEANING_POLICY_H__ */ diff --git a/src/metadata/metadata_collision.h b/src/metadata/metadata_collision.h index a8672b4c0..d2a0c5ef3 100644 --- a/src/metadata/metadata_collision.h +++ b/src/metadata/metadata_collision.h @@ -162,4 +162,4 @@ void ocf_metadata_start_collision_shared_access( void ocf_metadata_end_collision_shared_access( struct ocf_cache *cache, ocf_cache_line_t line); -#endif /* METADATA_COLLISION_H_ */ +#endif /* __METADATA_COLLISION_H__ */ diff --git a/src/metadata/metadata_core.h b/src/metadata/metadata_core.h index 4757bae4e..db106a0d9 100644 --- a/src/metadata/metadata_core.h +++ b/src/metadata/metadata_core.h @@ -71,4 +71,4 @@ void ocf_metadata_get_core_and_part_id( struct ocf_cache *cache, ocf_cache_line_t line, ocf_core_id_t *core_id, ocf_part_id_t *part_id); -#endif /* METADATA_CORE_H_ */ +#endif /* __METADATA_CORE_H__ */ diff --git a/src/metadata/metadata_internal.h b/src/metadata/metadata_internal.h index 9b4cbbcbe..9910a346d 100644 --- a/src/metadata/metadata_internal.h +++ b/src/metadata/metadata_internal.h @@ -37,4 +37,4 @@ struct ocf_metadata_context { extern const char * const ocf_metadata_segment_names[]; -#endif +#endif /* __METADATA_INTERNAL_H__ */ diff --git a/src/metadata/metadata_passive_update.h b/src/metadata/metadata_passive_update.h index fe5f9400e..246183867 100644 --- a/src/metadata/metadata_passive_update.h +++ b/src/metadata/metadata_passive_update.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __OCF_METADATA_PASSIVE_IO_H__ -#define __OCF_METADATA_PASSIVE_IO_H__ +#ifndef __METADATA_PASSIVE_UPDATE_H__ +#define __METADATA_PASSIVE_UPDATE_H__ int ocf_metadata_passive_update(struct ocf_request *master); @@ -13,4 +13,4 @@ int ocf_metadata_passive_io_ctx_init(ocf_cache_t cache); void ocf_metadata_passive_io_ctx_deinit(ocf_cache_t cache); -#endif +#endif /* __METADATA_PASSIVE_UPDATE_H__ */ diff --git a/src/metadata/metadata_raw.h b/src/metadata/metadata_raw.h index b4ac4e8c7..deade2623 100644 --- a/src/metadata/metadata_raw.h +++ b/src/metadata/metadata_raw.h @@ -7,6 +7,7 @@ #ifndef __METADATA_RAW_H__ #define __METADATA_RAW_H__ +#include "metadata_common.h" #include "metadata_segment_id.h" #include "metadata_layout.h" #include "../concurrency/ocf_mio_concurrency.h" @@ -343,11 +344,6 @@ static inline bool _raw_is_valid(struct ocf_metadata_raw *raw, uint32_t entry) return true; } -static inline void _raw_bug_on(struct ocf_metadata_raw *raw, uint32_t entry) -{ - ENV_BUG_ON(!_raw_is_valid(raw, entry)); -} - #define MAX_STACK_TAB_SIZE 32 int _raw_ram_flush_do_page_cmp(const void *item1, const void *item2); @@ -357,4 +353,4 @@ static inline void *ocf_metadata_raw_get_mem(struct ocf_metadata_raw *raw) return raw->mem_pool; } -#endif /* METADATA_RAW_H_ */ +#endif /* __METADATA_RAW_H__ */ diff --git a/src/metadata/metadata_raw_dynamic.h b/src/metadata/metadata_raw_dynamic.h index daf4f361c..79a13fbd7 100644 --- a/src/metadata/metadata_raw_dynamic.h +++ b/src/metadata/metadata_raw_dynamic.h @@ -94,4 +94,4 @@ int raw_dynamic_flush_do_asynch(ocf_cache_t cache, struct ocf_request *req, struct ocf_metadata_raw *raw, ocf_req_end_t complete); -#endif /* METADATA_RAW_H_ */ +#endif /* __METADATA_RAW_DYNAMIC_H__ */ diff --git a/src/metadata/metadata_segment.h b/src/metadata/metadata_segment.h index f57e3cd5f..84b69c3f1 100644 --- a/src/metadata/metadata_segment.h +++ b/src/metadata/metadata_segment.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __METADATA_SEGMENT_OPS_H__ -#define __METADATA_SEGMENT_OPS_H__ +#ifndef __METADATA_SEGMENT_H__ +#define __METADATA_SEGMENT_H__ #include "../utils/utils_pipeline.h" #include "metadata_raw.h" @@ -48,4 +48,4 @@ void ocf_metadata_flush_segment(ocf_pipeline_t pipeline, void ocf_metadata_load_segment(ocf_pipeline_t pipeline, void *priv, ocf_pipeline_arg_t arg); -#endif +#endif /* __METADATA_SEGMENT_H__ */ diff --git a/src/metadata/metadata_segment_id.h b/src/metadata/metadata_segment_id.h index 55bcf02d0..411be1a4f 100644 --- a/src/metadata/metadata_segment_id.h +++ b/src/metadata/metadata_segment_id.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __METADATA_HASH_H__ -#define __METADATA_HASH_H__ +#ifndef __METADATA_SEGMENT_ID_H__ +#define __METADATA_SEGMENT_ID_H__ /** * @file metadata_.h @@ -41,4 +41,4 @@ enum ocf_metadata_segment_id { metadata_segment_max, /*!< MAX */ }; -#endif /* METADATA_HASH_H_ */ +#endif /* __METADATA_SEGMENT_ID_H__ */ diff --git a/src/metadata/metadata_status.h b/src/metadata/metadata_status.h index 4eb31c280..271552618 100644 --- a/src/metadata/metadata_status.h +++ b/src/metadata/metadata_status.h @@ -342,4 +342,4 @@ static inline bool metadata_clear_valid_sec_changed( return line_was_valid && !_line_remains_valid; } -#endif /* METADATA_STATUS_H_ */ +#endif /* __METADATA_STATUS_H__ */ diff --git a/src/metadata/metadata_structs.h b/src/metadata/metadata_structs.h index dbecac47f..3d2693d63 100644 --- a/src/metadata/metadata_structs.h +++ b/src/metadata/metadata_structs.h @@ -20,16 +20,6 @@ * @brief Metadata private structures */ -/** - * @brief Query cores completion callback - * - * @param priv - Caller private data - * @param error - Operation error status - * @param num_cores - Number of cores in metadata - */ -typedef void (*ocf_metadata_query_cores_end_t)(void *priv, int error, - unsigned int num_cores); - #define OCF_METADATA_GLOBAL_LOCK_IDX_BITS 2 #define OCF_NUM_GLOBAL_META_LOCKS (1 << (OCF_METADATA_GLOBAL_LOCK_IDX_BITS)) diff --git a/src/metadata/metadata_superblock.h b/src/metadata/metadata_superblock.h index d8098d7be..d5a003ea9 100644 --- a/src/metadata/metadata_superblock.h +++ b/src/metadata/metadata_superblock.h @@ -165,10 +165,7 @@ struct ocf_metadata_read_sb_ctx { int ocf_metadata_read_sb(ocf_ctx_t ctx, ocf_volume_t volume, ocf_metadata_read_sb_end_t cmpl, void *priv1, void *priv2); -void ocf_metadata_sb_crc_recovery(ocf_cache_t cache, - ocf_metadata_end_t cmpl, void *priv); - void ocf_metadata_sb_zero(struct ocf_metadata_segment *self, ocf_metadata_end_t cmpl, void *priv); -#endif /* METADATA_SUPERBLOCK_H_ */ +#endif /* __METADATA_SUPERBLOCK_H__ */ diff --git a/src/ocf_composite_volume_priv.h b/src/ocf_composite_volume_priv.h index b4ad4d5fc..fb5e7bb39 100644 --- a/src/ocf_composite_volume_priv.h +++ b/src/ocf_composite_volume_priv.h @@ -10,4 +10,4 @@ int ocf_composite_volume_type_init(ocf_ctx_t ctx); -#endif /* __OCF_COMPOSITE_VOLUME_H__ */ +#endif /* __OCF_COMPOSITE_VOLUME_PRIV_H__ */ diff --git a/src/ocf_def_priv.h b/src/ocf_def_priv.h index d07ce7e35..85a61e308 100644 --- a/src/ocf_def_priv.h +++ b/src/ocf_def_priv.h @@ -86,4 +86,4 @@ struct ocf_request; typedef void (*ocf_req_end_t)(struct ocf_request *req, int error); -#endif +#endif /* __OCF_DEF_PRIV_H__ */ diff --git a/src/ocf_lru.h b/src/ocf_lru.h index 5f2b368dc..b42e4d336 100644 --- a/src/ocf_lru.h +++ b/src/ocf_lru.h @@ -4,8 +4,8 @@ * Copyright(c) 2026 Unvertical * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __EVICTION_LRU_H__ -#define __EVICTION_LRU_H__ +#ifndef __OCF_LRU_H__ +#define __OCF_LRU_H__ #include "ocf_space.h" #include "metadata/metadata_lru.h" @@ -47,4 +47,4 @@ typedef void (*ocf_lru_populate_end_t)(void *priv, int error); void ocf_lru_populate(ocf_cache_t cache, ocf_lru_populate_end_t cmpl, void *priv); -#endif +#endif /* __OCF_LRU_H__ */ diff --git a/src/ocf_part.h b/src/ocf_part.h index 76489e0be..65ef3848a 100644 --- a/src/ocf_part.h +++ b/src/ocf_part.h @@ -5,8 +5,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __METADATA_PARTITION_STRUCTS_H__ -#define __METADATA_PARTITION_STRUCTS_H__ +#ifndef __OCF_PART_H__ +#define __OCF_PART_H__ #include "utils/utils_list.h" #include "utils/utils_cleaner.h" @@ -73,4 +73,4 @@ struct ocf_user_part { }; -#endif /* __METADATA_PARTITION_STRUCTS_H__ */ +#endif /* __OCF_PART_H__ */ diff --git a/src/ocf_queue_priv.h b/src/ocf_queue_priv.h index 6419d1a4a..ff1da53cb 100644 --- a/src/ocf_queue_priv.h +++ b/src/ocf_queue_priv.h @@ -5,8 +5,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef OCF_QUEUE_PRIV_H_ -#define OCF_QUEUE_PRIV_H_ +#ifndef __OCF_QUEUE_PRIV_H__ +#define __OCF_QUEUE_PRIV_H__ #include "ocf_env.h" #include "ocf_request.h" @@ -72,4 +72,4 @@ void ocf_queue_push_req(struct ocf_request *req, uint flags); void ocf_queue_push_req_cb(struct ocf_request *req, ocf_req_cb req_cb, uint flags); -#endif +#endif /* __OCF_QUEUE_PRIV_H__ */ diff --git a/src/ocf_space.h b/src/ocf_space.h index d9fe2582e..2a97757ff 100644 --- a/src/ocf_space.h +++ b/src/ocf_space.h @@ -5,8 +5,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __LAYER_EVICTION_POLICY_H__ -#define __LAYER_EVICTION_POLICY_H__ +#ifndef __OCF_SPACE_H__ +#define __OCF_SPACE_H__ #include "ocf/ocf.h" #include "ocf_lru.h" @@ -40,4 +40,4 @@ int ocf_metadata_actor(struct ocf_cache *cache, ocf_part_id_t part_id, ocf_core_id_t core_id, uint64_t start_byte, uint64_t end_byte, ocf_metadata_actor_t actor); -#endif +#endif /* __OCF_SPACE_H__ */ diff --git a/src/ocf_stats_priv.h b/src/ocf_stats_priv.h index 892e8647a..bdb8a453b 100644 --- a/src/ocf_stats_priv.h +++ b/src/ocf_stats_priv.h @@ -292,4 +292,4 @@ int ocf_core_get_stats(ocf_core_t core, struct ocf_stats_core *stats); */ void ocf_core_update_stats(ocf_core_t core, ocf_io_t io); -#endif +#endif /* __OCF_STATS_PRIV_H__ */ diff --git a/src/ocf_volume_priv.h b/src/ocf_volume_priv.h index e5513df4e..b16389c15 100644 --- a/src/ocf_volume_priv.h +++ b/src/ocf_volume_priv.h @@ -88,4 +88,4 @@ static inline void ocf_volume_submit_write_zeroes(ocf_io_t io) volume->type->properties->ops.submit_write_zeroes(io); } -#endif /*__OCF_VOLUME_PRIV_H__ */ +#endif /* __OCF_VOLUME_PRIV_H__ */ diff --git a/src/promotion/nhit/nhit.h b/src/promotion/nhit/nhit.h index 567bc49dc..0facb4415 100644 --- a/src/promotion/nhit/nhit.h +++ b/src/promotion/nhit/nhit.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef NHIT_PROMOTION_POLICY_H_ -#define NHIT_PROMOTION_POLICY_H_ +#ifndef __NHIT_H__ +#define __NHIT_H__ #include "ocf/ocf.h" #include "../../ocf_request.h" @@ -29,4 +29,4 @@ void nhit_req_purge(ocf_promotion_policy_t policy, bool nhit_req_should_promote(ocf_promotion_policy_t policy, struct ocf_request *req); -#endif /* NHIT_PROMOTION_POLICY_H_ */ +#endif /* __NHIT_H__ */ diff --git a/src/promotion/nhit/nhit_hash.h b/src/promotion/nhit/nhit_hash.h index 71d8e0cd1..129051e1d 100644 --- a/src/promotion/nhit/nhit_hash.h +++ b/src/promotion/nhit/nhit_hash.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef NHIT_HASH_H_ -#define NHIT_HASH_H_ +#ifndef __NHIT_HASH_H__ +#define __NHIT_HASH_H__ #include "ocf/ocf.h" @@ -23,4 +23,4 @@ bool nhit_hash_query(nhit_hash_t ctx, ocf_core_id_t core_id, uint64_t core_lba, void nhit_hash_set_occurences(nhit_hash_t ctx, ocf_core_id_t core_id, uint64_t core_lba, int32_t occurences); -#endif /* NHIT_HASH_H_ */ +#endif /* __NHIT_HASH_H__ */ diff --git a/src/promotion/nhit/nhit_structs.h b/src/promotion/nhit/nhit_structs.h index 3b614e438..a12a756e9 100644 --- a/src/promotion/nhit/nhit_structs.h +++ b/src/promotion/nhit/nhit_structs.h @@ -3,9 +3,9 @@ * Copyright(c) 2026 Unvertical * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __PROMOTION_NHIT_STRUCTS_H_ -#define __PROMOTION_NHIT_STRUCTS_H_ +#ifndef __NHIT_STRUCTS_H__ +#define __NHIT_STRUCTS_H__ #include "../../metadata/metadata_promotion_policy.h" -#endif +#endif /* __NHIT_STRUCTS_H__ */ diff --git a/src/promotion/ops.h b/src/promotion/ops.h index 41f0593a3..b806cf615 100644 --- a/src/promotion/ops.h +++ b/src/promotion/ops.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef PROMOTION_OPS_H_ -#define PROMOTION_OPS_H_ +#ifndef __PROMOTION_OPS_H__ +#define __PROMOTION_OPS_H__ #include "../metadata/metadata.h" #include "promotion.h" @@ -53,5 +53,5 @@ struct promotion_policy_ops { extern struct promotion_policy_ops ocf_promotion_policies[ocf_promotion_max]; -#endif /* PROMOTION_OPS_H_ */ +#endif /* __PROMOTION_OPS_H__ */ diff --git a/src/promotion/promotion.h b/src/promotion/promotion.h index 684c1e844..1cdfdabaf 100644 --- a/src/promotion/promotion.h +++ b/src/promotion/promotion.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef PROMOTION_H_ -#define PROMOTION_H_ +#ifndef __PROMOTION_H__ +#define __PROMOTION_H__ #include "ocf/ocf.h" #include "../ocf_request.h" @@ -102,4 +102,4 @@ void ocf_promotion_req_purge(ocf_promotion_policy_t policy, bool ocf_promotion_req_should_promote(ocf_promotion_policy_t policy, struct ocf_request *req); -#endif /* PROMOTION_H_ */ +#endif /* __PROMOTION_H__ */ diff --git a/src/utils/utils_alock.h b/src/utils/utils_alock.h index 8a36a63f8..44fe8ffa3 100644 --- a/src/utils/utils_alock.h +++ b/src/utils/utils_alock.h @@ -3,8 +3,8 @@ * Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef OCF_UTILS_ALOCK_H_ -#define OCF_UTILS_ALOCK_H_ +#ifndef __UTILS_ALOCK_H__ +#define __UTILS_ALOCK_H__ /** * @brief Lock result - Lock acquired successfully @@ -109,4 +109,4 @@ void ocf_alock_waitlist_remove_entry(struct ocf_alock *alock, bool ocf_alock_trylock_entry_rd_idle(struct ocf_alock *alock, ocf_cache_line_t entry); -#endif +#endif /* __UTILS_ALOCK_H__ */ diff --git a/src/utils/utils_cache_line.h b/src/utils/utils_cache_line.h index 5029efe34..7ff50bbf9 100644 --- a/src/utils/utils_cache_line.h +++ b/src/utils/utils_cache_line.h @@ -5,8 +5,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef UTILS_CACHE_LINE_H_ -#define UTILS_CACHE_LINE_H_ +#ifndef __UTILS_CACHE_LINE_H__ +#define __UTILS_CACHE_LINE_H__ #include "../metadata/metadata.h" #include "../concurrency/ocf_cache_line_concurrency.h" @@ -373,4 +373,4 @@ static inline bool ocf_cache_line_size_is_valid(uint64_t size) } } -#endif /* UTILS_CACHE_LINE_H_ */ +#endif /* __UTILS_CACHE_LINE_H__ */ diff --git a/src/utils/utils_cleaner.h b/src/utils/utils_cleaner.h index fa11de3a9..9f87cfe1d 100644 --- a/src/utils/utils_cleaner.h +++ b/src/utils/utils_cleaner.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef UTILS_CLEANER_H_ -#define UTILS_CLEANER_H_ +#ifndef __UTILS_CLEANER_H__ +#define __UTILS_CLEANER_H__ #include "../ocf_request.h" @@ -156,4 +156,4 @@ void ocf_cleaner_refcnt_register_zero_cb(ocf_cache_t cache, struct ocf_cleaner_wait_context *ctx, ocf_cleaner_refcnt_zero_cb_t cb, void *priv); -#endif /* UTILS_CLEANER_H_ */ +#endif /* __UTILS_CLEANER_H__ */ diff --git a/src/utils/utils_io.h b/src/utils/utils_io.h index 742c0dc8f..b56f29ebe 100644 --- a/src/utils/utils_io.h +++ b/src/utils/utils_io.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef UTILS_IO_H_ -#define UTILS_IO_H_ +#ifndef __UTILS_IO_H__ +#define __UTILS_IO_H__ #include "../ocf_request.h" @@ -40,4 +40,4 @@ static inline ocf_io_t ocf_new_core_io(ocf_core_t core, addr, bytes, dir, io_class, flags); } -#endif /* UTILS_IO_H_ */ +#endif /* __UTILS_IO_H__ */ diff --git a/src/utils/utils_io_allocator.h b/src/utils/utils_io_allocator.h index ed01162f0..565006dc1 100644 --- a/src/utils/utils_io_allocator.h +++ b/src/utils/utils_io_allocator.h @@ -58,4 +58,4 @@ static inline void ocf_io_allocator_deinit(ocf_io_allocator_t allocator) ocf_io_allocator_type_t ocf_io_allocator_get_type_default(void); -#endif /* __UTILS_IO_ALLOCATOR__ */ +#endif /* __UTILS_IO_ALLOCATOR_H__ */ diff --git a/src/utils/utils_realloc.h b/src/utils/utils_realloc.h index e538c2852..7ebf5cf80 100644 --- a/src/utils/utils_realloc.h +++ b/src/utils/utils_realloc.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef UTILS_REALLOC_H_ -#define UTILS_REALLOC_H_ +#ifndef __UTILS_REALLOC_H__ +#define __UTILS_REALLOC_H__ /** * @file utils_realloc.h @@ -66,4 +66,4 @@ int ocf_realloc_cp(void **mem, size_t size, size_t count, size_t *limit); #define OCF_REALLOC_CP(mem, size, count, limit) \ ocf_realloc_cp((void **)mem, size, count, limit) -#endif /* UTILS_REALLOC_H_ */ +#endif /* __UTILS_REALLOC_H__ */ diff --git a/src/utils/utils_request.h b/src/utils/utils_request.h index 3cfab590e..ca0d627b3 100644 --- a/src/utils/utils_request.h +++ b/src/utils/utils_request.h @@ -3,6 +3,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#ifndef __UTILS_REQUEST_H__ +#define __UTILS_REQUEST_H__ + #include "../ocf_request.h" #include "../ocf_cache_priv.h" @@ -11,3 +14,5 @@ typedef int (*ocf_req_actor_t)(struct ocf_request *req, uint32_t map_idx); int ocf_req_actor(struct ocf_request *req, ocf_req_actor_t actor); void ocf_req_set_cleaning_hot(struct ocf_request *req); + +#endif /* __UTILS_REQUEST_H__ */ diff --git a/src/utils/utils_stats.h b/src/utils/utils_stats.h index b5a690cf0..72c32ce75 100644 --- a/src/utils/utils_stats.h +++ b/src/utils/utils_stats.h @@ -3,8 +3,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef UTILS_STATS_H_ -#define UTILS_STATS_H_ +#ifndef __UTILS_STATS_H__ +#define __UTILS_STATS_H__ #define _ocf_stats_zero(stats) \ do { \ @@ -47,4 +47,4 @@ static inline void _set(struct ocf_stat *stat, uint64_t value, stat->fraction = _fraction(value, denominator); } -#endif +#endif /* __UTILS_STATS_H__ */ diff --git a/src/utils/utils_user_part.h b/src/utils/utils_user_part.h index 5f0aa47af..481e53c88 100644 --- a/src/utils/utils_user_part.h +++ b/src/utils/utils_user_part.h @@ -5,8 +5,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __UTILS_PARTITION_H__ -#define __UTILS_PARTITION_H__ +#ifndef __UTILS_USER_PART_H__ +#define __UTILS_USER_PART_H__ #include "../ocf_request.h" #include "../engine/cache_engine.h" @@ -180,4 +180,4 @@ static inline bool ocf_user_part_is_name_valid(const char *name) return true; } -#endif /* __UTILS_PARTITION_H__ */ +#endif /* __UTILS_USER_PART_H__ */ diff --git a/tests/unit/tests/print_desc.h b/tests/unit/tests/print_desc.h index 39bb6b7da..ed55022c4 100644 --- a/tests/unit/tests/print_desc.h +++ b/tests/unit/tests/print_desc.h @@ -3,4 +3,9 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#ifndef __PRINT_DESC_H__ +#define __PRINT_DESC_H__ + #define print_test_description(description) print_message("[ DESC ] %s\n", description); + +#endif /* __PRINT_DESC_H__ */