29#define TARFS_MAX_FS CONFIG_TARFS_MAX_FS
30#define TARFS_MAX_FDS CONFIG_TARFS_MAX_FDS
44#define TARFS_IOCTL_BASE 0x54415200
47# define FIOGETFD (TARFS_IOCTL_BASE + 0)
50# define FIONREAD (TARFS_IOCTL_BASE + 1)
53# define FIONBIO (TARFS_IOCTL_BASE + 2)
74#if CONFIG_TARFS_INTEGRITY
80extern bool g_tarfs_log;
111#if CONFIG_TARFS_COUNTERS
120#if CONFIG_TARFS_HAVE_STATVFS_H
121# include <sys/statvfs.h>
207int tarfs_mount(
const char *label,
const char *mountpoint,
const char *link_rebase,
const char *path_rebase);
245 const char *mountpoint,
246 const char *link_rebase,
247 const char *path_rebase);
348int tarfs_info(
const char *mp,
size_t *raw_size,
size_t *data_size);
433#define log( Format_, ... ) do { if (g_tarfs_log) printf( "%s(): " Format_, __func__, ##__VA_ARGS__ ); } while(0)
438 log(
"tarfs core logging enabled\r\n");
445#define log( Format_, ... ) do {} while(0)
446#define tarfs_logging( X_ ) do {} while(0)
int tarfs_statvfs(void *ctx, struct statvfs *st)
Obtain filesystem statistics.
int tarfs_fsindex(const char *path)
Find the filesystem responsible for a given path.
int tarfs_unref(struct tarfs_fs *fs)
int tarfs_integrity_on_open(int fs_idx, int en)
Enable, disable, or query per-open filesystem integrity checking.
unsigned int tarfs_fsck(const char *label)
Perform a deep filesystem integrity check.
int tarfs_unmount(const char *mountpoint)
Unmount tar file system.
void * tarfs_calloc(size_t count, size_t size)
calloc() based on a memory backend; Memory backend must set errno if there were errors
char * tarfs_strdup(char const *str)
int tarfs_mount_memory(const void *addr, size_t length, const char *mountpoint, const char *link_rebase, const char *path_rebase)
Mount a TARFS filesystem from an already mapped memory buffer.
struct tarfs_fs * tarfs_getfs(int i)
Obtain raw pointer to the filesystem descriptor by filesystem slot (value returned by tarfs_mount()) ...
int tarfs_mount(const char *label, const char *mountpoint, const char *link_rebase, const char *path_rebase)
Mount a TARFS filesystem from an OS-specific resource.
int tarfs_addref(struct tarfs_fs *fs)
Filesystem reference counting.
int tarfs_dump(int fs_idx)
Dump internal filesystem information for debugging.
int tarfs_integrity(int en)
Enables or disables CRC64 integrity verification for TARFS archives.
struct tarfs_fs * tarfs_getfs_addref(int i)
Obtain raw pointer to the filesystem descriptor by filesystem slot Increment FS refcounter,...
#define tarfs_logging(X_)
int tarfs_info(const char *mp, size_t *raw_size, size_t *data_size)
Get filesystem size information.
void tarfs_os_release_mutex()
Unlock access to s_tarfs[] table and to the s_numfs counter only.
void tarfs_os_init()
Create a recursive sync object.
void tarfs_os_acquire_mutex()
Lock access to s_tarfs[] table and to the s_numfs counter only.
Return/Request argument for FIOGETFD ioctl.
The statvfs structure for systems without it (e.g.
TARFS File API: tarf_open(), tarf_close(), tarf_read(), tarf_pread(), tarf_lseek(),...
This descriptor holds all file descriptors opened.
_Atomic(uint32_t) fs_usedfd
struct tarfs_fp fs_fd[16]
tarfs_inode_t const * fs_root
struct tarfs_stats fs_stats
tarfs_inode_t const *const * fs_ino
TARFS inode structure, 12..20 bytes per inode; 1000 files require ~16KiB of RAM to store the filesyst...