Commit 952b57a5 authored by Mike Snitzer's avatar Mike Snitzer

dm vdo: rename struct configuration to uds_configuration

Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
Signed-off-by: default avatarKen Raeburn <raeburn@redhat.com>
Signed-off-by: default avatarMatthew Sakai <msakai@redhat.com>
parent 7f67d0f1
...@@ -27,9 +27,9 @@ static bool is_version(const u8 *version, u8 *buffer) ...@@ -27,9 +27,9 @@ static bool is_version(const u8 *version, u8 *buffer)
return memcmp(version, buffer, INDEX_CONFIG_VERSION_LENGTH) == 0; return memcmp(version, buffer, INDEX_CONFIG_VERSION_LENGTH) == 0;
} }
static bool are_matching_configurations(struct configuration *saved_config, static bool are_matching_configurations(struct uds_configuration *saved_config,
struct index_geometry *saved_geometry, struct index_geometry *saved_geometry,
struct configuration *user) struct uds_configuration *user)
{ {
struct index_geometry *geometry = user->geometry; struct index_geometry *geometry = user->geometry;
bool result = true; bool result = true;
...@@ -93,10 +93,10 @@ static bool are_matching_configurations(struct configuration *saved_config, ...@@ -93,10 +93,10 @@ static bool are_matching_configurations(struct configuration *saved_config,
/* Read the configuration and validate it against the provided one. */ /* Read the configuration and validate it against the provided one. */
int uds_validate_config_contents(struct buffered_reader *reader, int uds_validate_config_contents(struct buffered_reader *reader,
struct configuration *user_config) struct uds_configuration *user_config)
{ {
int result; int result;
struct configuration config; struct uds_configuration config;
struct index_geometry geometry; struct index_geometry geometry;
u8 version_buffer[INDEX_CONFIG_VERSION_LENGTH]; u8 version_buffer[INDEX_CONFIG_VERSION_LENGTH];
u32 bytes_per_page; u32 bytes_per_page;
...@@ -174,7 +174,7 @@ int uds_validate_config_contents(struct buffered_reader *reader, ...@@ -174,7 +174,7 @@ int uds_validate_config_contents(struct buffered_reader *reader,
* been reduced by one chapter. * been reduced by one chapter.
*/ */
int uds_write_config_contents(struct buffered_writer *writer, int uds_write_config_contents(struct buffered_writer *writer,
struct configuration *config, u32 version) struct uds_configuration *config, u32 version)
{ {
int result; int result;
struct index_geometry *geometry = config->geometry; struct index_geometry *geometry = config->geometry;
...@@ -313,9 +313,9 @@ static unsigned int __must_check normalize_read_threads(unsigned int requested) ...@@ -313,9 +313,9 @@ static unsigned int __must_check normalize_read_threads(unsigned int requested)
} }
int uds_make_configuration(const struct uds_parameters *params, int uds_make_configuration(const struct uds_parameters *params,
struct configuration **config_ptr) struct uds_configuration **config_ptr)
{ {
struct configuration *config; struct uds_configuration *config;
u32 chapters_per_volume = 0; u32 chapters_per_volume = 0;
u32 record_pages_per_chapter = 0; u32 record_pages_per_chapter = 0;
u32 sparse_chapters_per_volume = 0; u32 sparse_chapters_per_volume = 0;
...@@ -327,7 +327,7 @@ int uds_make_configuration(const struct uds_parameters *params, ...@@ -327,7 +327,7 @@ int uds_make_configuration(const struct uds_parameters *params,
if (result != UDS_SUCCESS) if (result != UDS_SUCCESS)
return result; return result;
result = uds_allocate(1, struct configuration, __func__, &config); result = uds_allocate(1, struct uds_configuration, __func__, &config);
if (result != UDS_SUCCESS) if (result != UDS_SUCCESS)
return result; return result;
...@@ -354,7 +354,7 @@ int uds_make_configuration(const struct uds_parameters *params, ...@@ -354,7 +354,7 @@ int uds_make_configuration(const struct uds_parameters *params,
return UDS_SUCCESS; return UDS_SUCCESS;
} }
void uds_free_configuration(struct configuration *config) void uds_free_configuration(struct uds_configuration *config)
{ {
if (config != NULL) { if (config != NULL) {
uds_free_index_geometry(config->geometry); uds_free_index_geometry(config->geometry);
...@@ -362,7 +362,7 @@ void uds_free_configuration(struct configuration *config) ...@@ -362,7 +362,7 @@ void uds_free_configuration(struct configuration *config)
} }
} }
void uds_log_configuration(struct configuration *config) void uds_log_configuration(struct uds_configuration *config)
{ {
struct index_geometry *geometry = config->geometry; struct index_geometry *geometry = config->geometry;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "uds.h" #include "uds.h"
/* /*
* The configuration records a variety of parameters used to configure a new UDS index. Some * The uds_configuration records a variety of parameters used to configure a new UDS index. Some
* parameters are provided by the client, while others are fixed or derived from user-supplied * parameters are provided by the client, while others are fixed or derived from user-supplied
* values. It is created when an index is created, and it is recorded in the index metadata. * values. It is created when an index is created, and it is recorded in the index metadata.
*/ */
...@@ -24,7 +24,7 @@ enum { ...@@ -24,7 +24,7 @@ enum {
}; };
/* A set of configuration parameters for the indexer. */ /* A set of configuration parameters for the indexer. */
struct configuration { struct uds_configuration {
/* Storage device for the index */ /* Storage device for the index */
struct block_device *bdev; struct block_device *bdev;
...@@ -109,16 +109,16 @@ struct uds_configuration_6_02 { ...@@ -109,16 +109,16 @@ struct uds_configuration_6_02 {
} __packed; } __packed;
int __must_check uds_make_configuration(const struct uds_parameters *params, int __must_check uds_make_configuration(const struct uds_parameters *params,
struct configuration **config_ptr); struct uds_configuration **config_ptr);
void uds_free_configuration(struct configuration *config); void uds_free_configuration(struct uds_configuration *config);
int __must_check uds_validate_config_contents(struct buffered_reader *reader, int __must_check uds_validate_config_contents(struct buffered_reader *reader,
struct configuration *config); struct uds_configuration *config);
int __must_check uds_write_config_contents(struct buffered_writer *writer, int __must_check uds_write_config_contents(struct buffered_writer *writer,
struct configuration *config, u32 version); struct uds_configuration *config, u32 version);
void uds_log_configuration(struct configuration *config); void uds_log_configuration(struct uds_configuration *config);
#endif /* UDS_CONFIG_H */ #endif /* UDS_CONFIG_H */
...@@ -222,7 +222,7 @@ static inline bool is_converted_super_block(struct super_block_data *super) ...@@ -222,7 +222,7 @@ static inline bool is_converted_super_block(struct super_block_data *super)
return super->version == 7; return super->version == 7;
} }
static int __must_check compute_sizes(const struct configuration *config, static int __must_check compute_sizes(const struct uds_configuration *config,
struct save_layout_sizes *sls) struct save_layout_sizes *sls)
{ {
int result; int result;
...@@ -256,7 +256,7 @@ static int __must_check compute_sizes(const struct configuration *config, ...@@ -256,7 +256,7 @@ static int __must_check compute_sizes(const struct configuration *config,
int uds_compute_index_size(const struct uds_parameters *parameters, u64 *index_size) int uds_compute_index_size(const struct uds_parameters *parameters, u64 *index_size)
{ {
int result; int result;
struct configuration *index_config; struct uds_configuration *index_config;
struct save_layout_sizes sizes; struct save_layout_sizes sizes;
if (index_size == NULL) { if (index_size == NULL) {
...@@ -752,7 +752,7 @@ static int __must_check write_layout_header(struct index_layout *layout, ...@@ -752,7 +752,7 @@ static int __must_check write_layout_header(struct index_layout *layout,
} }
static int __must_check write_uds_index_config(struct index_layout *layout, static int __must_check write_uds_index_config(struct index_layout *layout,
struct configuration *config, struct uds_configuration *config,
off_t offset) off_t offset)
{ {
int result; int result;
...@@ -801,7 +801,7 @@ static int __must_check save_layout(struct index_layout *layout, off_t offset) ...@@ -801,7 +801,7 @@ static int __must_check save_layout(struct index_layout *layout, off_t offset)
return result; return result;
} }
static int create_index_layout(struct index_layout *layout, struct configuration *config) static int create_index_layout(struct index_layout *layout, struct uds_configuration *config)
{ {
int result; int result;
struct save_layout_sizes sizes; struct save_layout_sizes sizes;
...@@ -1620,7 +1620,7 @@ static int __must_check load_sub_index_regions(struct index_layout *layout) ...@@ -1620,7 +1620,7 @@ static int __must_check load_sub_index_regions(struct index_layout *layout)
} }
static int __must_check verify_uds_index_config(struct index_layout *layout, static int __must_check verify_uds_index_config(struct index_layout *layout,
struct configuration *config) struct uds_configuration *config)
{ {
int result; int result;
struct buffered_reader *reader = NULL; struct buffered_reader *reader = NULL;
...@@ -1641,7 +1641,7 @@ static int __must_check verify_uds_index_config(struct index_layout *layout, ...@@ -1641,7 +1641,7 @@ static int __must_check verify_uds_index_config(struct index_layout *layout,
return UDS_SUCCESS; return UDS_SUCCESS;
} }
static int load_index_layout(struct index_layout *layout, struct configuration *config) static int load_index_layout(struct index_layout *layout, struct uds_configuration *config)
{ {
int result; int result;
struct buffered_reader *reader; struct buffered_reader *reader;
...@@ -1665,7 +1665,7 @@ static int load_index_layout(struct index_layout *layout, struct configuration * ...@@ -1665,7 +1665,7 @@ static int load_index_layout(struct index_layout *layout, struct configuration *
} }
static int create_layout_factory(struct index_layout *layout, static int create_layout_factory(struct index_layout *layout,
const struct configuration *config) const struct uds_configuration *config)
{ {
int result; int result;
size_t writable_size; size_t writable_size;
...@@ -1689,7 +1689,7 @@ static int create_layout_factory(struct index_layout *layout, ...@@ -1689,7 +1689,7 @@ static int create_layout_factory(struct index_layout *layout,
return UDS_SUCCESS; return UDS_SUCCESS;
} }
int uds_make_index_layout(struct configuration *config, bool new_layout, int uds_make_index_layout(struct uds_configuration *config, bool new_layout,
struct index_layout **layout_ptr) struct index_layout **layout_ptr)
{ {
int result; int result;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
struct index_layout; struct index_layout;
int __must_check uds_make_index_layout(struct configuration *config, bool new_layout, int __must_check uds_make_index_layout(struct uds_configuration *config, bool new_layout,
struct index_layout **layout_ptr); struct index_layout **layout_ptr);
void uds_free_index_layout(struct index_layout *layout); void uds_free_index_layout(struct index_layout *layout);
......
...@@ -314,7 +314,7 @@ static int initialize_index_session(struct uds_index_session *index_session, ...@@ -314,7 +314,7 @@ static int initialize_index_session(struct uds_index_session *index_session,
enum uds_open_index_type open_type) enum uds_open_index_type open_type)
{ {
int result; int result;
struct configuration *config; struct uds_configuration *config;
result = uds_make_configuration(&index_session->parameters, &config); result = uds_make_configuration(&index_session->parameters, &config);
if (result != UDS_SUCCESS) { if (result != UDS_SUCCESS) {
......
...@@ -1162,7 +1162,7 @@ static int make_index_zone(struct uds_index *index, unsigned int zone_number) ...@@ -1162,7 +1162,7 @@ static int make_index_zone(struct uds_index *index, unsigned int zone_number)
return UDS_SUCCESS; return UDS_SUCCESS;
} }
int uds_make_index(struct configuration *config, enum uds_open_index_type open_type, int uds_make_index(struct uds_configuration *config, enum uds_open_index_type open_type,
struct index_load_context *load_context, index_callback_fn callback, struct index_load_context *load_context, index_callback_fn callback,
struct uds_index **new_index) struct uds_index **new_index)
{ {
......
...@@ -62,7 +62,7 @@ enum request_stage { ...@@ -62,7 +62,7 @@ enum request_stage {
STAGE_MESSAGE, STAGE_MESSAGE,
}; };
int __must_check uds_make_index(struct configuration *config, int __must_check uds_make_index(struct uds_configuration *config,
enum uds_open_index_type open_type, enum uds_open_index_type open_type,
struct index_load_context *load_context, struct index_load_context *load_context,
index_callback_fn callback, struct uds_index **new_index); index_callback_fn callback, struct uds_index **new_index);
......
...@@ -80,11 +80,11 @@ struct sub_index_parameters { ...@@ -80,11 +80,11 @@ struct sub_index_parameters {
struct split_config { struct split_config {
/* The hook subindex configuration */ /* The hook subindex configuration */
struct configuration hook_config; struct uds_configuration hook_config;
struct index_geometry hook_geometry; struct index_geometry hook_geometry;
/* The non-hook subindex configuration */ /* The non-hook subindex configuration */
struct configuration non_hook_config; struct uds_configuration non_hook_config;
struct index_geometry non_hook_geometry; struct index_geometry non_hook_geometry;
}; };
...@@ -192,7 +192,7 @@ unsigned int uds_get_volume_index_zone(const struct volume_index *volume_index, ...@@ -192,7 +192,7 @@ unsigned int uds_get_volume_index_zone(const struct volume_index *volume_index,
return get_volume_sub_index_zone(get_volume_sub_index(volume_index, name), name); return get_volume_sub_index_zone(get_volume_sub_index(volume_index, name), name);
} }
static int compute_volume_sub_index_parameters(const struct configuration *config, static int compute_volume_sub_index_parameters(const struct uds_configuration *config,
struct sub_index_parameters *params) struct sub_index_parameters *params)
{ {
enum { DELTA_LIST_SIZE = 256 }; enum { DELTA_LIST_SIZE = 256 };
...@@ -300,7 +300,7 @@ void uds_free_volume_index(struct volume_index *volume_index) ...@@ -300,7 +300,7 @@ void uds_free_volume_index(struct volume_index *volume_index)
} }
static int compute_volume_sub_index_save_bytes(const struct configuration *config, static int compute_volume_sub_index_save_bytes(const struct uds_configuration *config,
size_t *bytes) size_t *bytes)
{ {
struct sub_index_parameters params = { .address_bits = 0 }; struct sub_index_parameters params = { .address_bits = 0 };
...@@ -317,7 +317,7 @@ static int compute_volume_sub_index_save_bytes(const struct configuration *confi ...@@ -317,7 +317,7 @@ static int compute_volume_sub_index_save_bytes(const struct configuration *confi
} }
/* This function is only useful if the configuration includes sparse chapters. */ /* This function is only useful if the configuration includes sparse chapters. */
static void split_configuration(const struct configuration *config, static void split_configuration(const struct uds_configuration *config,
struct split_config *split) struct split_config *split)
{ {
u64 sample_rate, sample_records; u64 sample_rate, sample_records;
...@@ -346,7 +346,7 @@ static void split_configuration(const struct configuration *config, ...@@ -346,7 +346,7 @@ static void split_configuration(const struct configuration *config,
split->non_hook_geometry.chapters_per_volume = dense_chapters; split->non_hook_geometry.chapters_per_volume = dense_chapters;
} }
static int compute_volume_index_save_bytes(const struct configuration *config, static int compute_volume_index_save_bytes(const struct uds_configuration *config,
size_t *bytes) size_t *bytes)
{ {
size_t hook_bytes, non_hook_bytes; size_t hook_bytes, non_hook_bytes;
...@@ -370,7 +370,7 @@ static int compute_volume_index_save_bytes(const struct configuration *config, ...@@ -370,7 +370,7 @@ static int compute_volume_index_save_bytes(const struct configuration *config,
return UDS_SUCCESS; return UDS_SUCCESS;
} }
int uds_compute_volume_index_save_blocks(const struct configuration *config, int uds_compute_volume_index_save_blocks(const struct uds_configuration *config,
size_t block_size, u64 *block_count) size_t block_size, u64 *block_count)
{ {
size_t bytes; size_t bytes;
...@@ -1172,7 +1172,7 @@ void uds_get_volume_index_stats(const struct volume_index *volume_index, ...@@ -1172,7 +1172,7 @@ void uds_get_volume_index_stats(const struct volume_index *volume_index,
stats->early_flushes += sparse_stats.early_flushes; stats->early_flushes += sparse_stats.early_flushes;
} }
static int initialize_volume_sub_index(const struct configuration *config, static int initialize_volume_sub_index(const struct uds_configuration *config,
u64 volume_nonce, u8 tag, u64 volume_nonce, u8 tag,
struct volume_sub_index *sub_index) struct volume_sub_index *sub_index)
{ {
...@@ -1222,7 +1222,7 @@ static int initialize_volume_sub_index(const struct configuration *config, ...@@ -1222,7 +1222,7 @@ static int initialize_volume_sub_index(const struct configuration *config,
"volume index zones", &sub_index->zones); "volume index zones", &sub_index->zones);
} }
int uds_make_volume_index(const struct configuration *config, u64 volume_nonce, int uds_make_volume_index(const struct uds_configuration *config, u64 volume_nonce,
struct volume_index **volume_index_ptr) struct volume_index **volume_index_ptr)
{ {
struct split_config split; struct split_config split;
......
...@@ -136,13 +136,13 @@ struct volume_index_record { ...@@ -136,13 +136,13 @@ struct volume_index_record {
struct delta_index_entry delta_entry; struct delta_index_entry delta_entry;
}; };
int __must_check uds_make_volume_index(const struct configuration *config, int __must_check uds_make_volume_index(const struct uds_configuration *config,
u64 volume_nonce, u64 volume_nonce,
struct volume_index **volume_index); struct volume_index **volume_index);
void uds_free_volume_index(struct volume_index *volume_index); void uds_free_volume_index(struct volume_index *volume_index);
int __must_check uds_compute_volume_index_save_blocks(const struct configuration *config, int __must_check uds_compute_volume_index_save_blocks(const struct uds_configuration *config,
size_t block_size, size_t block_size,
u64 *block_count); u64 *block_count);
......
...@@ -1538,7 +1538,7 @@ static int __must_check initialize_page_cache(struct page_cache *cache, ...@@ -1538,7 +1538,7 @@ static int __must_check initialize_page_cache(struct page_cache *cache,
return UDS_SUCCESS; return UDS_SUCCESS;
} }
int uds_make_volume(const struct configuration *config, struct index_layout *layout, int uds_make_volume(const struct uds_configuration *config, struct index_layout *layout,
struct volume **new_volume) struct volume **new_volume)
{ {
unsigned int i; unsigned int i;
......
...@@ -121,7 +121,7 @@ struct volume { ...@@ -121,7 +121,7 @@ struct volume {
unsigned int reserved_buffers; unsigned int reserved_buffers;
}; };
int __must_check uds_make_volume(const struct configuration *config, int __must_check uds_make_volume(const struct uds_configuration *config,
struct index_layout *layout, struct index_layout *layout,
struct volume **new_volume); struct volume **new_volume);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment