forked from StevenBaby/onix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0409c4f
commit 56cc799
Showing
25 changed files
with
2,556 additions
and
2,040 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# 虚拟文件系统 | ||
|
||
定义和重构虚拟文件系统: | ||
|
||
```c++ | ||
typedef struct fs_op_t | ||
{ | ||
int (*mkfs)(dev_t dev, int args); | ||
|
||
int (*super)(dev_t dev, super_t *super); | ||
|
||
int (*open)(inode_t *dir, char *name, int flags, int mode, inode_t **result); | ||
void (*close)(inode_t *inode); | ||
|
||
int (*read)(inode_t *inode, char *data, int len, off_t offset); | ||
int (*write)(inode_t *inode, char *data, int len, off_t offset); | ||
int (*truncate)(inode_t *inode); | ||
|
||
int (*stat)(inode_t *inode, stat_t *stat); | ||
int (*permission)(inode_t *inode, int mask); | ||
|
||
int (*namei)(inode_t *dir, char *name, char **next, inode_t **result); | ||
int (*mkdir)(inode_t *dir, char *name, int mode); | ||
int (*rmdir)(inode_t *dir, char *name); | ||
int (*link)(inode_t *odir, char *oldname, inode_t *ndir, char *newname); | ||
int (*unlink)(inode_t *dir, char *name); | ||
int (*mknod)(inode_t *dir, char *name, int mode, int dev); | ||
int (*readdir)(inode_t *inode, dentry_t *entry, size_t count, off_t offset); | ||
} fs_op_t; | ||
``` | ||
## 参考 | ||
- <https://github.com/ringgaard/sanos> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.