src/server/public/vfs.h

changeset 193
aa8393527b1e
parent 189
a2438f6d1e73
child 211
2160585200ac
equal deleted inserted replaced
183:f33974f0dce0 193:aa8393527b1e
34 34
35 #ifdef __cplusplus 35 #ifdef __cplusplus
36 extern "C" { 36 extern "C" {
37 #endif 37 #endif
38 38
39 #define VFS_CHECKS_ACL 0x0001
40
39 typedef struct VFS_IO VFS_IO; 41 typedef struct VFS_IO VFS_IO;
40 typedef struct VFS_DIRIO VFS_DIRIO; 42 typedef struct VFS_DIRIO VFS_DIRIO;
41 typedef struct VFSFile VFSFile; 43 typedef struct VFSFile VFSFile;
42 typedef struct VFSDir VFSDir; 44 typedef struct VFSDir VFSDir;
43 typedef struct VFSEntry VFSEntry; 45 typedef struct VFSEntry VFSEntry;
50 int (*stat)(VFSContext *ctx, char *path, struct stat *buf); 52 int (*stat)(VFSContext *ctx, char *path, struct stat *buf);
51 int (*fstat)(VFSContext *ctx, SYS_FILE fd, struct stat *buf); 53 int (*fstat)(VFSContext *ctx, SYS_FILE fd, struct stat *buf);
52 VFS_DIR (*opendir)(VFSContext *ctx, char *path); 54 VFS_DIR (*opendir)(VFSContext *ctx, char *path);
53 int (*mkdir)(VFSContext *ctx, char *path); 55 int (*mkdir)(VFSContext *ctx, char *path);
54 int (*unlink)(VFSContext *ctx, char *path); 56 int (*unlink)(VFSContext *ctx, char *path);
57 uint32_t flags;
55 }; 58 };
56 59
57 struct VFSContext { 60 struct VFSContext {
58 pool_handle_t *pool; 61 pool_handle_t *pool;
59 Session *sn; 62 Session *sn;
87 }; 90 };
88 91
89 struct VFS_IO { 92 struct VFS_IO {
90 ssize_t (*read)(SYS_FILE fd, void *buf, size_t nbyte); 93 ssize_t (*read)(SYS_FILE fd, void *buf, size_t nbyte);
91 ssize_t (*write)(SYS_FILE fd, const void *buf, size_t nbyte); 94 ssize_t (*write)(SYS_FILE fd, const void *buf, size_t nbyte);
95 ssize_t (*pread)(SYS_FILE fd, void *buf, size_t nbyte, off_t offset);
96 ssize_t (*pwrite)(SYS_FILE fd, const void *buf, size_t nbyte, off_t offset);
92 off_t (*seek)(SYS_FILE fd, off_t offset, int whence); 97 off_t (*seek)(SYS_FILE fd, off_t offset, int whence);
93 void (*close)(SYS_FILE fd); 98 void (*close)(SYS_FILE fd);
99 int (*opt_aioread)(aiocb_s *aiocb);
100 int (*opt_aiowrite)(aiocb_s *aiocb);
94 }; 101 };
95 102
96 struct VFS_DIRIO { 103 struct VFS_DIRIO {
97 int (*readdir)(VFS_DIR dir, VFS_ENTRY *entry, int getstat); 104 int (*readdir)(VFS_DIR dir, VFS_ENTRY *entry, int getstat);
98 void (*close)(VFS_DIR dir); 105 void (*close)(VFS_DIR dir);

mercurial