src/server/daemon/vfs.c

changeset 87
bdec069d2239
parent 72
9b888965f3ee
child 92
382bff43c6eb
equal deleted inserted replaced
86:49bb6c8ceb2b 87:bdec069d2239
57 } 57 }
58 return 0; 58 return 0;
59 } 59 }
60 60
61 void vfs_add(char *name, VFS *vfs) { 61 void vfs_add(char *name, VFS *vfs) {
62 WS_ASSERT(name);
63
62 if(!vfs_map) { 64 if(!vfs_map) {
63 vfs_init(); 65 vfs_init();
64 } 66 }
65 ucx_map_cstr_put(vfs_map, name, vfs); 67 ucx_map_cstr_put(vfs_map, name, vfs);
66 } 68 }
67 69
68 VFSContext* vfs_request_context(Session *sn, Request *rq) { 70 VFSContext* vfs_request_context(Session *sn, Request *rq) {
71 WS_ASSERT(sn);
72 WS_ASSERT(rq);
73
69 VFSContext *ctx = pool_malloc(sn->pool, sizeof(VFSContext)); 74 VFSContext *ctx = pool_malloc(sn->pool, sizeof(VFSContext));
70 ctx->sn = sn; 75 ctx->sn = sn;
71 ctx->rq = rq; 76 ctx->rq = rq;
72 ctx->vfs = rq->vfs; 77 ctx->vfs = rq->vfs;
73 ctx->user = acllist_getuser(sn, rq, rq->acllist); 78 ctx->user = acllist_getuser(sn, rq, rq->acllist);
77 ctx->vfs_errno = 0; 82 ctx->vfs_errno = 0;
78 return ctx; 83 return ctx;
79 } 84 }
80 85
81 SYS_FILE vfs_open(VFSContext *ctx, char *path, int oflags) { 86 SYS_FILE vfs_open(VFSContext *ctx, char *path, int oflags) {
87 WS_ASSERT(path);
88
82 Session *sn; 89 Session *sn;
83 Request *rq; 90 Request *rq;
84 pool_handle_t *pool; 91 pool_handle_t *pool;
85 uint32_t access_mask; 92 uint32_t access_mask;
86 93
248 free(fd); 255 free(fd);
249 } 256 }
250 } 257 }
251 258
252 VFS_DIR vfs_opendir(VFSContext *ctx, char *path) { 259 VFS_DIR vfs_opendir(VFSContext *ctx, char *path) {
260 WS_ASSERT(path);
261
253 Session *sn; 262 Session *sn;
254 Request *rq; 263 Request *rq;
255 pool_handle_t *pool; 264 pool_handle_t *pool;
256 uint32_t access_mask; 265 uint32_t access_mask;
257 266

mercurial