Android-cuttlefish cvd tool
Typedefs | Functions
fec_read.cpp File Reference
#include <fcntl.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <fec.h>
#include "fec_private.h"
Include dependency graph for fec_read.cpp:

Typedefs

using rs_unique_ptr = std::unique_ptr< void, decltype(&free_rs_char)>
 

Functions

static void dump (const char *name, uint64_t value, const uint8_t *data, size_t size)
 
static bool is_erasure (fec_handle *f, uint64_t offset, const uint8_t *data)
 
static bool is_zero (fec_handle *f, uint64_t offset)
 
static int __ecc_read (fec_handle *f, void *rs, uint8_t *dest, uint64_t offset, bool use_erasures, uint8_t *ecc_data, size_t *errors)
 
static int ecc_init (fec_handle *f, rs_unique_ptr &rs, std::unique_ptr< uint8_t[]> &ecc_data)
 
static ssize_t ecc_read (fec_handle *f, uint8_t *dest, size_t count, uint64_t offset, size_t *errors)
 
static ssize_t verity_read (fec_handle *f, uint8_t *dest, size_t count, uint64_t offset, size_t *errors)
 
int fec_seek (struct fec_handle *f, int64_t offset, int whence)
 
ssize_t fec_read (struct fec_handle *f, void *buf, size_t count)
 
static size_t get_max_count (uint64_t offset, size_t count, uint64_t max)
 
bool raw_pread (int fd, void *buf, size_t count, uint64_t offset)
 
bool raw_pwrite (int fd, const void *buf, size_t count, uint64_t offset)
 
ssize_t fec_pread (struct fec_handle *f, void *buf, size_t count, uint64_t offset)
 

Typedef Documentation

◆ rs_unique_ptr

using rs_unique_ptr = std::unique_ptr<void, decltype(&free_rs_char)>

Function Documentation

◆ __ecc_read()

static int __ecc_read ( fec_handle f,
void *  rs,
uint8_t *  dest,
uint64_t  offset,
bool  use_erasures,
uint8_t *  ecc_data,
size_t *  errors 
)
static

◆ dump()

static void dump ( const char *  name,
uint64_t  value,
const uint8_t *  data,
size_t  size 
)
static

◆ ecc_init()

static int ecc_init ( fec_handle f,
rs_unique_ptr rs,
std::unique_ptr< uint8_t[]> &  ecc_data 
)
static

◆ ecc_read()

static ssize_t ecc_read ( fec_handle f,
uint8_t *  dest,
size_t  count,
uint64_t  offset,
size_t *  errors 
)
static

◆ fec_pread()

ssize_t fec_pread ( struct fec_handle f,
void *  buf,
size_t  count,
uint64_t  offset 
)

◆ fec_read()

ssize_t fec_read ( struct fec_handle f,
void *  buf,
size_t  count 
)

◆ fec_seek()

int fec_seek ( struct fec_handle f,
int64_t  offset,
int  whence 
)

◆ get_max_count()

static size_t get_max_count ( uint64_t  offset,
size_t  count,
uint64_t  max 
)
inlinestatic

◆ is_erasure()

static bool is_erasure ( fec_handle f,
uint64_t  offset,
const uint8_t *  data 
)
inlinestatic

◆ is_zero()

static bool is_zero ( fec_handle f,
uint64_t  offset 
)
inlinestatic

◆ raw_pread()

bool raw_pread ( int  fd,
void *  buf,
size_t  count,
uint64_t  offset 
)

◆ raw_pwrite()

bool raw_pwrite ( int  fd,
const void *  buf,
size_t  count,
uint64_t  offset 
)

◆ verity_read()

static ssize_t verity_read ( fec_handle f,
uint8_t *  dest,
size_t  count,
uint64_t  offset,
size_t *  errors 
)
static