Update OCF
Remove metadata updater Update mpool API Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
This commit is contained in:
parent
877772734e
commit
647124895f
@ -282,21 +282,6 @@ static void _cas_ctx_cleaner_stop(ocf_cleaner_t c)
|
||||
return cas_stop_cleaner_thread(c);
|
||||
}
|
||||
|
||||
static int _cas_ctx_metadata_updater_init(ocf_metadata_updater_t mu)
|
||||
{
|
||||
return cas_create_metadata_updater_thread(mu);
|
||||
}
|
||||
|
||||
static void _cas_ctx_metadata_updater_kick(ocf_metadata_updater_t mu)
|
||||
{
|
||||
return cas_kick_metadata_updater_thread(mu);
|
||||
}
|
||||
|
||||
static void _cas_ctx_metadata_updater_stop(ocf_metadata_updater_t mu)
|
||||
{
|
||||
return cas_stop_metadata_updater_thread(mu);
|
||||
}
|
||||
|
||||
#define CAS_LOG_FORMAT_STRING_MAX_LEN 256
|
||||
|
||||
static int _cas_ctx_logger_open(ocf_logger_t logger)
|
||||
@ -406,12 +391,6 @@ static const struct ocf_ctx_config ctx_cfg = {
|
||||
.stop = _cas_ctx_cleaner_stop,
|
||||
},
|
||||
|
||||
.metadata_updater = {
|
||||
.init = _cas_ctx_metadata_updater_init,
|
||||
.kick = _cas_ctx_metadata_updater_kick,
|
||||
.stop = _cas_ctx_metadata_updater_stop,
|
||||
},
|
||||
|
||||
.logger = {
|
||||
.open = _cas_ctx_logger_open,
|
||||
.close = _cas_ctx_logger_close,
|
||||
@ -434,7 +413,7 @@ int cas_initialize_context(void)
|
||||
|
||||
cas_bvec_pool = env_mpool_create(sizeof(struct blk_data),
|
||||
sizeof(struct bio_vec), GFP_NOIO, 7, true, NULL,
|
||||
"cas_biovec");
|
||||
"cas_biovec", true);
|
||||
|
||||
if (!cas_bvec_pool) {
|
||||
printk(KERN_ERR "Cannot create BIO vector memory pool\n");
|
||||
|
@ -2048,7 +2048,7 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg,
|
||||
/* Start cache. Returned cache instance will be locked as it was set
|
||||
* in configuration.
|
||||
*/
|
||||
result = ocf_mngt_cache_start(cas_ctx, &cache, cfg);
|
||||
result = ocf_mngt_cache_start(cas_ctx, &cache, cfg, NULL);
|
||||
if (result) {
|
||||
kthread_stop(context->rollback_thread);
|
||||
kfree(context);
|
||||
|
@ -174,7 +174,7 @@ err:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
env_allocator *env_allocator_create(uint32_t size, const char *name)
|
||||
env_allocator *env_allocator_create(uint32_t size, const char *name, bool zero)
|
||||
{
|
||||
return env_allocator_create_extended(size, name, -1);
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ typedef struct _env_allocator env_allocator;
|
||||
env_allocator *env_allocator_create_extended(uint32_t size, const char *name,
|
||||
int rpool_limit);
|
||||
|
||||
env_allocator *env_allocator_create(uint32_t size, const char *name);
|
||||
env_allocator *env_allocator_create(uint32_t size, const char *name, bool zero);
|
||||
|
||||
void env_allocator_destroy(env_allocator *allocator);
|
||||
|
||||
|
@ -115,38 +115,6 @@ static int _cas_cleaner_thread(void *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int _cas_metadata_updater_thread(void *data)
|
||||
{
|
||||
ocf_metadata_updater_t mu = data;
|
||||
struct cas_thread_info *info;
|
||||
|
||||
BUG_ON(!mu);
|
||||
|
||||
/* complete the creation of the thread */
|
||||
info = ocf_metadata_updater_get_priv(mu);
|
||||
BUG_ON(!info);
|
||||
|
||||
CAS_DAEMONIZE(info->thread->comm);
|
||||
|
||||
complete(&info->compl);
|
||||
|
||||
do {
|
||||
if (atomic_read(&info->stop))
|
||||
break;
|
||||
|
||||
atomic_set(&info->kicked, 0);
|
||||
if (ocf_metadata_updater_run(mu))
|
||||
continue;
|
||||
|
||||
wait_event_interruptible(info->wq, atomic_read(&info->stop) ||
|
||||
atomic_read(&info->kicked));
|
||||
} while (true);
|
||||
|
||||
complete_and_exit(&info->compl, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int _cas_create_thread(struct cas_thread_info **pinfo,
|
||||
int (*threadfn)(void *), void *priv, int cpu,
|
||||
const char *fmt, ...)
|
||||
@ -274,34 +242,3 @@ void cas_stop_cleaner_thread(ocf_cleaner_t c)
|
||||
_cas_stop_thread(info);
|
||||
}
|
||||
|
||||
int cas_create_metadata_updater_thread(ocf_metadata_updater_t mu)
|
||||
{
|
||||
struct cas_thread_info *info;
|
||||
int result;
|
||||
|
||||
result = _cas_create_thread(&info, _cas_metadata_updater_thread,
|
||||
mu, CAS_CPUS_ALL, "cas_mu_%s",
|
||||
ocf_cache_get_name(ocf_metadata_updater_get_cache(mu)));
|
||||
if (!result) {
|
||||
ocf_metadata_updater_set_priv(mu, info);
|
||||
_cas_start_thread(info);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void cas_kick_metadata_updater_thread(ocf_metadata_updater_t mu)
|
||||
{
|
||||
struct cas_thread_info *info = ocf_metadata_updater_get_priv(mu);
|
||||
atomic_set(&info->kicked, 1);
|
||||
wake_up(&info->wq);
|
||||
}
|
||||
|
||||
|
||||
void cas_stop_metadata_updater_thread(ocf_metadata_updater_t mu)
|
||||
{
|
||||
struct cas_thread_info *info = ocf_metadata_updater_get_priv(mu);
|
||||
ocf_metadata_updater_set_priv(mu, NULL);
|
||||
_cas_stop_thread(info);
|
||||
}
|
||||
|
||||
|
@ -20,8 +20,4 @@ int cas_create_cleaner_thread(ocf_cleaner_t c);
|
||||
void cas_kick_cleaner_thread(ocf_cleaner_t c);
|
||||
void cas_stop_cleaner_thread(ocf_cleaner_t c);
|
||||
|
||||
int cas_create_metadata_updater_thread(ocf_metadata_updater_t mu);
|
||||
void cas_kick_metadata_updater_thread(ocf_metadata_updater_t mu);
|
||||
void cas_stop_metadata_updater_thread(ocf_metadata_updater_t mu);
|
||||
|
||||
#endif /* __THREADS_H__ */
|
||||
|
@ -29,7 +29,7 @@ struct env_mpool {
|
||||
struct env_mpool *env_mpool_create(uint32_t hdr_size, uint32_t elem_size,
|
||||
int flags, int mpool_max, bool fallback,
|
||||
const uint32_t limits[env_mpool_max],
|
||||
const char *name_perfix)
|
||||
const char *name_perfix, bool zero)
|
||||
{
|
||||
uint32_t i;
|
||||
char name[MPOOL_ALLOCATOR_NAME_MAX] = { '\0' };
|
||||
|
@ -37,13 +37,14 @@ struct env_mpool;
|
||||
* order or NULL if defaults are to be used. Array should have
|
||||
* mpool_max elements
|
||||
* @param name_prefix Format name prefix
|
||||
* @param zero Unused parameter
|
||||
*
|
||||
* @return CAS memory pool
|
||||
*/
|
||||
struct env_mpool *env_mpool_create(uint32_t hdr_size, uint32_t elem_size,
|
||||
int flags, int mpool_max, bool fallback,
|
||||
const uint32_t limits[env_mpool_max],
|
||||
const char *name_perfix);
|
||||
const char *name_prefix, bool zero);
|
||||
|
||||
/**
|
||||
* @brief Destroy existing memory pool
|
||||
|
2
ocf
2
ocf
@ -1 +1 @@
|
||||
Subproject commit 5b3a9606d3eab2e1157d2d692d1f4879fbb527ae
|
||||
Subproject commit 73c3e97f43b482ed8162d18314054a0b5d4b5d69
|
Loading…
Reference in New Issue
Block a user