Skip to content

Commit

Permalink
Merge pull request #793 from robertbaldyga/kernel-6.8
Browse files Browse the repository at this point in the history
Minor fixes to clean compile with newer Linux kernels
  • Loading branch information
robertbaldyga authored May 14, 2024
2 parents 4177454 + 168ecd0 commit 7c8ac29
Show file tree
Hide file tree
Showing 20 changed files with 65 additions and 54 deletions.
18 changes: 1 addition & 17 deletions src/concurrency/ocf_cache_line_concurrency.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2021 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down Expand Up @@ -111,23 +112,6 @@ void ocf_req_unlock_rd(struct ocf_alock *c,
void ocf_req_unlock(struct ocf_alock *c,
struct ocf_request *req);

/**
* @Check if cache line is used.
*
* Cache line is used when:
* 1. It is locked for write or read access
* or
* 2. There is set locked bit in metadata
*
* @param cache - OCF cache instance
* @param line - Cache line to be unlocked
*
* @retval true - cache line is used
* @retval false - cache line is not used
*/
bool ocf_cache_line_is_used(struct ocf_alock *c,
ocf_cache_line_t line);

/**
* @brief Check if for specified cache line there are waiters
* on the waiting list
Expand Down
1 change: 1 addition & 0 deletions src/concurrency/ocf_pio_concurrency.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "ocf_concurrency.h"
#include "ocf_pio_concurrency.h"
#include "../metadata/metadata_internal.h"
#include "../metadata/metadata_io.h"
#include "../ocf_priv.h"
Expand Down
Binary file removed src/engine/.cache_engine.h.swp
Binary file not shown.
2 changes: 1 addition & 1 deletion src/engine/engine_discard.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static void _ocf_discard_step_complete(struct ocf_request *req, int error)
_ocf_discard_finish_step(req);
}

int _ocf_discard_step_do(struct ocf_request *req)
static int _ocf_discard_step_do(struct ocf_request *req)
{
struct ocf_cache *cache = req->cache;

Expand Down
3 changes: 2 additions & 1 deletion src/engine/engine_wi.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2022 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand All @@ -16,7 +17,7 @@
#define OCF_ENGINE_DEBUG_IO_NAME "wi"
#include "engine_debug.h"

int _ocf_write_wi_next_pass(struct ocf_request *req)
static int _ocf_write_wi_next_pass(struct ocf_request *req)
{
ocf_req_unlock_wr(ocf_cache_line_concurrency(req->cache), req);

Expand Down
4 changes: 3 additions & 1 deletion src/engine/engine_wo.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/*
* Copyright(c) 2019-2022 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

#include "ocf/ocf.h"
#include "engine_wo.h"
#include "../ocf_cache_priv.h"
#include "cache_engine.h"
#include "engine_common.h"
Expand Down Expand Up @@ -172,7 +174,7 @@ static void _ocf_read_wo_core_complete(struct ocf_request *req, int error)
ocf_engine_push_req_front(req, true);
}

int ocf_read_wo_do(struct ocf_request *req)
static int ocf_read_wo_do(struct ocf_request *req)
{
ocf_req_get(req);

Expand Down
3 changes: 3 additions & 0 deletions src/engine/engine_wo.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
/*
* Copyright(c) 2019-2021 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

#ifndef ENGINE_WO_H_
#define ENGINE_WO_H_

#include "engine_common.h"

int ocf_read_wo(struct ocf_request *req);

#endif /* ENGINE_WO_H_ */
7 changes: 4 additions & 3 deletions src/metadata/metadata_io.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2022 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "metadata.h"
Expand Down Expand Up @@ -97,7 +98,7 @@ static void metadata_io_read_i_atomic_step_end(struct ocf_io *io, int error)
metadata_io_read_i_atomic_complete(context, 0);
}

int metadata_io_read_i_atomic_step(struct ocf_request *req)
static int metadata_io_read_i_atomic_step(struct ocf_request *req)
{
struct metadata_io_read_i_atomic_context *context = req->priv;
ocf_cache_t cache = context->cache;
Expand Down Expand Up @@ -257,7 +258,7 @@ static int metadata_io_do(struct ocf_request *req)
return 0;
}

void metadata_io_req_finalize(struct metadata_io_request *m_req)
static void metadata_io_req_finalize(struct metadata_io_request *m_req)
{
struct metadata_io_request_asynch *a_req = m_req->asynch;

Expand Down Expand Up @@ -328,7 +329,7 @@ static void metadata_io_io_end(struct metadata_io_request *m_req, int error)
metadata_io_req_complete(m_req);
}

