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 configuration *user)
+ struct uds_configuration *user)
{
struct index_geometry *geometry = user->geometry;
bool result = true;
/* Read the configuration and validate it against the provided one. */
int uds_validate_config_contents(struct buffered_reader *reader,
- struct configuration *user_config)
+ struct uds_configuration *user_config)
{
int result;
- struct configuration config;
+ struct uds_configuration config;
struct index_geometry geometry;
u8 version_buffer[INDEX_CONFIG_VERSION_LENGTH];
u32 bytes_per_page;
* been reduced by one chapter.
*/
int uds_write_config_contents(struct buffered_writer *writer,
- struct configuration *config, u32 version)
+ struct uds_configuration *config, u32 version)
{
int result;
struct index_geometry *geometry = config->geometry;
}
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 record_pages_per_chapter = 0;
u32 sparse_chapters_per_volume = 0;
if (result != UDS_SUCCESS)
return result;
- result = uds_allocate(1, struct configuration, __func__, &config);
+ result = uds_allocate(1, struct uds_configuration, __func__, &config);
if (result != UDS_SUCCESS)
return result;
return UDS_SUCCESS;
}
-void uds_free_configuration(struct configuration *config)
+void uds_free_configuration(struct uds_configuration *config)
{
if (config != NULL) {
uds_free_index_geometry(config->geometry);
}
}
-void uds_log_configuration(struct configuration *config)
+void uds_log_configuration(struct uds_configuration *config)
{
struct index_geometry *geometry = config->geometry;
#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
* values. It is created when an index is created, and it is recorded in the index metadata.
*/
};
/* A set of configuration parameters for the indexer. */
-struct configuration {
+struct uds_configuration {
/* Storage device for the index */
struct block_device *bdev;
} __packed;
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,
- struct configuration *config);
+ struct uds_configuration *config);
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 */
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)
{
int result;
int uds_compute_index_size(const struct uds_parameters *parameters, u64 *index_size)
{
int result;
- struct configuration *index_config;
+ struct uds_configuration *index_config;
struct save_layout_sizes sizes;
if (index_size == NULL) {
}
static int __must_check write_uds_index_config(struct index_layout *layout,
- struct configuration *config,
+ struct uds_configuration *config,
off_t offset)
{
int 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;
struct save_layout_sizes sizes;
}
static int __must_check verify_uds_index_config(struct index_layout *layout,
- struct configuration *config)
+ struct uds_configuration *config)
{
int result;
struct buffered_reader *reader = NULL;
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;
struct buffered_reader *reader;
}
static int create_layout_factory(struct index_layout *layout,
- const struct configuration *config)
+ const struct uds_configuration *config)
{
int result;
size_t writable_size;
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)
{
int result;
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);
void uds_free_index_layout(struct index_layout *layout);
enum uds_open_index_type open_type)
{
int result;
- struct configuration *config;
+ struct uds_configuration *config;
result = uds_make_configuration(&index_session->parameters, &config);
if (result != 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 uds_index **new_index)
{
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,
struct index_load_context *load_context,
index_callback_fn callback, struct uds_index **new_index);
struct split_config {
/* The hook subindex configuration */
- struct configuration hook_config;
+ struct uds_configuration hook_config;
struct index_geometry hook_geometry;
/* The non-hook subindex configuration */
- struct configuration non_hook_config;
+ struct uds_configuration non_hook_config;
struct index_geometry non_hook_geometry;
};
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)
{
enum { DELTA_LIST_SIZE = 256 };
}
-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)
{
struct sub_index_parameters params = { .address_bits = 0 };
}
/* 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)
{
u64 sample_rate, sample_records;
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 hook_bytes, non_hook_bytes;
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 bytes;
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,
struct volume_sub_index *sub_index)
{
"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 split_config split;
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,
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,
u64 *block_count);
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)
{
unsigned int i;
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 volume **new_volume);