Changeset 0c2d9bb in mainline for uspace/srv/vfs/vfs_ops.c


Ignore:
Timestamp:
2013-12-25T22:54:29Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b51cf2c
Parents:
f7a33de (diff), ac36aed (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 mainline changes

File:
1 edited

Legend:

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

    rf7a33de r0c2d9bb  
    548548        int found = 0;
    549549
    550         list_foreach(mtab_list, cur) {
    551                 mtab_ent_t *mtab_ent = list_get_instance(cur, mtab_ent_t,
    552                     link);
    553 
     550        list_foreach(mtab_list, link, mtab_ent_t, mtab_ent) {
    554551                if (str_cmp(mtab_ent->mp, mp) == 0) {
    555552                        list_remove(&mtab_ent->link);
     
    13711368        async_answer_1(callid, EOK, mtab_size);
    13721369
    1373         list_foreach(mtab_list, cur) {
    1374                 mtab_ent_t *mtab_ent = list_get_instance(cur, mtab_ent_t,
    1375                     link);
    1376 
     1370        list_foreach(mtab_list, link, mtab_ent_t, mtab_ent) {
    13771371                rc = ENOTSUP;
    13781372
     
    14181412}
    14191413
     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
    14201468/**
    14211469 * @}
Note: See TracChangeset for help on using the changeset viewer.