Merge pull request #1512 from robertbaldyga/various_fixes
Bunch of smaller fixes
This commit is contained in:
commit
7c7e7bff3f
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,6 +8,7 @@
|
|||||||
*.ko.*
|
*.ko.*
|
||||||
*.obj
|
*.obj
|
||||||
*.a
|
*.a
|
||||||
|
tags
|
||||||
Module.symvers
|
Module.symvers
|
||||||
Module.markers
|
Module.markers
|
||||||
*.mod.c
|
*.mod.c
|
||||||
|
3
Makefile
3
Makefile
@ -1,5 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Copyright(c) 2012-2022 Intel Corporation
|
# Copyright(c) 2012-2022 Intel Corporation
|
||||||
|
# Copyright(c) 2024 Huawei Technologies
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -20,6 +21,8 @@ ifneq ($(MAKECMDGOALS),srpm)
|
|||||||
ifneq ($(MAKECMDGOALS),deb)
|
ifneq ($(MAKECMDGOALS),deb)
|
||||||
ifneq ($(MAKECMDGOALS),dsc)
|
ifneq ($(MAKECMDGOALS),dsc)
|
||||||
cd $@ && $(MAKE) $(MAKECMDGOALS)
|
cd $@ && $(MAKE) $(MAKECMDGOALS)
|
||||||
|
casadm: modules
|
||||||
|
cd $@ && $(MAKE) $(MAKECMDGOALS)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -152,7 +152,9 @@ $(OBJDIR)%.o: %.c
|
|||||||
ifeq ($(strip $(CAS_VERSION_MAIN)),)
|
ifeq ($(strip $(CAS_VERSION_MAIN)),)
|
||||||
$(error "No version file")
|
$(error "No version file")
|
||||||
endif
|
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:
|
clean:
|
||||||
@echo " CLEAN "
|
@echo " CLEAN "
|
||||||
|
@ -88,7 +88,7 @@ Stop cache instance.
|
|||||||
Set runtime parameter for cache/core instance.
|
Set runtime parameter for cache/core instance.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B -G, --set-param
|
.B -G, --get-param
|
||||||
Get runtime parameter for cache/core instance.
|
Get runtime parameter for cache/core instance.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
|
@ -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;
|
struct blk_data *data;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
@ -116,14 +116,6 @@ static ctx_data_t *__cas_ctx_data_alloc(uint32_t pages, bool zalloc)
|
|||||||
if (!data->vec[i].bv_page)
|
if (!data->vec[i].bv_page)
|
||||||
break;
|
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_len = PAGE_SIZE;
|
||||||
data->vec[i].bv_offset = 0;
|
data->vec[i].bv_offset = 0;
|
||||||
}
|
}
|
||||||
@ -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)
|
ctx_data_t *cas_ctx_data_alloc(uint32_t pages)
|
||||||
{
|
{
|
||||||
return __cas_ctx_data_alloc(pages, false);
|
return __cas_ctx_data_alloc(pages);
|
||||||
}
|
|
||||||
|
|
||||||
ctx_data_t *cas_ctx_data_zalloc(uint32_t pages)
|
|
||||||
{
|
|
||||||
return __cas_ctx_data_alloc(pages, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright(c) 2012-2022 Intel Corporation
|
* Copyright(c) 2012-2022 Intel Corporation
|
||||||
|
* Copyright(c) 2024 Huawei Technologies
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -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);
|
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_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_free(ctx_data_t *ctx_data);
|
||||||
void cas_ctx_data_secure_erase(ctx_data_t *ctx_data);
|
void cas_ctx_data_secure_erase(ctx_data_t *ctx_data);
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright(c) 2012-2022 Intel Corporation
|
* Copyright(c) 2012-2022 Intel Corporation
|
||||||
|
* Copyright(c) 2024 Huawei Technologies
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
#ifndef __CASDISK_DEBUG_H__
|
#ifndef __CASDISK_DEBUG_H__
|
||||||
@ -12,7 +13,7 @@
|
|||||||
printk(KERN_INFO "%s\n", __func__)
|
printk(KERN_INFO "%s\n", __func__)
|
||||||
|
|
||||||
#define CAS_DEBUG_DISK_TRACE(dsk) \
|
#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) \
|
#define CAS_DEBUG_MSG(msg) \
|
||||||
printk(KERN_INFO "%s - %s\n", __func__, msg)
|
printk(KERN_INFO "%s - %s\n", __func__, msg)
|
||||||
@ -22,8 +23,8 @@
|
|||||||
__func__, ##__VA_ARGS__)
|
__func__, ##__VA_ARGS__)
|
||||||
|
|
||||||
#define CAS_DEBUG_DISK(dsk, format, ...) \
|
#define CAS_DEBUG_DISK(dsk, format, ...) \
|
||||||
printk(KERN_INFO "[%u] %s - "format"\n", \
|
printk(KERN_INFO "[%s] %s - "format"\n", \
|
||||||
dsk->id, \
|
dsk->path, \
|
||||||
__func__, ##__VA_ARGS__)
|
__func__, ##__VA_ARGS__)
|
||||||
|
|
||||||
#define CAS_DEBUG_ERROR(error, ...) \
|
#define CAS_DEBUG_ERROR(error, ...) \
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright(c) 2012-2022 Intel Corporation
|
* Copyright(c) 2012-2022 Intel Corporation
|
||||||
|
* Copyright(c) 2024 Huawei Technologies
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
#ifndef __CASDISK_EXP_OBJ_H__
|
#ifndef __CASDISK_EXP_OBJ_H__
|
||||||
@ -46,9 +47,6 @@ struct cas_exp_obj {
|
|||||||
|
|
||||||
struct blk_mq_tag_set tag_set;
|
struct blk_mq_tag_set tag_set;
|
||||||
|
|
||||||
atomic_t pt_ios;
|
|
||||||
atomic_t *pending_rqs;
|
|
||||||
|
|
||||||
void *private;
|
void *private;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1075,6 +1075,9 @@ int cache_mngt_core_pool_get_paths(struct kcas_core_pool_path *cmd_info)
|
|||||||
struct get_paths_ctx visitor_ctx = {0};
|
struct get_paths_ctx visitor_ctx = {0};
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
if (visitor_ctx->core_path_name_tab == NULL)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
visitor_ctx.core_path_name_tab = cmd_info->core_path_tab;
|
visitor_ctx.core_path_name_tab = cmd_info->core_path_tab;
|
||||||
visitor_ctx.max_count = cmd_info->core_pool_count;
|
visitor_ctx.max_count = cmd_info->core_pool_count;
|
||||||
|
|
||||||
@ -2058,6 +2061,7 @@ static int _cache_mngt_start_queues(ocf_cache_t cache)
|
|||||||
cache_priv->mngt_queue, CAS_CPUS_ALL);
|
cache_priv->mngt_queue, CAS_CPUS_ALL);
|
||||||
if (result) {
|
if (result) {
|
||||||
ocf_queue_put(cache_priv->mngt_queue);
|
ocf_queue_put(cache_priv->mngt_queue);
|
||||||
|
cache_priv->mngt_queue = NULL;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2697,17 +2701,21 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg,
|
|||||||
switch (cmd->init_cache) {
|
switch (cmd->init_cache) {
|
||||||
case CACHE_INIT_STANDBY_NEW:
|
case CACHE_INIT_STANDBY_NEW:
|
||||||
case CACHE_INIT_STANDBY_LOAD:
|
case CACHE_INIT_STANDBY_LOAD:
|
||||||
|
ocf_volume_destroy(attach_cfg->device.volume);
|
||||||
printk(KERN_ERR "Standby mode is not supported!\n");
|
printk(KERN_ERR "Standby mode is not supported!\n");
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!try_module_get(THIS_MODULE))
|
if (!try_module_get(THIS_MODULE)) {
|
||||||
|
ocf_volume_destroy(attach_cfg->device.volume);
|
||||||
return -KCAS_ERR_SYSTEM;
|
return -KCAS_ERR_SYSTEM;
|
||||||
|
}
|
||||||
|
|
||||||
result = cache_mngt_check_bdev(&attach_cfg->device, attach_cfg->force, false, NULL);
|
result = cache_mngt_check_bdev(&attach_cfg->device, attach_cfg->force, false, NULL);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
ocf_volume_destroy(attach_cfg->device.volume);
|
||||||
module_put(THIS_MODULE);
|
module_put(THIS_MODULE);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -2719,6 +2727,7 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg,
|
|||||||
cache_name_meta, &cache_mode_meta,
|
cache_name_meta, &cache_mode_meta,
|
||||||
&cache_line_size_meta);
|
&cache_line_size_meta);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
ocf_volume_destroy(attach_cfg->device.volume);
|
||||||
module_put(THIS_MODULE);
|
module_put(THIS_MODULE);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -2729,6 +2738,7 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg,
|
|||||||
printk(KERN_ERR "Improper cache name format on %s.\n",
|
printk(KERN_ERR "Improper cache name format on %s.\n",
|
||||||
cmd->cache_path_name);
|
cmd->cache_path_name);
|
||||||
|
|
||||||
|
ocf_volume_destroy(attach_cfg->device.volume);
|
||||||
module_put(THIS_MODULE);
|
module_put(THIS_MODULE);
|
||||||
return -OCF_ERR_START_CACHE_FAIL;
|
return -OCF_ERR_START_CACHE_FAIL;
|
||||||
}
|
}
|
||||||
@ -2741,6 +2751,7 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg,
|
|||||||
"already exists.\n", cache_name_meta);
|
"already exists.\n", cache_name_meta);
|
||||||
|
|
||||||
ocf_mngt_cache_put(tmp_cache);
|
ocf_mngt_cache_put(tmp_cache);
|
||||||
|
ocf_volume_destroy(attach_cfg->device.volume);
|
||||||
module_put(THIS_MODULE);
|
module_put(THIS_MODULE);
|
||||||
return -OCF_ERR_CACHE_EXIST;
|
return -OCF_ERR_CACHE_EXIST;
|
||||||
}
|
}
|
||||||
@ -2755,6 +2766,7 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg,
|
|||||||
|
|
||||||
context = kzalloc(sizeof(*context), GFP_KERNEL);
|
context = kzalloc(sizeof(*context), GFP_KERNEL);
|
||||||
if (!context) {
|
if (!context) {
|
||||||
|
ocf_volume_destroy(attach_cfg->device.volume);
|
||||||
module_put(THIS_MODULE);
|
module_put(THIS_MODULE);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
@ -2764,6 +2776,7 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg,
|
|||||||
if (IS_ERR(context->rollback_thread)) {
|
if (IS_ERR(context->rollback_thread)) {
|
||||||
result = PTR_ERR(context->rollback_thread);
|
result = PTR_ERR(context->rollback_thread);
|
||||||
kfree(context);
|
kfree(context);
|
||||||
|
ocf_volume_destroy(attach_cfg->device.volume);
|
||||||
module_put(THIS_MODULE);
|
module_put(THIS_MODULE);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -2779,6 +2792,7 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg,
|
|||||||
if (result) {
|
if (result) {
|
||||||
cas_lazy_thread_stop(context->rollback_thread);
|
cas_lazy_thread_stop(context->rollback_thread);
|
||||||
kfree(context);
|
kfree(context);
|
||||||
|
ocf_volume_destroy(attach_cfg->device.volume);
|
||||||
module_put(THIS_MODULE);
|
module_put(THIS_MODULE);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -2786,12 +2800,12 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg,
|
|||||||
|
|
||||||
result = _cache_mngt_cache_priv_init(cache);
|
result = _cache_mngt_cache_priv_init(cache);
|
||||||
if (result)
|
if (result)
|
||||||
goto err;
|
goto err_deinit_config;
|
||||||
context->priv_inited = true;
|
context->priv_inited = true;
|
||||||
|
|
||||||
result = _cache_mngt_start_queues(cache);
|
result = _cache_mngt_start_queues(cache);
|
||||||
if (result)
|
if (result)
|
||||||
goto err;
|
goto err_deinit_config;
|
||||||
|
|
||||||
cache_priv = ocf_cache_get_priv(cache);
|
cache_priv = ocf_cache_get_priv(cache);
|
||||||
cache_priv->attach_context = context;
|
cache_priv->attach_context = context;
|
||||||
@ -2838,6 +2852,9 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg,
|
|||||||
ocf_mngt_cache_unlock(cache);
|
ocf_mngt_cache_unlock(cache);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
err_deinit_config:
|
||||||
|
ocf_volume_destroy(attach_cfg->device.volume);
|
||||||
err:
|
err:
|
||||||
cmd->min_free_ram = context->min_free_ram;
|
cmd->min_free_ram = context->min_free_ram;
|
||||||
|
|
||||||
@ -3196,10 +3213,6 @@ int cache_mngt_exit_instance(const char *cache_name, size_t name_len, int flush)
|
|||||||
if (status)
|
if (status)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
cache_priv = ocf_cache_get_priv(cache);
|
|
||||||
mngt_queue = cache_priv->mngt_queue;
|
|
||||||
context = cache_priv->stop_context;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Flush cache. Flushing may take a long time, so we allow user
|
* Flush cache. Flushing may take a long time, so we allow user
|
||||||
* to interrupt this operation. Hence we do first flush before
|
* to interrupt this operation. Hence we do first flush before
|
||||||
@ -3218,6 +3231,10 @@ int cache_mngt_exit_instance(const char *cache_name, size_t name_len, int flush)
|
|||||||
if (status)
|
if (status)
|
||||||
goto put;
|
goto put;
|
||||||
|
|
||||||
|
cache_priv = ocf_cache_get_priv(cache);
|
||||||
|
mngt_queue = cache_priv->mngt_queue;
|
||||||
|
context = cache_priv->stop_context;
|
||||||
|
|
||||||
context->finish_thread = cas_lazy_thread_create(exit_instance_finish,
|
context->finish_thread = cas_lazy_thread_create(exit_instance_finish,
|
||||||
context, "cas_%s_stop", cache_name);
|
context, "cas_%s_stop", cache_name);
|
||||||
if (IS_ERR(context->finish_thread)) {
|
if (IS_ERR(context->finish_thread)) {
|
||||||
@ -3504,22 +3521,6 @@ put:
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cache_mngt_wait_for_rq_finish_visitor(ocf_core_t core, void *cntx)
|
|
||||||
{
|
|
||||||
ocf_volume_t obj = ocf_core_get_volume(core);
|
|
||||||
struct bd_object *bdobj = bd_object(obj);
|
|
||||||
|
|
||||||
while (atomic64_read(&bdobj->pending_rqs))
|
|
||||||
io_schedule();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void cache_mngt_wait_for_rq_finish(ocf_cache_t cache)
|
|
||||||
{
|
|
||||||
ocf_core_visit(cache, cache_mngt_wait_for_rq_finish_visitor, NULL, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
int cache_mngt_set_core_params(struct kcas_set_core_param *info)
|
int cache_mngt_set_core_params(struct kcas_set_core_param *info)
|
||||||
{
|
{
|
||||||
ocf_cache_t cache;
|
ocf_cache_t cache;
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
return map_cas_err_to_generic(ret); \
|
return map_cas_err_to_generic(ret); \
|
||||||
})
|
})
|
||||||
|
|
||||||
/* this handles IOctl for /dev/cas */
|
/* this handles IOctl for /dev/cas_ctrl */
|
||||||
/*********************************************/
|
/*********************************************/
|
||||||
long cas_service_ioctl_ctrl(struct file *filp, unsigned int cmd,
|
long cas_service_ioctl_ctrl(struct file *filp, unsigned int cmd,
|
||||||
unsigned long arg)
|
unsigned long arg)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright(c) 2012-2022 Intel Corporation
|
* Copyright(c) 2012-2022 Intel Corporation
|
||||||
|
* Copyright(c) 2024 Huawei Technologies
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -25,12 +26,6 @@ struct bd_object {
|
|||||||
uint32_t opened_by_bdev : 1;
|
uint32_t opened_by_bdev : 1;
|
||||||
/*!< Opened by supplying bdev manually */
|
/*!< Opened by supplying bdev manually */
|
||||||
|
|
||||||
atomic64_t pending_rqs;
|
|
||||||
/*!< This fields describes in flight IO requests */
|
|
||||||
|
|
||||||
struct workqueue_struct *btm_wq;
|
|
||||||
/*< Workqueue for I/O internally trigerred in bottom vol */
|
|
||||||
|
|
||||||
struct workqueue_struct *expobj_wq;
|
struct workqueue_struct *expobj_wq;
|
||||||
/*< Workqueue for I/O handled by top vol */
|
/*< Workqueue for I/O handled by top vol */
|
||||||
|
|
||||||
|
@ -310,6 +310,21 @@ static inline bool cas_bd_io_prepare(int *dir, struct ocf_io *io)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns only flags that are relevant to request's direction.
|
||||||
|
*/
|
||||||
|
static inline uint64_t filter_req_flags(int dir, uint64_t flags)
|
||||||
|
{
|
||||||
|
/* Remove REQ_RAHEAD flag from write request to cache which are a
|
||||||
|
result of a missed read-head request. This flag caused the nvme
|
||||||
|
driver to send write command with access frequency value that is
|
||||||
|
reserved */
|
||||||
|
if (dir == WRITE)
|
||||||
|
flags &= ~REQ_RAHEAD;
|
||||||
|
|
||||||
|
return flags;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -359,7 +374,7 @@ static void block_dev_submit_io(struct ocf_io *io)
|
|||||||
CAS_BIO_BISECTOR(bio) = addr / SECTOR_SIZE;
|
CAS_BIO_BISECTOR(bio) = addr / SECTOR_SIZE;
|
||||||
bio->bi_next = NULL;
|
bio->bi_next = NULL;
|
||||||
bio->bi_private = io;
|
bio->bi_private = io;
|
||||||
CAS_BIO_OP_FLAGS(bio) |= io->flags;
|
CAS_BIO_OP_FLAGS(bio) |= filter_req_flags(dir, io->flags);
|
||||||
bio->bi_end_io = CAS_REFER_BLOCK_CALLBACK(cas_bd_io_end);
|
bio->bi_end_io = CAS_REFER_BLOCK_CALLBACK(cas_bd_io_end);
|
||||||
|
|
||||||
/* Add pages */
|
/* Add pages */
|
||||||
|
@ -370,10 +370,7 @@ static void blkdev_complete_flush(struct ocf_io *io, int error)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_interrupt())
|
|
||||||
blkdev_defer_bio(bvol, bio, blkdev_handle_bio_noflush);
|
blkdev_defer_bio(bvol, bio, blkdev_handle_bio_noflush);
|
||||||
else
|
|
||||||
blkdev_handle_bio_noflush(bvol, bio);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void blkdev_handle_flush(struct bd_object *bvol, struct bio *bio)
|
static void blkdev_handle_flush(struct bd_object *bvol, struct bio *bio)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Copyright(c) 2012-2021 Intel Corporation
|
# Copyright(c) 2012-2021 Intel Corporation
|
||||||
|
# Copyright(c) 2024 Huawei Technologies
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -14,7 +15,7 @@ EXTRA_CFLAGS += -DCAS_VERSION_MAIN=$(CAS_VERSION_MAIN)
|
|||||||
EXTRA_CFLAGS += -DCAS_VERSION_MAJOR=$(CAS_VERSION_MAJOR)
|
EXTRA_CFLAGS += -DCAS_VERSION_MAJOR=$(CAS_VERSION_MAJOR)
|
||||||
EXTRA_CFLAGS += -DCAS_VERSION_MINOR=$(CAS_VERSION_MINOR)
|
EXTRA_CFLAGS += -DCAS_VERSION_MINOR=$(CAS_VERSION_MINOR)
|
||||||
EXTRA_CFLAGS += -DCAS_VERSION=\"$(CAS_VERSION)\"
|
EXTRA_CFLAGS += -DCAS_VERSION=\"$(CAS_VERSION)\"
|
||||||
EXTRA_CFLAGS += -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
|
EXTRA_CFLAGS += -Ofast -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
|
||||||
|
|
||||||
EXTRA_CFLAGS += -I$(M)
|
EXTRA_CFLAGS += -I$(M)
|
||||||
EXTRA_CFLAGS += -I$(M)/cas_cache
|
EXTRA_CFLAGS += -I$(M)/cas_cache
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright(c) 2020-2021 Intel Corporation
|
# Copyright(c) 2020-2021 Intel Corporation
|
||||||
|
# Copyright(c) 2024 Huawei Technologies
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -30,13 +31,19 @@ if [[ -d "$SOURCES_DIR/.git" ]] && which git &>/dev/null &&\
|
|||||||
if [[ ! -r "$MANUAL_VERSION_INPUT" ]]; then
|
if [[ ! -r "$MANUAL_VERSION_INPUT" ]]; then
|
||||||
error "can't read version input file '$MANUAL_VERSION_INPUT'"
|
error "can't read version input file '$MANUAL_VERSION_INPUT'"
|
||||||
fi
|
fi
|
||||||
. "$MANUAL_VERSION_INPUT"
|
source "$MANUAL_VERSION_INPUT"
|
||||||
if [[ ! "$CAS_VERSION_MAIN" || ! "$CAS_VERSION_MAJOR" || ! "$CAS_VERSION_MINOR" ]]; then
|
if [[ ! "$CAS_VERSION_MAIN" || ! "$CAS_VERSION_MAJOR" || ! "$CAS_VERSION_MINOR" ]]; then
|
||||||
error "'$MANUAL_VERSION_INPUT' - wrong version input file format;"\
|
error "'$MANUAL_VERSION_INPUT' - wrong version input file format;"\
|
||||||
"file should contain CAS_VERSION_MAIN, CAS_VERSION_MAJOR and CAS_VERSION_MINOR"\
|
"file should contain CAS_VERSION_MAIN, CAS_VERSION_MAJOR and CAS_VERSION_MINOR"\
|
||||||
"variables along with their respective values"
|
"variables along with their respective values"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Make sure version numbers are interpreted by bash as decimal numbers in case any of
|
||||||
|
# them were being input with leading zeros, which is interpreted as an octal by default.
|
||||||
|
CAS_VERSION_MAIN=$((10#$CAS_VERSION_MAIN))
|
||||||
|
CAS_VERSION_MAJOR=$((10#$CAS_VERSION_MAJOR))
|
||||||
|
CAS_VERSION_MINOR=$((10#$CAS_VERSION_MINOR))
|
||||||
|
|
||||||
CAS_VERSION_BUILD=$(cd "$SOURCES_DIR" && git log --merges --oneline | wc -l)
|
CAS_VERSION_BUILD=$(cd "$SOURCES_DIR" && git log --merges --oneline | wc -l)
|
||||||
LAST_COMMIT_HASH=$(cd "$SOURCES_DIR" && git log -1 --pretty=format:%H)
|
LAST_COMMIT_HASH=$(cd "$SOURCES_DIR" && git log -1 --pretty=format:%H)
|
||||||
LAST_COMMIT_HASH_ABBR=$(cd "$SOURCES_DIR" && git log -1 --pretty=format:%h)
|
LAST_COMMIT_HASH_ABBR=$(cd "$SOURCES_DIR" && git log -1 --pretty=format:%h)
|
||||||
@ -80,7 +87,7 @@ if [[ -d "$SOURCES_DIR/.git" ]] && which git &>/dev/null &&\
|
|||||||
echo "FILE_CREATION_DATE=$FILE_CREATION_DATE" >> "$VERSION_FILE"
|
echo "FILE_CREATION_DATE=$FILE_CREATION_DATE" >> "$VERSION_FILE"
|
||||||
echo "FILE_CREATION_TIMESTAMP=$FILE_CREATION_TIMESTAMP" >> "$VERSION_FILE"
|
echo "FILE_CREATION_TIMESTAMP=$FILE_CREATION_TIMESTAMP" >> "$VERSION_FILE"
|
||||||
elif [[ -r "$VERSION_FILE" ]]; then
|
elif [[ -r "$VERSION_FILE" ]]; then
|
||||||
. "$VERSION_FILE" >/dev/null
|
source "$VERSION_FILE" >/dev/null
|
||||||
if [[ ! "$CAS_VERSION" ]]; then
|
if [[ ! "$CAS_VERSION" ]]; then
|
||||||
error "'$VERSION_FILE' - wrong version file format; file does not contain CAS_VERSION"
|
error "'$VERSION_FILE' - wrong version file format; file does not contain CAS_VERSION"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user