struct filesystem* fs;
uint32_t iobuf_size;
struct hbucket* i_cache;
+ void* data;
struct
{
uint32_t (*read_capacity)(struct v_superblock* vsb);
{
int (*write)(struct v_inode* inode, void* buffer, size_t len, size_t fpos);
int (*read)(struct v_inode* inode, void* buffer, size_t len, size_t fpos);
+
+ // for operatiosn {write|read}_page, following are true:
+ // + `len` always equals to PG_SIZE
+ // + `fpos` always PG_SIZE aligned.
+ // These additional operations allow underlying fs to use more specialized
+ // and optimized code.
+
+ int (*write_page)(struct v_inode* inode, void* pg, size_t len, size_t fpos);
+ int (*read_page)(struct v_inode* inode, void* pg, size_t len, size_t fpos);
+
int (*readdir)(struct v_file* file, struct dir_context* dctx);
int (*seek)(struct v_inode* inode, size_t offset); // optional
int (*close)(struct v_file* file);
int flags;
};
-// FIXME how do we invalidate corresponding v_dnodes given the v_inode?
+// [v_inode::aka_nodes]
+// how do we invalidate corresponding v_dnodes given the v_inode?
/*
Consider taskfs, which is Lunaix's speak of Linux's procfs, that allow
info of every process being accessible via file system. Each process's