Changeset 12fc042 in mainline


Ignore:
Timestamp:
2008-08-09T09:45:02Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
11c2ae5
Parents:
c544c5d
Message:

Fix the VFS protocol so that the client can determine that VFS_MOUNT failed due
to a request to mount an unregistered file system.

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/vfs/vfs.c

    rc544c5d r12fc042  
    173173                return (int) rc;
    174174        }
     175        /* Ask VFS whether it likes fs_name. */
     176        rc = async_req_0_0(vfs_phone, IPC_M_PING);
     177        if (rc != EOK) {
     178                async_wait_for(req, NULL);
     179                async_serialize_end();
     180                futex_up(&vfs_phone_futex);
     181                free(mpa);
     182                return (int) rc;
     183        }
    175184        rc = ipc_data_write_start(vfs_phone, (void *)mpa, mpa_len);
    176185        if (rc != EOK) {
  • uspace/srv/vfs/vfs_ops.c

    rc544c5d r12fc042  
    7272        dev_handle_t dev_handle;
    7373        vfs_node_t *mp_node = NULL;
     74        ipc_callid_t callid;
     75        ipc_call_t data;
    7476        int rc;
    7577        int phone;
     78        size_t size;
    7679
    7780        /*
     
    8689         * carry mount options in the future.
    8790         */
    88 
    89         ipc_callid_t callid;
    90         size_t size;
    9191
    9292        /*
     
    116116       
    117117        /*
     118         * Wait for IPC_M_PING so that we can return an error if we don't know
     119         * fs_name.
     120         */
     121        callid = async_get_call(&data);
     122        if (IPC_GET_METHOD(data) != IPC_M_PING) {
     123                ipc_answer_0(callid, ENOTSUP);
     124                ipc_answer_0(rid, ENOTSUP);
     125                return;
     126        }
     127
     128        /*
    118129         * Check if we know a file system with the same name as is in fs_name.
    119130         * This will also give us its file system handle.
     
    121132        fs_handle_t fs_handle = fs_name_to_handle(fs_name, true);
    122133        if (!fs_handle) {
     134                ipc_answer_0(callid, ENOENT);
    123135                ipc_answer_0(rid, ENOENT);
    124136                return;
    125137        }
     138
     139        /* Acknowledge that we know fs_name. */
     140        ipc_answer_0(callid, EOK);
    126141
    127142        /* Now, we want the client to send us the mount point. */
Note: See TracChangeset for help on using the changeset viewer.