From 5c4b5634cbb7ccc9fecab87e678627f3abb227ad Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Sat, 11 May 2024 00:29:56 +0200 Subject: [PATCH] Add missing "static" to the local functions Signed-off-by: Robert Baldyga --- modules/cas_cache/classifier.c | 3 ++- modules/cas_cache/context.c | 5 +++-- modules/cas_cache/layer_cache_management.c | 9 +++++---- modules/cas_cache/utils/utils_rpool.c | 3 ++- modules/cas_cache/volume/vol_blk_utils.c | 3 ++- modules/cas_cache/volume/vol_block_dev_bottom.c | 10 +++++----- modules/cas_cache/volume/vol_block_dev_bottom.h | 9 +-------- modules/cas_cache/volume/vol_block_dev_top.c | 2 +- 8 files changed, 21 insertions(+), 23 deletions(-) diff --git a/modules/cas_cache/classifier.c b/modules/cas_cache/classifier.c index b946a84..ca1c3af 100644 --- a/modules/cas_cache/classifier.c +++ b/modules/cas_cache/classifier.c @@ -1,5 +1,6 @@ /* * Copyright(c) 2019-2021 Intel Corporation +* Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ @@ -865,7 +866,7 @@ static void cas_set_classifier(ocf_cache_t cache, cache_priv->classifier = cls; } -void _cas_cls_rule_destroy(struct cas_classifier *cls, +static void _cas_cls_rule_destroy(struct cas_classifier *cls, struct cas_cls_rule *r) { struct list_head *item, *n; diff --git a/modules/cas_cache/context.c b/modules/cas_cache/context.c index 9b8e4b2..ed5b1cc 100644 --- a/modules/cas_cache/context.c +++ b/modules/cas_cache/context.c @@ -1,5 +1,6 @@ /* * Copyright(c) 2012-2022 Intel Corporation +* Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ @@ -52,7 +53,7 @@ static void _cas_page_set_cpu(struct page *page, int cpu) page->private = cpu; } -void *_cas_alloc_page_rpool(void *allocator_ctx, int cpu) +static void *_cas_alloc_page_rpool(void *allocator_ctx, int cpu) { struct page *page; @@ -81,7 +82,7 @@ static int _cas_page_get_cpu(struct page *page) /* * */ -ctx_data_t *__cas_ctx_data_alloc(uint32_t pages, bool zalloc) +static ctx_data_t *__cas_ctx_data_alloc(uint32_t pages, bool zalloc) { struct blk_data *data; uint32_t i; diff --git a/modules/cas_cache/layer_cache_management.c b/modules/cas_cache/layer_cache_management.c index d5a80bd..c907588 100644 --- a/modules/cas_cache/layer_cache_management.c +++ b/modules/cas_cache/layer_cache_management.c @@ -1,5 +1,6 @@ /* * Copyright(c) 2012-2022 Intel Corporation +* Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ @@ -1051,7 +1052,7 @@ struct get_paths_ctx { int position; }; -int _cache_mngt_core_pool_get_paths_visitor(ocf_uuid_t uuid, void *ctx) +static int _cache_mngt_core_pool_get_paths_visitor(ocf_uuid_t uuid, void *ctx) { struct get_paths_ctx *visitor_ctx = ctx; @@ -2222,7 +2223,7 @@ static int _cache_start_finalize(ocf_cache_t cache, int init_mode, return 0; } -int cache_mngt_check_bdev(struct ocf_mngt_cache_device_config *device_cfg, +static int cache_mngt_check_bdev(struct ocf_mngt_cache_device_config *cfg, bool force) { char holder[] = "CAS START\n"; @@ -2675,7 +2676,7 @@ out: * nonzero exit code means failure */ -int cache_mngt_set_seq_cutoff_promotion_count(ocf_cache_t cache, +static int cache_mngt_set_seq_cutoff_promotion_count(ocf_cache_t cache, ocf_core_t core, uint32_t count) { int result; @@ -2757,7 +2758,7 @@ int cache_mngt_get_seq_cutoff_policy(ocf_core_t core, * nonzero exit code means failure */ -int cache_mngt_get_seq_cutoff_promotion_count(ocf_core_t core, +static int cache_mngt_get_seq_cutoff_promotion_count(ocf_core_t core, uint32_t *count) { ocf_cache_t cache = ocf_core_get_cache(core); diff --git a/modules/cas_cache/utils/utils_rpool.c b/modules/cas_cache/utils/utils_rpool.c index d2de7c5..94ef093 100644 --- a/modules/cas_cache/utils/utils_rpool.c +++ b/modules/cas_cache/utils/utils_rpool.c @@ -1,5 +1,6 @@ /* * Copyright(c) 2012-2022 Intel Corporation +* Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ @@ -62,7 +63,7 @@ struct _cas_rpool_pre_alloc_info { (struct list_head *)((unsigned long)entry + rpool->entry_size \ - sizeof(struct list_head)) -void _cas_rpool_pre_alloc_do(struct work_struct *ws) +static void _cas_rpool_pre_alloc_do(struct work_struct *ws) { struct _cas_rpool_pre_alloc_info *info = container_of(ws, struct _cas_rpool_pre_alloc_info, ws); diff --git a/modules/cas_cache/volume/vol_blk_utils.c b/modules/cas_cache/volume/vol_blk_utils.c index 79368c6..6cb0736 100644 --- a/modules/cas_cache/volume/vol_blk_utils.c +++ b/modules/cas_cache/volume/vol_blk_utils.c @@ -1,5 +1,6 @@ /* * Copyright(c) 2012-2021 Intel Corporation +* Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ @@ -256,7 +257,7 @@ void cas_blk_close_volume(ocf_volume_t vol) env_free(vol); } -int _cas_blk_identify_type(const char *path, uint8_t *type) +static int _cas_blk_identify_type(const char *path, uint8_t *type) { struct file *file; int result = 0; diff --git a/modules/cas_cache/volume/vol_block_dev_bottom.c b/modules/cas_cache/volume/vol_block_dev_bottom.c index be3905e..31927ba 100644 --- a/modules/cas_cache/volume/vol_block_dev_bottom.c +++ b/modules/cas_cache/volume/vol_block_dev_bottom.c @@ -24,7 +24,7 @@ #define CAS_DEBUG_PARAM(format, ...) #endif -int block_dev_open_object(ocf_volume_t vol, void *volume_params) +static int block_dev_open_object(ocf_volume_t vol, void *volume_params) { struct bd_object *bdobj = bd_object(vol); const struct ocf_volume_uuid *uuid = ocf_volume_get_uuid(vol); @@ -51,7 +51,7 @@ int block_dev_open_object(ocf_volume_t vol, void *volume_params) return 0; } -void block_dev_close_object(ocf_volume_t vol) +static void block_dev_close_object(ocf_volume_t vol) { struct bd_object *bdobj = bd_object(vol); @@ -61,7 +61,7 @@ void block_dev_close_object(ocf_volume_t vol) cas_disk_close(bdobj->dsk); } -unsigned int block_dev_get_max_io_size(ocf_volume_t vol) +static unsigned int block_dev_get_max_io_size(ocf_volume_t vol) { struct bd_object *bdobj = bd_object(vol); struct block_device *bd = bdobj->btm_bd; @@ -69,7 +69,7 @@ unsigned int block_dev_get_max_io_size(ocf_volume_t vol) return queue_max_sectors(bd->bd_disk->queue) << SECTOR_SHIFT; } -uint64_t block_dev_get_byte_length(ocf_volume_t vol) +static uint64_t block_dev_get_byte_length(ocf_volume_t vol) { struct bd_object *bdobj = bd_object(vol); struct block_device *bd = bdobj->btm_bd; @@ -198,7 +198,7 @@ out: cas_bd_io_end(io, blkio->error); } -void block_dev_submit_discard(struct ocf_io *io) +static void block_dev_submit_discard(struct ocf_io *io) { struct blkio *blkio = cas_io_to_blkio(io); struct bd_object *bdobj = bd_object(ocf_io_get_volume(io)); diff --git a/modules/cas_cache/volume/vol_block_dev_bottom.h b/modules/cas_cache/volume/vol_block_dev_bottom.h index e037a14..a727f86 100644 --- a/modules/cas_cache/volume/vol_block_dev_bottom.h +++ b/modules/cas_cache/volume/vol_block_dev_bottom.h @@ -1,19 +1,12 @@ /* * Copyright(c) 2012-2022 Intel Corporation +* Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ #ifndef __VOL_BLOCK_DEV_BOTTOM_H__ #define __VOL_BLOCK_DEV_BOTTOM_H__ -#include "../cas_cache.h" - -int block_dev_open_object(ocf_volume_t vol, void *volume_params); - -void block_dev_close_object(ocf_volume_t vol); - -int block_dev_try_get_io_class(struct bio *bio, int *io_class); - int block_dev_init(void); #endif /* __VOL_BLOCK_DEV_BOTTOM_H__ */ diff --git a/modules/cas_cache/volume/vol_block_dev_top.c b/modules/cas_cache/volume/vol_block_dev_top.c index bcfa953..397dc26 100644 --- a/modules/cas_cache/volume/vol_block_dev_top.c +++ b/modules/cas_cache/volume/vol_block_dev_top.c @@ -31,7 +31,7 @@ static void blkdev_set_bio_data(struct blk_data *data, struct bio *bio) #endif } -void blkdev_set_exported_object_flush_fua(ocf_core_t core) +static void blkdev_set_exported_object_flush_fua(ocf_core_t core) { ocf_cache_t cache = ocf_core_get_cache(core); ocf_volume_t core_vol = ocf_core_get_volume(core);