X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/c6de44b989e9d7286337e4cbf4d82d919f9120e6..1e54f1850eda97e3b41c302b72c07a1f9cc4d637:/lunaix-os/includes/lunaix/fs.h diff --git a/lunaix-os/includes/lunaix/fs.h b/lunaix-os/includes/lunaix/fs.h index cc850ad..024b4ea 100644 --- a/lunaix-os/includes/lunaix/fs.h +++ b/lunaix-os/includes/lunaix/fs.h @@ -120,6 +120,16 @@ struct v_file_ops { 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); @@ -173,7 +183,8 @@ struct v_fd 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