General packing of structs

Get back some memory/cachelines by packing any leftover static fields together.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
This commit is contained in:
Kozlowski Mateusz
2021-03-15 14:45:59 +01:00
parent 642527d72a
commit fdd6b88cc4
16 changed files with 90 additions and 87 deletions

View File

@@ -27,6 +27,9 @@ struct ocf_cache_info {
uint8_t volume_type;
/*!< Cache volume type */
uint8_t state;
/*!< Cache state (running/flushing/stopping etc...) */
uint32_t size;
/*!< Actual cache size (in cache lines) */
@@ -69,9 +72,6 @@ struct ocf_cache_info {
set as a result of reaching IO error threshold */
} fallback_pt;
uint8_t state;
/*!< Cache state (running/flushing/stopping etc...) */
ocf_eviction_t eviction_policy;
/*!< Eviction policy selected */

View File

@@ -83,16 +83,6 @@ struct ocf_io {
*/
ocf_start_io_t start;
/**
* @brief OCF IO handle function
*/
ocf_handle_io_t handle;
/**
* @brief OCF IO completion function
*/
ocf_end_io_t end;
/**
* @brief OCF IO private 1
*/
@@ -102,6 +92,16 @@ struct ocf_io {
* @brief OCF IO private 2
*/
void *priv2;
/**
* @brief OCF IO handle function
*/
ocf_handle_io_t handle;
/**
* @brief OCF IO completion function
*/
ocf_end_io_t end;
};
/**

View File

@@ -851,25 +851,25 @@ struct ocf_mngt_io_class_config {
*/
uint32_t class_id;
/**
* @brief IO class maximum size
*/
uint32_t max_size;
/**
* @brief IO class name
*/
const char *name;
/**
* @brief IO class eviction priority
*/
int16_t prio;
/**
* @brief IO class cache mode
*/
ocf_cache_mode_t cache_mode;
/**
* @brief IO class maximum size
* @brief IO class eviction priority
*/
uint32_t max_size;
int16_t prio;
};
struct ocf_mngt_io_classes_config {

View File

@@ -101,6 +101,15 @@ struct ocf_volume_ops {
*/
void (*close)(ocf_volume_t volume);
/**
* @brief Get volume length
*
* @param[in] volume Volume
*
* @return Volume length in bytes
*/
uint64_t (*get_length)(ocf_volume_t volume);
/**
* @brief Get maximum io size
*
@@ -109,15 +118,6 @@ struct ocf_volume_ops {
* @return Maximum io size in bytes
*/
unsigned int (*get_max_io_size)(ocf_volume_t volume);
/**
* @brief Get volume length
*
* @param[in] volume Volume
*
* @return Volume lenght in bytes
*/
uint64_t (*get_length)(ocf_volume_t volume);
};
/**
@@ -136,14 +136,14 @@ struct ocf_volume_properties {
struct ocf_volume_caps caps;
/*!< Volume capabilities */
struct ocf_volume_ops ops;
/*!< Volume operations */
struct ocf_io_ops io_ops;
/*!< IO operations */
void (*deinit)(void);
/*!< Deinitialize volume type */
struct ocf_volume_ops ops;
/*!< Volume operations */
};
/**