Changeset 41202a9 in mainline
- Timestamp:
- 2011-03-26T10:38:09Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7cb975e
- Parents:
- 54caa41b
- Location:
- uspace/srv/fs/minixfs
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified uspace/srv/fs/minixfs/mfs.c ¶
r54caa41b r41202a9 94 94 95 95 callid = async_get_call(&call); 96 switch (IPC_GET_IMETHOD(call)) { 96 int method = IPC_GET_IMETHOD(call); 97 98 mfsdebug(NAME "method = %d\n", method); 99 switch (method) { 97 100 case IPC_M_PHONE_HUNGUP: 98 101 return; … … 108 111 break; 109 112 case VFS_OUT_LOOKUP: 113 mfsdebug("lookup called\n"); 110 114 mfs_lookup(callid, &call); 111 115 break; -
TabularUnified uspace/srv/fs/minixfs/mfs.h ¶
r54caa41b r41202a9 98 98 99 99 bool dirty; 100 fs_index_t index; 100 101 }; 101 102 -
TabularUnified uspace/srv/fs/minixfs/mfs_ops.c ¶
r54caa41b r41202a9 44 44 fs_index_t index); 45 45 46 static int mfs_node_put(fs_node_t *fsnode); 47 static int mfs_node_open(fs_node_t *fsnode); 48 static fs_index_t mfs_index_get(fs_node_t *fsnode); 49 static unsigned mfs_lnkcnt_get(fs_node_t *fsnode); 50 46 51 static LIST_INITIALIZE(inst_list); 47 52 static FIBRIL_MUTEX_INITIALIZE(inst_list_mutex); … … 54 59 .is_file = mfs_is_file, 55 60 .node_get = mfs_node_get, 61 .node_put = mfs_node_put, 62 .node_open = mfs_node_open, 63 .index_get = mfs_index_get, 56 64 .plb_get_char = mfs_plb_get_char, 57 .has_children = mfs_has_children 65 .has_children = mfs_has_children, 66 .lnkcnt_get = mfs_lnkcnt_get 58 67 }; 59 68 … … 221 230 assert(mnode->ino_i); 222 231 232 mfsdebug("inode size is %d\n", (int) mnode->ino_i->i_size); 233 223 234 return mnode->ino_i->i_size; 224 235 } … … 236 247 struct mfs_instance *instance; 237 248 249 mfsdebug("node_get called\n"); 250 238 251 rc = mfs_instance_get(devmap_handle, &instance); 239 252 … … 242 255 243 256 return mfs_node_core_get(rfn, instance, index); 257 } 258 259 static int mfs_node_put(fs_node_t *fsnode) 260 { 261 struct mfs_node *mnode = fsnode->data; 262 263 mfsdebug("mfs_node_put()\n"); 264 265 assert(mnode->ino_i); 266 267 if (mnode->ino_i->dirty) { 268 /*TODO: Write inode on disk*/ 269 } 270 271 free(mnode->ino_i); 272 free(mnode); 273 274 return EOK; 275 } 276 277 static int mfs_node_open(fs_node_t *fsnode) 278 { 279 mfsdebug("mfs_node_open()\n"); 280 /* 281 * Opening a file is stateless, nothing 282 * to be done here. 283 */ 284 return EOK; 285 } 286 287 static fs_index_t mfs_index_get(fs_node_t *fsnode) 288 { 289 struct mfs_node *mnode = fsnode->data; 290 291 mfsdebug("mfs_index_get()\n"); 292 293 assert(mnode->ino_i); 294 return mnode->ino_i->index; 295 } 296 297 static unsigned mfs_lnkcnt_get(fs_node_t *fsnode) 298 { 299 unsigned rc; 300 struct mfs_node *mnode = fsnode->data; 301 302 assert(mnode); 303 assert(mnode->ino_i); 304 305 rc = mnode->ino_i->i_nlinks; 306 mfsdebug("mfs_lnkcnt_get(): %u\n", rc); 307 return rc; 244 308 } 245 309 … … 280 344 return -1; 281 345 346 ino_i->index = index; 282 347 mnode->ino_i = ino_i; 283 348 … … 285 350 node->data = mnode; 286 351 *rfn = node; 352 353 mfsdebug("node_get_core(%d) OK\n", (int) index); 287 354 288 355 return EOK; … … 310 377 int mfs_root_get(fs_node_t **rfn, devmap_handle_t handle) 311 378 { 312 return mfs_node_get(rfn, handle, MFS_ROOT_INO); 379 int rc = mfs_node_get(rfn, handle, MFS_ROOT_INO); 380 381 mfsdebug("mfs_root_get %s\n", rc == EOK ? "OK" : "FAIL"); 382 return rc; 313 383 } 314 384 … … 353 423 } 354 424 425 out: 426 355 427 if (*has_children) 356 428 mfsdebug("Has children\n"); … … 358 430 mfsdebug("Has not children\n"); 359 431 360 out:361 432 return EOK; 362 433 }
Note:
See TracChangeset
for help on using the changeset viewer.