Simplify collision matadata interface
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
parent
0b0546302f
commit
3108f36e42
@ -59,13 +59,6 @@ static inline void ocf_metadata_set_collision_info(
|
||||
cache->metadata.iface.set_collision_info(cache, line, next, prev);
|
||||
}
|
||||
|
||||
static inline void ocf_metadata_get_collision_info(
|
||||
struct ocf_cache *cache, ocf_cache_line_t line,
|
||||
ocf_cache_line_t *next, ocf_cache_line_t *prev)
|
||||
{
|
||||
cache->metadata.iface.get_collision_info(cache, line, next, prev);
|
||||
}
|
||||
|
||||
static inline void ocf_metadata_set_collision_next(
|
||||
struct ocf_cache *cache, ocf_cache_line_t line,
|
||||
ocf_cache_line_t next)
|
||||
@ -80,16 +73,29 @@ static inline void ocf_metadata_set_collision_prev(
|
||||
cache->metadata.iface.set_collision_prev(cache, line, prev);
|
||||
}
|
||||
|
||||
static inline void ocf_metadata_get_collision_info(
|
||||
struct ocf_cache *cache, ocf_cache_line_t line,
|
||||
ocf_cache_line_t *next, ocf_cache_line_t *prev)
|
||||
{
|
||||
cache->metadata.iface.get_collision_info(cache, line, next, prev);
|
||||
}
|
||||
|
||||
static inline ocf_cache_line_t ocf_metadata_get_collision_next(
|
||||
struct ocf_cache *cache, ocf_cache_line_t line)
|
||||
{
|
||||
return cache->metadata.iface.get_collision_next(cache, line);
|
||||
ocf_cache_line_t next;
|
||||
|
||||
ocf_metadata_get_collision_info(cache, line, &next, NULL);
|
||||
return next;
|
||||
}
|
||||
|
||||
static inline ocf_cache_line_t ocf_metadata_get_collision_prev(
|
||||
struct ocf_cache *cache, ocf_cache_line_t line)
|
||||
{
|
||||
return cache->metadata.iface.get_collision_prev(cache, line);
|
||||
ocf_cache_line_t prev;
|
||||
|
||||
ocf_metadata_get_collision_info(cache, line, NULL, &prev);
|
||||
return prev;
|
||||
}
|
||||
|
||||
void ocf_metadata_add_to_collision(struct ocf_cache *cache,
|
||||
|
@ -2601,40 +2601,6 @@ static void ocf_metadata_hash_get_collision_info(
|
||||
}
|
||||
}
|
||||
|
||||
static ocf_cache_line_t ocf_metadata_hash_get_collision_next(
|
||||
struct ocf_cache *cache, ocf_cache_line_t line)
|
||||
{
|
||||
const struct ocf_metadata_list_info *info;
|
||||
struct ocf_metadata_hash_ctrl *ctrl =
|
||||
(struct ocf_metadata_hash_ctrl *) cache->metadata.iface_priv;
|
||||
|
||||
info = ocf_metadata_raw_rd_access(cache,
|
||||
&(ctrl->raw_desc[metadata_segment_list_info]), line,
|
||||
sizeof(*info));
|
||||
if (info)
|
||||
return info->next_col;
|
||||
|
||||
ocf_metadata_error(cache);
|
||||
return cache->device->collision_table_entries;
|
||||
}
|
||||
|
||||
static ocf_cache_line_t ocf_metadata_hash_get_collision_prev(
|
||||
struct ocf_cache *cache, ocf_cache_line_t line)
|
||||
{
|
||||
const struct ocf_metadata_list_info *info;
|
||||
struct ocf_metadata_hash_ctrl *ctrl =
|
||||
(struct ocf_metadata_hash_ctrl *) cache->metadata.iface_priv;
|
||||
|
||||
info = ocf_metadata_raw_rd_access(cache,
|
||||
&(ctrl->raw_desc[metadata_segment_list_info]), line,
|
||||
sizeof(*info));
|
||||
if (info)
|
||||
return info->prev_col;
|
||||
|
||||
ocf_metadata_error(cache);
|
||||
return cache->device->collision_table_entries;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Partition
|
||||
******************************************************************************/
|
||||
@ -2841,8 +2807,6 @@ static const struct ocf_metadata_iface metadata_hash_iface = {
|
||||
.set_collision_info = ocf_metadata_hash_set_collision_info,
|
||||
.set_collision_next = ocf_metadata_hash_set_collision_next,
|
||||
.set_collision_prev = ocf_metadata_hash_set_collision_prev,
|
||||
.get_collision_next = ocf_metadata_hash_get_collision_next,
|
||||
.get_collision_prev = ocf_metadata_hash_get_collision_prev,
|
||||
|
||||
/*
|
||||
* Partition Info
|
||||
|
@ -361,12 +361,6 @@ struct ocf_metadata_iface {
|
||||
void (*set_collision_prev)(struct ocf_cache *cache,
|
||||
ocf_cache_line_t line, ocf_cache_line_t prev);
|
||||
|
||||
ocf_cache_line_t (*get_collision_next)(struct ocf_cache *cache,
|
||||
ocf_cache_line_t line);
|
||||
|
||||
ocf_cache_line_t (*get_collision_prev)(struct ocf_cache *cache,
|
||||
ocf_cache_line_t line);
|
||||
|
||||
ocf_part_id_t (*get_partition_id)(struct ocf_cache *cache,
|
||||
ocf_cache_line_t line);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user