188 file = ucx_map_sstr_get(vfs->files, s_path); |
188 file = ucx_map_sstr_get(vfs->files, s_path); |
189 if(!file) { |
189 if(!file) { |
190 if((oflags & O_CREAT) == O_CREAT) { |
190 if((oflags & O_CREAT) == O_CREAT) { |
191 file = pool_malloc(ctx->sn->pool, sizeof(TestVFSFile)); |
191 file = pool_malloc(ctx->sn->pool, sizeof(TestVFSFile)); |
192 ZERO(file, sizeof(TestVFSFile)); |
192 ZERO(file, sizeof(TestVFSFile)); |
|
193 file->file.ctx = ctx; |
193 file->path = sstrdup_a(session_get_allocator(ctx->sn), s_path); |
194 file->path = sstrdup_a(session_get_allocator(ctx->sn), s_path); |
194 file->file.io = &test_file_io; |
195 file->file.io = &test_file_io; |
195 |
196 |
196 file->content = pool_calloc(ctx->sn->pool, 1, sizeof(UcxBuffer)); |
197 file->content = pool_calloc(ctx->sn->pool, 1, sizeof(UcxBuffer)); |
197 file->content->capacity = 2048; |
198 file->content->capacity = 2048; |