Skip to content

Commit

Permalink
Merge branch 'Open-CAS:master' into mtab-check-optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Deixx authored Sep 30, 2024
2 parents 3872fcc + bc6165a commit 986bae1
Show file tree
Hide file tree
Showing 54 changed files with 449 additions and 706 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*.ko.*
*.obj
*.a
tags
Module.symvers
Module.markers
*.mod.c
Expand Down
3 changes: 3 additions & 0 deletions Makefile
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 @@ -20,6 +21,8 @@ ifneq ($(MAKECMDGOALS),srpm)
ifneq ($(MAKECMDGOALS),deb)
ifneq ($(MAKECMDGOALS),dsc)
cd $@ && $(MAKE) $(MAKECMDGOALS)
casadm: modules
cd $@ && $(MAKE) $(MAKECMDGOALS)
endif
endif
endif
Expand Down
4 changes: 3 additions & 1 deletion casadm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ $(OBJDIR)%.o: %.c
ifeq ($(strip $(CAS_VERSION_MAIN)),)
$(error "No version file")
endif
@$(CC) -c $(CFLAGS) -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@$(CC) -c $(CFLAGS) -MMD -o "$@" "$<"

-include $(addprefix $(OBJDIR),$(OBJS:.o=.d))

clean:
@echo " CLEAN "
Expand Down
4 changes: 2 additions & 2 deletions casadm/argp.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,8 @@ int args_parse(app *app_values, cli_command *commands, int argc, const char **ar
}

if (is_command_blocked(commands, i)) {
cas_printf(LOG_ERR, "The command is not supported\n");
return FAILURE;
cas_printf(LOG_INFO, "The command is not supported\n");
return SUCCESS;
}

configure_cli_commands(commands);
Expand Down
4 changes: 2 additions & 2 deletions casadm/cas_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2237,7 +2237,7 @@ static cli_command cas_commands[] = {
.options = attach_cache_options,
.command_handle_opts = start_cache_command_handle_option,
.handle = handle_cache_attach,
.flags = CLI_SU_REQUIRED,
.flags = (CLI_SU_REQUIRED | CLI_COMMAND_BLOCKED),
.help = NULL,
},
{
Expand All @@ -2247,7 +2247,7 @@ static cli_command cas_commands[] = {
.options = detach_options,
.command_handle_opts = command_handle_option,
.handle = handle_cache_detach,
.flags = CLI_SU_REQUIRED,
.flags = (CLI_SU_REQUIRED | CLI_COMMAND_BLOCKED),
.help = NULL,
},
{
Expand Down
2 changes: 1 addition & 1 deletion casadm/casadm.8
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Stop cache instance.
Set runtime parameter for cache/core instance.

.TP
.B -G, --set-param
.B -G, --get-param
Get runtime parameter for cache/core instance.

.TP
Expand Down
34 changes: 0 additions & 34 deletions configure.d/1_append_bio.conf

This file was deleted.

5 changes: 1 addition & 4 deletions configure.d/1_bio_iter.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
#
# Copyright(c) 2012-2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies
# SPDX-License-Identifier: BSD-3-Clause
#

Expand All @@ -25,15 +26,11 @@ apply() {
"1")
add_define "CAS_BIO_BISIZE(bio) \\
bio->bi_iter.bi_size"
add_define "CAS_BIO_BIIDX(bio) \\
bio->bi_iter.bi_idx"
add_define "CAS_BIO_BISECTOR(bio) \\
bio->bi_iter.bi_sector" ;;
"2")
add_define "CAS_BIO_BISIZE(bio) \\
bio->bi_size"
add_define "CAS_BIO_BIIDX(bio) \\
bio->bi_idx"
add_define "CAS_BIO_BISECTOR(bio) \\
bio->bi_sector" ;;
*)
Expand Down
34 changes: 0 additions & 34 deletions configure.d/1_blk_end_req.conf

This file was deleted.

31 changes: 0 additions & 31 deletions configure.d/1_kallsyms_on_each_symbol.conf

This file was deleted.

33 changes: 0 additions & 33 deletions configure.d/1_queue_bounce.conf

This file was deleted.

8 changes: 8 additions & 0 deletions configure.d/1_queue_limits.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ apply() {
exp_q->limits.max_write_same_sectors = 0;
}"

