Changeset 758f8d5 in mainline for uspace/srv/vfs/vfs_ops.c


Ignore:
Timestamp:
2013-09-11T21:53:36Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e1ec5a2
Parents:
1e371cf (diff), 9dbdda9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge the df branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs_ops.c

    r1e371cf r758f8d5  
    14121412}
    14131413
     1414void vfs_statfs(ipc_callid_t rid, ipc_call_t *request)
     1415{
     1416        char *path;
     1417        int rc = async_data_write_accept((void **) &path, true, 0, 0, 0, NULL);
     1418        if (rc != EOK) {
     1419                async_answer_0(rid, rc);
     1420                return;
     1421        }
     1422       
     1423        ipc_callid_t callid;
     1424        if (!async_data_read_receive(&callid, NULL)) {
     1425                free(path);
     1426                async_answer_0(callid, EINVAL);
     1427                async_answer_0(rid, EINVAL);
     1428                return;
     1429        }
     1430
     1431        vfs_lookup_res_t lr;
     1432        fibril_rwlock_read_lock(&namespace_rwlock);
     1433        rc = vfs_lookup_internal(path, L_NONE, &lr, NULL);
     1434        free(path);
     1435        if (rc != EOK) {
     1436                fibril_rwlock_read_unlock(&namespace_rwlock);
     1437                async_answer_0(callid, rc);
     1438                async_answer_0(rid, rc);
     1439                return;
     1440        }
     1441        vfs_node_t *node = vfs_node_get(&lr);
     1442        if (!node) {
     1443                fibril_rwlock_read_unlock(&namespace_rwlock);
     1444                async_answer_0(callid, ENOMEM);
     1445                async_answer_0(rid, ENOMEM);
     1446                return;
     1447        }
     1448
     1449        fibril_rwlock_read_unlock(&namespace_rwlock);
     1450
     1451        async_exch_t *exch = vfs_exchange_grab(node->fs_handle);
     1452       
     1453        aid_t msg;
     1454        msg = async_send_3(exch, VFS_OUT_STATFS, node->service_id,
     1455            node->index, false, NULL);
     1456        async_forward_fast(callid, exch, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
     1457       
     1458        vfs_exchange_release(exch);
     1459       
     1460        sysarg_t rv;
     1461        async_wait_for(msg, &rv);
     1462
     1463        async_answer_0(rid, rv);
     1464
     1465        vfs_node_put(node);
     1466}
     1467
    14141468/**
    14151469 * @}
Note: See TracChangeset for help on using the changeset viewer.