lib: fs: implement mounting filesystems; reading, writing from files
This commit is contained in:
@@ -1,17 +1,37 @@
|
||||
#ifndef FS_INODE_H_
|
||||
#define FS_INODE_H_
|
||||
|
||||
#include <fs/status.h>
|
||||
#include <stddef.h>
|
||||
|
||||
struct fs_inode;
|
||||
struct fs_dentry;
|
||||
struct fs_superblock;
|
||||
struct fs_file_ops;
|
||||
|
||||
enum fs_inode_mode {
|
||||
FS_INODE_REG = 0x01u,
|
||||
FS_INODE_DIR = 0x02u,
|
||||
};
|
||||
|
||||
struct fs_inode_ops {
|
||||
int (*i_lookup)(struct fs_inode *, struct fs_dentry *);
|
||||
enum fs_status (*i_lookup)(
|
||||
struct fs_inode *,
|
||||
const char *,
|
||||
struct fs_dentry **);
|
||||
};
|
||||
|
||||
struct fs_inode {
|
||||
enum fs_inode_mode i_mode;
|
||||
struct fs_superblock *i_sb;
|
||||
const struct fs_inode_ops *i_ops;
|
||||
const struct fs_file_ops *i_fops;
|
||||
size_t i_size;
|
||||
};
|
||||
|
||||
extern enum fs_status fs_inode_lookup(
|
||||
struct fs_inode *inode,
|
||||
const char *name,
|
||||
struct fs_dentry **out);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user