# A workaround for RHEL/CentOS 7.3 bug in kernel.
# Merging implementation on blk-mq does not respect virt boundary
# restriction and front merges bios with non-zero offsets.
# This leads to request with gaps between bios and in consequence
# triggers BUG_ON() in nvme driver or silently corrupts data.
# To prevent this, disable merging on cache queue if there are
# requirements regarding virt boundary (marking bios with REQ_NOMERGE
# does not solve this problem).
add_function "
static inline void cas_cache_set_no_merges_flag(struct request_queue *cache_q)
{
Expand Down
38 changes: 0 additions & 38 deletions configure.d/1_queue_lock.conf

This file was deleted.

17 changes: 2 additions & 15 deletions modules/cas_cache/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static int _cas_page_get_cpu(struct page *page)
/*
*
*/
static ctx_data_t *__cas_ctx_data_alloc(uint32_t pages, bool zalloc)
static ctx_data_t *__cas_ctx_data_alloc(uint32_t pages)
{
struct blk_data *data;
uint32_t i;
Expand Down Expand Up @@ -116,14 +116,6 @@ static ctx_data_t *__cas_ctx_data_alloc(uint32_t pages, bool zalloc)
if (!data->vec[i].bv_page)
break;

if (zalloc) {
if (!page_addr) {
page_addr = page_address(
data->vec[i].bv_page);
}
memset(page_addr, 0, PAGE_SIZE);
}

data->vec[i].bv_len = PAGE_SIZE;
data->vec[i].bv_offset = 0;
}
Expand Down Expand Up @@ -153,12 +145,7 @@ static ctx_data_t *__cas_ctx_data_alloc(uint32_t pages, bool zalloc)

ctx_data_t *cas_ctx_data_alloc(uint32_t pages)
{
return __cas_ctx_data_alloc(pages, false);
}

ctx_data_t *cas_ctx_data_zalloc(uint32_t pages)
{
return __cas_ctx_data_alloc(pages, true);
return __cas_ctx_data_alloc(pages);
}

/*
Expand Down
4 changes: 2 additions & 2 deletions modules/cas_cache/context.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
*/

Expand Down Expand Up @@ -37,7 +38,7 @@ struct blk_data {
/**
* @brief CAS IO with which data is associated
*/
struct ocf_io *io;
ocf_io_t io;

/**
* @brief Timestamp of start processing request
Expand Down Expand Up @@ -69,7 +70,6 @@ struct blk_data *cas_alloc_blk_data(uint32_t size, gfp_t flags);
void cas_free_blk_data(struct blk_data *data);

ctx_data_t *cas_ctx_data_alloc(uint32_t pages);
ctx_data_t *cas_ctx_data_zalloc(uint32_t pages);
void cas_ctx_data_free(ctx_data_t *ctx_data);
void cas_ctx_data_secure_erase(ctx_data_t *ctx_data);

Expand Down
7 changes: 4 additions & 3 deletions modules/cas_cache/debug.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 __CASDISK_DEBUG_H__
Expand All @@ -12,7 +13,7 @@
printk(KERN_INFO "%s\n", __func__)

#define CAS_DEBUG_DISK_TRACE(dsk) \
printk(KERN_INFO "[%u] %s\n", dsk->id, __func__)
printk(KERN_INFO "[%s] %s\n", dsk->path, __func__)

#define CAS_DEBUG_MSG(msg) \
printk(KERN_INFO "%s - %s\n", __func__, msg)
Expand All @@ -22,8 +23,8 @@
__func__, ##__VA_ARGS__)

#define CAS_DEBUG_DISK(dsk, format, ...) \
printk(KERN_INFO "[%u] %s - "format"\n", \
dsk->id, \
printk(KERN_INFO "[%s] %s - "format"\n", \
dsk->path, \
__func__, ##__VA_ARGS__)

#define CAS_DEBUG_ERROR(error, ...) \
Expand Down
5 changes: 1 addition & 4 deletions modules/cas_cache/exp_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@ static inline void bd_release_from_disk(struct block_device *bdev,
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
#define KRETURN(x) ({ return (x); })
#define MAKE_RQ_RET_TYPE blk_qc_t
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
#else
#define KRETURN(x) return
#define MAKE_RQ_RET_TYPE void
#else
#define KRETURN(x) ({ return (x); })
#define MAKE_RQ_RET_TYPE int
#endif

/* For RHEL 9.x we assume backport from kernel 5.18+ */
Expand Down
Loading

0 comments on commit 986bae1

Please sign in to comment.