VFS mountpoint backing device system
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m24s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m24s
This commit is contained in:
42
kernel/fs/tarfs.h
Normal file
42
kernel/fs/tarfs.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef _KERNEL_FS_TARFS_H
|
||||
#define _KERNEL_FS_TARFS_H
|
||||
|
||||
#include <device/device.h>
|
||||
#include <libk/std.h>
|
||||
#include <m/fs_desc_buffer.h>
|
||||
|
||||
struct tar_header {
|
||||
char filename[100];
|
||||
uint8_t mode[8];
|
||||
uint8_t uid[8];
|
||||
uint8_t gid[8];
|
||||
uint8_t size[12];
|
||||
uint8_t mtime[12];
|
||||
uint8_t checksum[8];
|
||||
uint8_t type_flag;
|
||||
} PACKED;
|
||||
|
||||
struct tar_file {
|
||||
struct tar_header* header;
|
||||
uint8_t* content;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
#define TARFS_FILES_MAX 128
|
||||
|
||||
struct tarfs {
|
||||
struct tar_file tarfs_files[TARFS_FILES_MAX];
|
||||
uint8_t* buffer;
|
||||
};
|
||||
|
||||
struct vfs_mountpoint;
|
||||
|
||||
int tarfs_mount (struct vfs_mountpoint* mountpoint, struct device_op_ctx* op_ctx);
|
||||
|
||||
int tarfs_describe (struct vfs_mountpoint* mountpoint, const char* path,
|
||||
struct fs_desc_buffer* desc);
|
||||
|
||||
int tarfs_read (struct vfs_mountpoint* mountpoint, const char* path, uint8_t* buffer, size_t off,
|
||||
size_t size);
|
||||
|
||||
#endif // _KERNEL_FS_TARFS_H
|
||||
Reference in New Issue
Block a user