Changeset 9dc6083 in mainline for uspace/srv/vfs/vfs_ops.c
- Timestamp:
- 2013-07-06T15:53:01Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 11baebb
- Parents:
- 66366470
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_ops.c
r66366470 r9dc6083 1420 1420 void vfs_statfs(ipc_callid_t rid, ipc_call_t *request) 1421 1421 { 1422 long long reply; 1423 1424 /* Get information about fs */ 1425 reply = 512; 1426 async_answer_1(rid, EOK, reply); 1422 char *path; 1423 int rc = async_data_write_accept((void **) &path, true, 0, 0, 0, NULL); 1424 if (rc != EOK) { 1425 async_answer_0(rid, rc); 1426 return; 1427 } 1428 1429 ipc_callid_t callid; 1430 if (!async_data_read_receive(&callid, NULL)) { 1431 free(path); 1432 async_answer_0(callid, EINVAL); 1433 async_answer_0(rid, EINVAL); 1434 return; 1435 } 1436 1437 vfs_lookup_res_t lr; 1438 fibril_rwlock_read_lock(&namespace_rwlock); 1439 rc = vfs_lookup_internal(path, L_NONE, &lr, NULL); 1440 free(path); 1441 if (rc != EOK) { 1442 fibril_rwlock_read_unlock(&namespace_rwlock); 1443 async_answer_0(callid, rc); 1444 async_answer_0(rid, rc); 1445 return; 1446 } 1447 vfs_node_t *node = vfs_node_get(&lr); 1448 if (!node) { 1449 fibril_rwlock_read_unlock(&namespace_rwlock); 1450 async_answer_0(callid, ENOMEM); 1451 async_answer_0(rid, ENOMEM); 1452 return; 1453 } 1454 1455 fibril_rwlock_read_unlock(&namespace_rwlock); 1456 1457 async_exch_t *exch = vfs_exchange_grab(node->fs_handle); 1458 1459 aid_t msg; 1460 msg = async_send_3(exch, VFS_OUT_STATFS, node->service_id, 1461 node->index, false, NULL); 1462 async_forward_fast(callid, exch, 0, 0, 0, IPC_FF_ROUTE_FROM_ME); 1463 1464 vfs_exchange_release(exch); 1465 1466 sysarg_t rv; 1467 async_wait_for(msg, &rv); 1468 1469 async_answer_0(rid, rv); 1470 1471 vfs_node_put(node); 1427 1472 } 1428 1473
Note:
See TracChangeset
for help on using the changeset viewer.