void metadata_io_req_end(struct metadata_io_request *m_req)
static void metadata_io_req_end(struct metadata_io_request *m_req)
{
struct metadata_io_request_asynch *a_req = m_req->asynch;
ocf_cache_t cache = m_req->cache;
Expand Down
3 changes: 2 additions & 1 deletion src/metadata/metadata_raw.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2021 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down Expand Up @@ -189,7 +190,7 @@ static uint32_t _raw_ram_checksum(ocf_cache_t cache,
/*
* RAM Implementation - Entry page number
*/
uint32_t _raw_ram_page(struct ocf_metadata_raw *raw, uint32_t entry)
static uint32_t _raw_ram_page(struct ocf_metadata_raw *raw, uint32_t entry)
{
ENV_BUG_ON(entry >= raw->entries);

Expand Down
3 changes: 2 additions & 1 deletion src/metadata/metadata_raw_dynamic.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2022 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down Expand Up @@ -37,7 +38,7 @@
* Check if page is valid for specified RAW descriptor
*/

uint32_t raw_dynamic_segment_size_on_ssd(struct ocf_metadata_raw *raw)
static uint32_t raw_dynamic_segment_size_on_ssd(struct ocf_metadata_raw *raw)
{
const size_t alignment = 128 * KiB / PAGE_SIZE;

Expand Down
9 changes: 9 additions & 0 deletions src/metadata/metadata_segment.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2020-2021 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand All @@ -16,6 +17,14 @@ struct ocf_metadata_segment
struct ocf_metadata_segment *superblock;
};

int ocf_metadata_segment_init_in_place(
struct ocf_metadata_segment *segment,
struct ocf_cache *cache,
struct ocf_metadata_raw *raw,
ocf_flush_page_synch_t lock_page_pfn,
ocf_flush_page_synch_t unlock_page_pfn,
struct ocf_metadata_segment *superblock);

int ocf_metadata_segment_init(
struct ocf_metadata_segment **self,
struct ocf_cache *cache,
Expand Down
10 changes: 2 additions & 8 deletions src/metadata/metadata_superblock.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/*
* Copyright(c) 2020-2022 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

#include "metadata.h"
#include "metadata_core.h"
#include "metadata_internal.h"
#include "metadata_segment.h"
#include "metadata_segment_id.h"
#include "metadata_superblock.h"
#include "../ocf_priv.h"
Expand All @@ -26,14 +28,6 @@
#define OCF_DEBUG_PARAM(cache, format, ...)
#endif

int ocf_metadata_segment_init_in_place(
struct ocf_metadata_segment *segment,
struct ocf_cache *cache,
struct ocf_metadata_raw *raw,
ocf_flush_page_synch_t lock_page_pfn,
ocf_flush_page_synch_t unlock_page_pfn,
struct ocf_metadata_segment *superblock);

/**
* @brief Super Block - Set Shutdown Status
*
Expand Down
8 changes: 4 additions & 4 deletions src/mngt/ocf_mngt_cache.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright(c) 2012-2022 Intel Corporation
* Copyright(c) 2023 Huawei Technologies
* Copyright(c) 2023-2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down Expand Up @@ -767,7 +767,7 @@ static void _ocf_mngt_load_init_structures(ocf_pipeline_t pipeline,
_ocf_mngt_init_metadata_complete, context, false);
}

void _ocf_mngt_load_metadata_complete(void *priv, int error)
static void _ocf_mngt_load_metadata_complete(void *priv, int error)
{
struct ocf_cache_attach_context *context = priv;
ocf_cache_t cache = context->cache;
Expand Down Expand Up @@ -1372,7 +1372,7 @@ static void _ocf_mngt_attach_init_services(ocf_pipeline_t pipeline,
_ocf_mngt_cleaning_populate_init_complete, context);
}

uint64_t _ocf_mngt_calculate_ram_needed(ocf_cache_line_size_t line_size,
static uint64_t _ocf_mngt_calculate_ram_needed(ocf_cache_line_size_t line_size,
uint64_t volume_size)
{
uint64_t const_data_size;
Expand Down Expand Up @@ -2849,7 +2849,7 @@ _ocf_mngt_cache_standby_detach_pipeline_properties = {
},
};

void _ocf_mngt_cache_standby_detach(ocf_cache_t cache,
static void _ocf_mngt_cache_standby_detach(ocf_cache_t cache,
ocf_mngt_cache_standby_detach_end_t cmpl, void *priv)
{
struct ocf_cache_standby_detach_context *context;
Expand Down
2 changes: 2 additions & 0 deletions src/mngt/ocf_mngt_core_pool.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/*
* Copyright(c) 2012-2021 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

#include "ocf/ocf.h"
#include "ocf_mngt_core_pool_priv.h"
#include "ocf_mngt_common.h"
#include "../ocf_priv.h"
#include "../ocf_core_priv.h"
Expand Down
3 changes: 2 additions & 1 deletion src/mngt/ocf_mngt_flush.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2022 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down Expand Up @@ -460,7 +461,7 @@ static void _ocf_mngt_flush_container(
end(context);
}

void _ocf_flush_container_complete(void *ctx)
static void _ocf_flush_container_complete(void *ctx)
{
struct ocf_mngt_cache_flush_context *context = ctx;

Expand Down
14 changes: 2 additions & 12 deletions src/ocf_core.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2021 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down Expand Up @@ -95,17 +96,6 @@ bool ocf_core_is_valid(ocf_cache_t cache, ocf_core_id_t id)
return true;
}

int ocf_core_get(ocf_cache_t cache, ocf_core_id_t id, ocf_core_t *core)
{
OCF_CHECK_NULL(cache);

if (!ocf_core_is_valid(cache, id))
return -OCF_ERR_CORE_NOT_AVAIL;

*core = &cache->core[id];
return 0;
}

uint32_t ocf_core_get_seq_cutoff_threshold(ocf_core_t core)
{
return env_atomic_read(&core->conf_meta->seq_cutoff_threshold);
Expand Down Expand Up @@ -265,7 +255,7 @@ static int ocf_core_submit_io_fast(struct ocf_io *io, struct ocf_request *req,
return -OCF_ERR_IO;
}

void ocf_core_volume_submit_io(struct ocf_io *io)
static void ocf_core_volume_submit_io(struct ocf_io *io)
{
struct ocf_request *req;
ocf_core_t core;
Expand Down
3 changes: 2 additions & 1 deletion src/ocf_seq_cutoff.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2020-2021 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down Expand Up @@ -92,7 +93,7 @@ static void ocf_seq_cutoff_base_init(struct ocf_seq_cutoff *base, int nstreams)
}
}

void ocf_seq_cutoff_base_deinit(struct ocf_seq_cutoff *base)
static void ocf_seq_cutoff_base_deinit(struct ocf_seq_cutoff *base)
{
env_rwlock_destroy(&base->lock);
}
Expand Down
18 changes: 18 additions & 0 deletions src/utils/utils_alock.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2022 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef OCF_UTILS_ALOCK_H_
Expand Down Expand Up @@ -54,6 +55,23 @@ int ocf_alock_lock_rd(struct ocf_alock *alock,
int ocf_alock_lock_wr(struct ocf_alock *alock,
struct ocf_request *req, ocf_req_async_lock_cb cmpl);

/**
* @Check if cache line is used.
*
* Cache line is used when:
* 1. It is locked for write or read access
* or
* 2. There is set locked bit in metadata
*
* @param cache - OCF cache instance
* @param line - Cache line to be unlocked
*
* @retval true - cache line is used
* @retval false - cache line is not used
*/
bool ocf_cache_line_is_used(struct ocf_alock *c,
ocf_cache_line_t line);

bool ocf_alock_waitlist_is_empty(struct ocf_alock *alock,
ocf_cache_line_t entry);

Expand Down
5 changes: 3 additions & 2 deletions src/utils/utils_async_lock.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2019-2021 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand All @@ -12,7 +13,7 @@ struct ocf_async_lock_waiter {
ocf_async_lock_end_t cmpl;
};

void _ocf_async_lock_collect_waiters(ocf_async_lock_t lock,
static void _ocf_async_lock_collect_waiters(ocf_async_lock_t lock,
struct list_head *waiters)
{
ocf_async_lock_waiter_t iter, temp;
Expand All @@ -31,7 +32,7 @@ void _ocf_async_lock_collect_waiters(ocf_async_lock_t lock,
}
}

void _ocf_async_lock_run_waiters(struct ocf_async_lock *lock,
static void _ocf_async_lock_run_waiters(struct ocf_async_lock *lock,
struct list_head *waiters, int status)
{
ocf_async_lock_waiter_t iter, temp;
Expand Down
Loading

0 comments on commit 7c8ac29

Please sign in to comment.