src/server/daemon/vfs.c

changeset 659
07b815faa6ac
parent 593
d83dced6dd80
equal deleted inserted replaced
658:7290604d846d 659:07b815faa6ac
101 return 1; 101 return 1;
102 } 102 }
103 vfsType->init = vfsInit; 103 vfsType->init = vfsInit;
104 vfsType->create = vfsCreate; 104 vfsType->create = vfsCreate;
105 105
106 return cxMapPut(vfs_type_map, cx_hash_key_str(name), vfsType); 106 return cxMapPut(vfs_type_map, name, vfsType);
107 } 107 }
108 108
109 VfsType* vfs_get_type(cxstring vfs_class) { 109 VfsType* vfs_get_type(cxstring vfs_class) {
110 return cxMapGet(vfs_type_map, cx_hash_key_bytes((const unsigned char*)vfs_class.ptr, vfs_class.length)); 110 return cxMapGet(vfs_type_map, cx_hash_key_bytes((const unsigned char*)vfs_class.ptr, vfs_class.length));
111 } 111 }
122 return NULL; 122 return NULL;
123 } 123 }
124 } 124 }
125 125
126 VFS* vfs_create(Session *sn, Request *rq, const char *vfs_class, pblock *pb, void *initData) { 126 VFS* vfs_create(Session *sn, Request *rq, const char *vfs_class, pblock *pb, void *initData) {
127 VfsType *vfsType = cxMapGet(vfs_type_map, cx_hash_key_str(vfs_class)); 127 VfsType *vfsType = cxMapGet(vfs_type_map, vfs_class);
128 if(!vfsType) { 128 if(!vfsType) {
129 log_ereport(LOG_MISCONFIG, "vfs_create: unkown VFS type %s", vfs_class); 129 log_ereport(LOG_MISCONFIG, "vfs_create: unkown VFS type %s", vfs_class);
130 return NULL; 130 return NULL;
131 } 131 }
132 132

mercurial