Changeset 3b08178 in mainline for uspace/srv/fs/minixfs/mfs_ops.c
- Timestamp:
- 2011-03-17T15:22:22Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e54ba607
- Parents:
- 953a823
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/minixfs/mfs_ops.c
r953a823 r3b08178 31 31 */ 32 32 33 #include <libfs.h>34 33 #include <stdio.h> 35 34 #include <stdlib.h> 36 #include <libblock.h>37 35 #include <fibril_synch.h> 38 36 #include <errno.h> 39 #include <adt/list.h>40 37 #include "mfs.h" 41 38 #include "mfs_utils.h" … … 47 44 static LIST_INITIALIZE(inst_list); 48 45 static FIBRIL_MUTEX_INITIALIZE(inst_list_mutex); 46 47 libfs_ops_t mfs_libfs_ops; 49 48 50 49 void mfs_mounted(ipc_callid_t rid, ipc_call_t *request) … … 161 160 sbi->max_file_size = conv32(native, sb->s_max_file_size); 162 161 sbi->nzones = conv16(native, sb->s_nzones); 162 sbi->block_size = MFS_BLOCKSIZE; 163 163 if (version == MFS_VERSION_V2) 164 164 sbi->nzones = conv32(native, sb->s_nzones2); … … 166 166 167 167 free(sb); 168 169 rc = block_cache_init(devmap_handle, sbi->block_size, 0, CACHE_MODE_WT); 170 171 if (rc != EOK) { 172 block_fini(devmap_handle); 173 async_answer_0(rid, EINVAL); 174 mfsdebug("block cache initialization failed\n"); 175 return; 176 } 168 177 169 178 /*Initialize the instance structure and add it to the list*/ … … 181 190 } 182 191 192 void mfs_mount(ipc_callid_t rid, ipc_call_t *request) 193 { 194 libfs_mount(&mfs_libfs_ops, mfs_reg.fs_handle, rid, request); 195 } 196 197 /* 198 * Find a filesystem instance given the devmap handle 199 */ 200 int mfs_get_instance(devmap_handle_t handle, struct mfs_instance **instance) 201 { 202 link_t *link; 203 struct mfs_instance *instance_ptr; 204 205 fibril_mutex_lock(&inst_list_mutex); 206 207 for (link = inst_list.next; link != &inst_list; link = link->next) { 208 instance_ptr = list_get_instance(link, struct mfs_instance, link); 209 210 if (instance_ptr->handle == handle) { 211 *instance = instance_ptr; 212 fibril_mutex_unlock(&inst_list_mutex); 213 return EOK; 214 } 215 } 216 217 mfsdebug("Instance not found\n"); 218 219 fibril_mutex_unlock(&inst_list_mutex); 220 return EINVAL; 221 } 222 183 223 static bool check_magic_number(uint16_t magic, bool *native, 184 224 mfs_version_t *version, bool *longfilenames) … … 213 253 } 214 254 215 216 255 /** 217 256 * @}
Note:
See TracChangeset
for help on using the changeset viewer.