mirror of
https://github.com/AltraMayor/f3.git
synced 2025-09-08 23:04:03 -04:00

This option instructs f3probe to trade speed for less memory usage, that is, f3probe minimizes use of memory. Currently, this option only drops the use of the bitmap of the safe device. Nevertheless, this is not negligible memory. For example, a 1TB drive whose block size is 512 Bytes requires 256MB of RAM for this bitmap: 1TB / 512Byte/Block = 2^31Block 2^31Block / 1Block/bit = 2^31bit 2^31bit / 8bit/Byte = 2^28Byte = 256MB To put it in context, 256MB of RAM was all that Raspberry Pi Model A had.
51 lines
1.2 KiB
C
51 lines
1.2 KiB
C
#ifndef HEADER_LIBPROBE_H
|
|
#define HEADER_LIBPROBE_H
|
|
|
|
#include <stdint.h>
|
|
|
|
enum fake_type {
|
|
/* Device is good. */
|
|
FKTY_GOOD,
|
|
|
|
/* Device is at least partially damaged. */
|
|
FKTY_BAD,
|
|
|
|
/* Device discards data after a given limit. */
|
|
FKTY_LIMBO,
|
|
|
|
/* Device overwrites data after a given limit. */
|
|
FKTY_WRAPAROUND,
|
|
|
|
/* Device is a sequence of wraparound and limbo regions. */
|
|
FKTY_CHAIN,
|
|
|
|
FKTY_MAX,
|
|
};
|
|
|
|
const char *fake_type_to_name(enum fake_type fake_type);
|
|
|
|
int dev_param_valid(uint64_t real_size_byte,
|
|
uint64_t announced_size_byte, int wrap, int block_order);
|
|
|
|
enum fake_type dev_param_to_type(uint64_t real_size_byte,
|
|
uint64_t announced_size_byte, int wrap, int block_order);
|
|
|
|
struct device;
|
|
|
|
struct device *create_file_device(const char *filename,
|
|
uint64_t real_size_byte, uint64_t fake_size_byte, int wrap,
|
|
int block_order, int keep_file);
|
|
|
|
struct device *create_block_device(const char *filename, int manual_reset);
|
|
|
|
struct device *create_safe_device(struct device *dev, int max_blocks,
|
|
int min_memory);
|
|
|
|
void free_device(struct device *dev);
|
|
|
|
int probe_device_max_blocks(struct device *dev);
|
|
void probe_device(struct device *dev, uint64_t *preal_size_byte,
|
|
uint64_t *pannounced_size_byte, int *pwrap, int *block_order);
|
|
|
|
#endif /* HEADER_LIBPROBE_H */
|