#include "index.h"
#include "logger.h"
#include "memory-alloc.h"
#include "funnel-requestqueue.h"
#include "hash-utils.h"
#include "sparse-cache.h"
static const u64 NO_LAST_SAVE = …;
struct chapter_writer { … };
static bool is_zone_chapter_sparse(const struct index_zone *zone, u64 virtual_chapter)
{ … }
static int launch_zone_message(struct uds_zone_message message, unsigned int zone,
struct uds_index *index)
{ … }
static void enqueue_barrier_messages(struct uds_index *index, u64 virtual_chapter)
{ … }
static u64 triage_index_request(struct uds_index *index, struct uds_request *request)
{ … }
static int simulate_index_zone_barrier_message(struct index_zone *zone,
struct uds_request *request)
{ … }
static void triage_request(struct uds_request *request)
{ … }
static int finish_previous_chapter(struct uds_index *index, u64 current_chapter_number)
{ … }
static int swap_open_chapter(struct index_zone *zone)
{ … }
static unsigned int start_closing_chapter(struct uds_index *index,
unsigned int zone_number,
struct open_chapter_zone *chapter)
{ … }
static int announce_chapter_closed(struct index_zone *zone, u64 closed_chapter)
{ … }
static int open_next_chapter(struct index_zone *zone)
{ … }
static int handle_chapter_closed(struct index_zone *zone, u64 virtual_chapter)
{ … }
static int dispatch_index_zone_control_request(struct uds_request *request)
{ … }
static void set_request_location(struct uds_request *request,
enum uds_index_region new_location)
{ … }
static void set_chapter_location(struct uds_request *request,
const struct index_zone *zone, u64 virtual_chapter)
{ … }
static int search_sparse_cache_in_zone(struct index_zone *zone, struct uds_request *request,
u64 virtual_chapter, bool *found)
{ … }
static int get_record_from_zone(struct index_zone *zone, struct uds_request *request,
bool *found)
{ … }
static int put_record_in_zone(struct index_zone *zone, struct uds_request *request,
const struct uds_record_data *metadata)
{ … }
static int search_index_zone(struct index_zone *zone, struct uds_request *request)
{ … }
static int remove_from_index_zone(struct index_zone *zone, struct uds_request *request)
{ … }
static int dispatch_index_request(struct uds_index *index, struct uds_request *request)
{ … }
static void execute_zone_request(struct uds_request *request)
{ … }
static int initialize_index_queues(struct uds_index *index,
const struct index_geometry *geometry)
{ … }
static void close_chapters(void *arg)
{ … }
static void stop_chapter_writer(struct chapter_writer *writer)
{ … }
static void free_chapter_writer(struct chapter_writer *writer)
{ … }
static int make_chapter_writer(struct uds_index *index,
struct chapter_writer **writer_ptr)
{ … }
static int load_index(struct uds_index *index)
{ … }
static int rebuild_index_page_map(struct uds_index *index, u64 vcn)
{ … }
static int replay_record(struct uds_index *index, const struct uds_record_name *name,
u64 virtual_chapter, bool will_be_sparse_chapter)
{ … }
static bool check_for_suspend(struct uds_index *index)
{ … }
static int replay_chapter(struct uds_index *index, u64 virtual, bool sparse)
{ … }
static int replay_volume(struct uds_index *index)
{ … }
static int rebuild_index(struct uds_index *index)
{ … }
static void free_index_zone(struct index_zone *zone)
{ … }
static int make_index_zone(struct uds_index *index, unsigned int zone_number)
{ … }
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)
{ … }
void uds_free_index(struct uds_index *index)
{ … }
void uds_wait_for_idle_index(struct uds_index *index)
{ … }
int uds_save_index(struct uds_index *index)
{ … }
int uds_replace_index_storage(struct uds_index *index, struct block_device *bdev)
{ … }
void uds_get_index_stats(struct uds_index *index, struct uds_index_stats *counters)
{ … }
void uds_enqueue_request(struct uds_request *request, enum request_stage stage)
{ … }