vfs: support for uncached read/write

This commit is contained in:
Matheus
2024-05-26 15:31:26 -03:00
parent 171fde1574
commit 61fa847b65
6 changed files with 79 additions and 33 deletions
+3
View File
@@ -47,6 +47,7 @@ int fd_clone(proc_t *proc);
#define O_NONBLOCK 04000
#define O_DSYNC 010000
#define O_ASYNC 020000
#define O_DIRECT 040000
#define O_LARGEFILE 0100000
#define O_DIRECTORY 0200000
#define O_NOFOLLOW 0400000
@@ -66,6 +67,8 @@ static inline int fileflagstovnodeflags(int flags) {
vnflags |= V_FFLAGS_NONBLOCKING;
if (flags & O_NOCTTY)
vnflags |= V_FFLAGS_NOCTTY;
if (flags & (O_DIRECT | O_SYNC | O_DSYNC))
vnflags |= V_FFLAGS_NOCACHE;
return vnflags;
}
+1
View File
@@ -56,6 +56,7 @@ typedef struct vfs_t {
#define V_FFLAGS_SHARED 8
#define V_FFLAGS_EXEC 16
#define V_FFLAGS_NOCTTY 32
#define V_FFLAGS_NOCACHE 64
typedef struct vnode_t {
struct vops_t *ops;