#include "io-factory.h"
#include <linux/atomic.h>
#include <linux/blkdev.h>
#include <linux/err.h>
#include <linux/mount.h>
#include "logger.h"
#include "memory-alloc.h"
#include "numeric.h"
struct io_factory { … };
struct buffered_reader { … };
#define MAX_READ_AHEAD_BLOCKS …
struct buffered_writer { … };
static void uds_get_io_factory(struct io_factory *factory)
{ … }
int uds_make_io_factory(struct block_device *bdev, struct io_factory **factory_ptr)
{ … }
int uds_replace_storage(struct io_factory *factory, struct block_device *bdev)
{ … }
void uds_put_io_factory(struct io_factory *factory)
{ … }
size_t uds_get_writable_size(struct io_factory *factory)
{ … }
int uds_make_bufio(struct io_factory *factory, off_t block_offset, size_t block_size,
unsigned int reserved_buffers, struct dm_bufio_client **client_ptr)
{ … }
static void read_ahead(struct buffered_reader *reader, sector_t block_number)
{ … }
void uds_free_buffered_reader(struct buffered_reader *reader)
{ … }
int uds_make_buffered_reader(struct io_factory *factory, off_t offset, u64 block_count,
struct buffered_reader **reader_ptr)
{ … }
static int position_reader(struct buffered_reader *reader, sector_t block_number,
off_t offset)
{ … }
static size_t bytes_remaining_in_read_buffer(struct buffered_reader *reader)
{ … }
static int reset_reader(struct buffered_reader *reader)
{ … }
int uds_read_from_buffered_reader(struct buffered_reader *reader, u8 *data,
size_t length)
{ … }
int uds_verify_buffered_data(struct buffered_reader *reader, const u8 *value,
size_t length)
{ … }
int uds_make_buffered_writer(struct io_factory *factory, off_t offset, u64 block_count,
struct buffered_writer **writer_ptr)
{ … }
static size_t get_remaining_write_space(struct buffered_writer *writer)
{ … }
static int __must_check prepare_next_buffer(struct buffered_writer *writer)
{ … }
static int flush_previous_buffer(struct buffered_writer *writer)
{ … }
void uds_free_buffered_writer(struct buffered_writer *writer)
{ … }
int uds_write_to_buffered_writer(struct buffered_writer *writer, const u8 *data,
size_t length)
{ … }
int uds_flush_buffered_writer(struct buffered_writer *writer)
{ … }