fssh_off_t
#define off_t fssh_off_t
fssh_off_t offset;
fssh_off_t size;
fssh_off_t content_size;
fssh_off_t offset;
fssh_off_t size;
fssh_off_t offset; /* offset (in bytes) */
fssh_off_t size; /* size (in bytes) */
fssh_off_t position, void *data,
fssh_off_t position, const void *data,
fssh_off_t position, const fssh_iovec *vec,
fssh_off_t position, const fssh_iovec *vec,
fssh_off_t size;
uint32_t type, fssh_off_t pos, void *buffer,
uint32_t type, fssh_off_t pos, const void *buffer,
fssh_vnode_id vnodeID, fssh_off_t size);
fssh_off_t size);
fssh_off_t offset, void *bufferBase,
fssh_off_t offset, const void *buffer,
fssh_vnode_id vnodeID, fssh_off_t size);
extern void fssh_file_map_set_size(void *_map, fssh_off_t size);
extern void fssh_file_map_invalidate(void *_map, fssh_off_t offset,
fssh_off_t size);
extern fssh_status_t fssh_file_map_translate(void *_map, fssh_off_t offset,
fssh_off_t *_blockNumber, void **_data,
int32_t id, fssh_off_t blockNumber);
extern void * fssh_block_cache_create(int fd, fssh_off_t numBlocks,
fssh_off_t blockNumber, fssh_size_t numBlocks);
fssh_off_t blockNumber, fssh_size_t numBlocks);
fssh_off_t blockNumber, int32_t transaction);
fssh_off_t blockNumber, int32_t transaction,
fssh_off_t blockNumber, int32_t transaction);
fssh_off_t blockNumber, int32_t transaction);
fssh_off_t blockNumber, const void **_block);
fssh_off_t blockNumber);
fssh_off_t blockNumber, bool isDirty,
fssh_off_t blockNumber);
extern fssh_status_t fssh_block_cache_prefetch(void* _cache, fssh_off_t blockNumber,
fssh_off_t size;
fssh_off_t block_size; /* fundamental block size */
fssh_off_t io_size; /* optimal i/o size */
fssh_off_t total_blocks; /* total number of blocks */
fssh_off_t free_blocks; /* number of free blocks */
fssh_off_t total_nodes; /* total number of nodes */
fssh_off_t free_nodes; /* number of free nodes */
fssh_fs_cookie cookie, fssh_off_t pos, const fssh_iovec *vecs,
fssh_fs_cookie cookie, fssh_off_t pos, const fssh_iovec *vecs,
fssh_off_t offset, fssh_size_t size,
fssh_off_t pos, fssh_off_t length);
fssh_fs_cookie cookie, fssh_off_t pos, void *buffer,
fssh_fs_cookie cookie, fssh_off_t pos, const void *buffer,
fssh_fs_cookie cookie, fssh_off_t pos, void *buffer,
fssh_fs_cookie cookie, fssh_off_t pos, const void *buffer,
bool (*validate_resize)(fssh_partition_data *partition, fssh_off_t *size);
bool (*validate_move)(fssh_partition_data *partition, fssh_off_t *start);
fssh_off_t size, fssh_disk_job_id job);
fssh_off_t offset, fssh_disk_job_id job);
fssh_off_t partitionSize, fssh_disk_job_id job);
fssh_off_t partitionSize, uint32_t blockSize,
fssh_io_request* request, fssh_off_t offset, fssh_size_t size,
extern fssh_status_t fssh_read_pages(int fd, fssh_off_t pos,
extern fssh_status_t fssh_write_pages(int fd, fssh_off_t pos,
fssh_off_t offset;
fssh_off_t length;
fssh_off_t fssh_st_size; /* size in bytes of this file */
fssh_off_t fssh_st_blocks; /* number of blocks allocated for object */
fssh_ssize_t fssh_readv_pos(int fd, fssh_off_t pos, const struct
fssh_ssize_t fssh_writev_pos(int fd, fssh_off_t pos,
extern int fssh_ftruncate(int fd, fssh_off_t newSize);
extern int fssh_truncate(const char *path, fssh_off_t newSize);
extern fssh_ssize_t fssh_read_pos(int fd, fssh_off_t pos, void *buffer,
fssh_off_t pos);
extern fssh_ssize_t fssh_write_pos(int fd, fssh_off_t pos, const void *buffer,
fssh_off_t pos);
extern fssh_off_t fssh_lseek(int fd, fssh_off_t offset, int whence);
fssh_off_t max_blocks;
block_cache(int fd, fssh_off_t numBlocks,
cached_block* NewBlock(fssh_off_t blockNumber);
long* _cookie, fssh_off_t* _blockNumber, void** _data,
fssh_off_t blockNumber)
fssh_block_cache_create(int fd, fssh_off_t numBlocks, fssh_size_t blockSize, bool readOnly)
fssh_block_cache_sync_etc(void* _cache, fssh_off_t blockNumber,
fssh_block_cache_discard(void* _cache, fssh_off_t blockNumber,
fssh_block_cache_make_writable(void* _cache, fssh_off_t blockNumber,
fssh_block_cache_get_writable_etc(void* _cache, fssh_off_t blockNumber,
fssh_block_cache_get_writable(void* _cache, fssh_off_t blockNumber,
fssh_block_cache_get_empty(void* _cache, fssh_off_t blockNumber,
fssh_block_cache_get_etc(void* _cache, fssh_off_t blockNumber, const void** _block)
fssh_block_cache_get(void* _cache, fssh_off_t blockNumber)
fssh_block_cache_set_dirty(void* _cache, fssh_off_t blockNumber, bool dirty,
fssh_block_cache_put(void* _cache, fssh_off_t blockNumber)
fssh_block_cache_prefetch(void* _cache, fssh_off_t blockNumber, fssh_size_t* _numBlocks)
const fssh_off_t* block = (const fssh_off_t*)_block;
fssh_off_t diff = cacheEntry->block_number - *block;
const fssh_off_t* block = (const fssh_off_t*)_block;
block_cache::block_cache(int _fd, fssh_off_t numBlocks, fssh_size_t blockSize,
block_cache::NewBlock(fssh_off_t blockNumber)
fssh_off_t block_number;
put_cached_block(block_cache* cache, fssh_off_t blockNumber)
get_cached_block(block_cache* cache, fssh_off_t blockNumber, bool* _allocated,
get_writable_cached_block(block_cache* cache, fssh_off_t blockNumber,
fssh_off_t pos = 0;
fssh_off_t pos, void *buffer, int size)
fssh_off_t pos, const void *buffer, int size)
fssh_off_t pos, void *buffer, int size)
fssh_off_t pos, const void *buffer, int size)
fssh_off_t pos, void *buffer, int size) = 0;
fssh_off_t pos, const void *buffer, int size) = 0;
fssh_off_t chunkSize = (sourceFile->Stat().fssh_st_size / 20) / sCopyBufferSize * sCopyBufferSize;
fssh_off_t total = 0;
_kern_read(int fd, fssh_off_t pos, void *buffer, fssh_size_t length)
_kern_readv(int fd, fssh_off_t pos, const fssh_iovec *vecs, fssh_size_t count)
_kern_write(int fd, fssh_off_t pos, const void *buffer, fssh_size_t length)
_kern_writev(int fd, fssh_off_t pos, const fssh_iovec *vecs, fssh_size_t count)
fssh_off_t
_kern_seek(int fd, fssh_off_t pos, int seekType)
fssh_status_t (*fd_read)(struct file_descriptor *, fssh_off_t pos,
fssh_status_t (*fd_write)(struct file_descriptor *, fssh_off_t pos,
fssh_off_t (*fd_seek)(struct file_descriptor *, fssh_off_t pos,
fssh_off_t pos;
write_to_file(file_cache_ref *ref, void *cookie, fssh_off_t offset,
fssh_off_t offset, fssh_addr_t buffer, int32_t &pageOffset,
fssh_size_t bytesLeft, fssh_off_t &lastOffset,
cache_io(void *_cacheRef, void *cookie, fssh_off_t offset, fssh_addr_t buffer,
fssh_off_t fileSize = ref->virtual_size;
fssh_off_t lastOffset = offset;
fssh_off_t size)
fssh_file_cache_set_size(void *_cacheRef, fssh_off_t size)
fssh_file_cache_read(void *_cacheRef, void *cookie, fssh_off_t offset,
fssh_file_cache_write(void *_cacheRef, void *cookie, fssh_off_t offset,
fssh_off_t offset, int32_t pageOffset, fssh_addr_t buffer,
fssh_off_t virtual_size;
read_from_file(file_cache_ref *ref, void *cookie, fssh_off_t offset,
fssh_off_t startOffset = 0;
fssh_off_t endOffset = -1;
restricted_file_restrict_io(int fd, fssh_off_t& pos, fssh_off_t size)
fssh_off_t maxSize = restriction->endOffset - pos;
fssh_off_t
fssh_lseek(int fd, fssh_off_t offset, int whence)
fssh_off_t pos;
FileRestriction(fssh_dev_t device, fssh_ino_t node, fssh_off_t startOffset,
fssh_off_t endOffset)
fssh_off_t startOffset;
fssh_off_t endOffset;
add_file_restriction(const char* fileName, fssh_off_t startOffset,
fssh_off_t endOffset)
void add_file_restriction(const char* fileName, fssh_off_t startOffset,
fssh_off_t endOffset);
int restricted_file_restrict_io(int fd, fssh_off_t& pos, fssh_off_t size);
fssh_ssize_t _kern_read(int fd, fssh_off_t pos, void *buffer,
fssh_ssize_t _kern_readv(int fd, fssh_off_t pos, const fssh_iovec *vecs,
fssh_ssize_t _kern_write(int fd, fssh_off_t pos, const void *buffer,
fssh_ssize_t _kern_writev(int fd, fssh_off_t pos, const fssh_iovec *vecs,
fssh_off_t _kern_seek(int fd, fssh_off_t pos, int seekType);
fssh_writev_pos(int fd, fssh_off_t pos, const struct fssh_iovec *vec, int count)
fssh_off_t pos = -1;
fssh_readv_pos(int fd, fssh_off_t pos, const struct fssh_iovec *vec, int count)
fssh_off_t pos = -1;
fssh_off_t pos = -1;
fssh_read_pos(int fd, fssh_off_t pos, void *buffer, fssh_size_t count)
fssh_off_t pos = -1;
fssh_write_pos(int fd, fssh_off_t pos, const void *buffer, fssh_size_t count)
fssh_off_t fileOffset = fileVec.offset;
fssh_off_t fileLeft = fssh_min_c((uint64_t)fileVec.length, (uint64_t)bytesLeft);
static fssh_status_t file_read(struct file_descriptor *, fssh_off_t pos,
static fssh_status_t file_write(struct file_descriptor *, fssh_off_t pos,
static fssh_off_t file_seek(struct file_descriptor *, fssh_off_t pos,
static fssh_status_t attr_read(struct file_descriptor *, fssh_off_t pos,
static fssh_status_t attr_write(struct file_descriptor *, fssh_off_t pos,
static fssh_off_t attr_seek(struct file_descriptor *, fssh_off_t pos,
fssh_read_pages(int fd, fssh_off_t pos, const fssh_iovec *vecs,
fssh_write_pages(int fd, fssh_off_t pos, const fssh_iovec *vecs,
vfs_read_pages(void *_vnode, void *cookie, fssh_off_t pos,
vfs_write_pages(void *_vnode, void *cookie, fssh_off_t pos,
vfs_get_file_map(void *_vnode, fssh_off_t offset, fssh_size_t size,
file_read(struct file_descriptor *descriptor, fssh_off_t pos, void *buffer, fssh_size_t *length)
file_write(struct file_descriptor *descriptor, fssh_off_t pos, const void *buffer, fssh_size_t *length)
static fssh_off_t
file_seek(struct file_descriptor *descriptor, fssh_off_t pos, int seekType)
fssh_off_t offset;
attr_read(struct file_descriptor *descriptor, fssh_off_t pos, void *buffer, fssh_size_t *length)
attr_write(struct file_descriptor *descriptor, fssh_off_t pos, const void *buffer, fssh_size_t *length)
static fssh_off_t
attr_seek(struct file_descriptor *descriptor, fssh_off_t pos, int seekType)
fssh_off_t offset;
fssh_status_t vfs_read_pages(void *vnode, void *cookie, fssh_off_t pos,
fssh_off_t pos, const fssh_iovec *vecs, fssh_size_t count,
fssh_status_t vfs_get_file_map(void *_vnode, fssh_off_t offset,