Changeset 76a67ce in mainline
- Timestamp:
- 2011-11-05T12:35:09Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4965357f
- Parents:
- 10e4cd7
- Location:
- uspace/srv/vfs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs.c
r10e4cd7 r76a67ce 128 128 break; 129 129 case VFS_IN_GET_MTAB: 130 //vfs_get_mounted_fs_info(callid, &call);130 vfs_get_mtab(callid, &call); 131 131 break; 132 132 default: -
uspace/srv/vfs/vfs.h
r10e4cd7 r76a67ce 220 220 extern void vfs_rename(ipc_callid_t, ipc_call_t *); 221 221 extern void vfs_wait_handle(ipc_callid_t, ipc_call_t *); 222 extern void vfs_get_mtab(ipc_callid_t, ipc_call_t *); 222 223 223 224 #endif -
uspace/srv/vfs/vfs_ops.c
r10e4cd7 r76a67ce 464 464 */ 465 465 466 free(mp);467 468 466 exch = vfs_exchange_grab(mr_node->fs_handle); 469 467 rc = async_req_1_0(exch, VFS_OUT_UNMOUNTED, … … 473 471 if (rc != EOK) { 474 472 fibril_rwlock_write_unlock(&namespace_rwlock); 473 free(mp); 475 474 vfs_node_put(mr_node); 476 475 async_answer_0(rid, rc); … … 490 489 491 490 rc = vfs_lookup_internal(mp, L_MP, &mp_res, NULL); 492 free(mp);493 491 if (rc != EOK) { 494 492 fibril_rwlock_write_unlock(&namespace_rwlock); 493 free(mp); 495 494 vfs_node_put(mr_node); 496 495 async_answer_0(rid, rc); … … 501 500 if (!mp_node) { 502 501 fibril_rwlock_write_unlock(&namespace_rwlock); 502 free(mp); 503 503 vfs_node_put(mr_node); 504 504 async_answer_0(rid, ENOMEM); … … 513 513 if (rc != EOK) { 514 514 fibril_rwlock_write_unlock(&namespace_rwlock); 515 free(mp); 515 516 vfs_node_put(mp_node); 516 517 vfs_node_put(mr_node); … … 530 531 */ 531 532 vfs_node_forget(mr_node); 532 533 533 fibril_rwlock_write_unlock(&namespace_rwlock); 534 535 fibril_mutex_lock(&mtab_list_lock); 536 537 int found = 0; 538 539 list_foreach(mtab_list, cur) { 540 mtab_list_ent_t *ent = list_get_instance(cur, mtab_list_ent_t, 541 link); 542 543 mtab_ent_t *mtab_ent = &ent->mtab_ent; 544 545 if (str_cmp(mtab_ent->mp, mp) == 0) { 546 list_remove(&ent->link); 547 mtab_size--; 548 free(ent); 549 found = 1; 550 break; 551 } 552 } 553 assert(found); 554 555 free(mp); 556 557 fibril_mutex_unlock(&mtab_list_lock); 534 558 async_answer_0(rid, EOK); 535 559 } … … 1320 1344 } 1321 1345 1346 void vfs_get_mtab(ipc_callid_t rid, ipc_call_t *request) 1347 { 1348 ipc_callid_t callid; 1349 ipc_call_t data; 1350 sysarg_t rc = EOK; 1351 size_t len; 1352 1353 fibril_mutex_lock(&mtab_list_lock); 1354 1355 /* Send to the caller the number of mounted filesystems */ 1356 callid = async_get_call(&data); 1357 if (IPC_GET_IMETHOD(data) != VFS_IN_PING) { 1358 rc = ENOTSUP; 1359 async_answer_1(callid, rc, 0); 1360 goto exit; 1361 } 1362 async_answer_1(callid, EOK, mtab_size); 1363 1364 list_foreach(mtab_list, cur) { 1365 mtab_list_ent_t *ent = list_get_instance(cur, mtab_list_ent_t, 1366 link); 1367 1368 mtab_ent_t *mtab_ent = &ent->mtab_ent; 1369 1370 rc = ENOTSUP; 1371 1372 if (!async_data_read_receive(&callid, &len)) 1373 goto exit; 1374 1375 (void) async_data_read_finalize(callid, mtab_ent->mp, 1376 str_size(mtab_ent->mp)); 1377 1378 if (!async_data_read_receive(&callid, &len)) 1379 goto exit; 1380 1381 (void) async_data_read_finalize(callid, mtab_ent->opts, 1382 str_size(mtab_ent->opts)); 1383 1384 if (!async_data_read_receive(&callid, &len)) 1385 goto exit; 1386 1387 (void) async_data_read_finalize(callid, mtab_ent->fs_name, 1388 str_size(mtab_ent->fs_name)); 1389 1390 sysarg_t p[3]; 1391 1392 p[0] = mtab_ent->flags; 1393 p[1] = mtab_ent->instance; 1394 p[2] = mtab_ent->fs_handle; 1395 1396 int i; 1397 for (i = 0; i < 3; ++i) { 1398 callid = async_get_call(&data); 1399 if (IPC_GET_IMETHOD(data) != VFS_IN_PING) { 1400 rc = ENOTSUP; 1401 async_answer_1(callid, rc, 0); 1402 goto exit; 1403 } 1404 async_answer_1(callid, EOK, p[i]); 1405 } 1406 1407 rc = EOK; 1408 } 1409 1410 exit: 1411 fibril_mutex_unlock(&mtab_list_lock); 1412 async_answer_0(rid, rc); 1413 } 1414 1322 1415 /** 1323 1416 * @}
Note:
See TracChangeset
for help on using the changeset viewer.