Changeset b4cbef1 in mainline for uspace/lib/libfs/libfs.c


Ignore:
Timestamp:
2010-02-03T16:52:37Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3b3e776, eda925a
Parents:
472c09d
Message:

add minimal data size check into async_data_receive
introduce more convenience wrappers for common IPC patterns:

async_data_read_forward_fast
async_data_void
async_data_forward_fast

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libfs/libfs.c

    r472c09d rb4cbef1  
    161161        /* Accept the phone */
    162162        callid = async_get_call(&call);
    163         int mountee_phone = (int)IPC_GET_ARG1(call);
     163        int mountee_phone = (int) IPC_GET_ARG1(call);
    164164        if ((IPC_GET_METHOD(call) != IPC_M_CONNECTION_CLONE) ||
    165165            (mountee_phone < 0)) {
     
    172172        ipc_answer_0(callid, EOK);
    173173       
    174         res = async_data_write_receive(&callid, NULL);
    175         if (!res) {
    176                 ipc_hangup(mountee_phone);
    177                 ipc_answer_0(callid, EINVAL);
    178                 ipc_answer_0(rid, EINVAL);
    179                 return;
    180         }
    181        
    182174        fs_node_t *fn;
    183175        res = ops->node_get(&fn, mp_dev_handle, mp_fs_index);
    184176        if ((res != EOK) || (!fn)) {
    185177                ipc_hangup(mountee_phone);
    186                 ipc_answer_0(callid, combine_rc(res, ENOENT));
     178                async_data_void(combine_rc(res, ENOENT));
    187179                ipc_answer_0(rid, combine_rc(res, ENOENT));
    188180                return;
     
    192184                ipc_hangup(mountee_phone);
    193185                (void) ops->node_put(fn);
    194                 ipc_answer_0(callid, EBUSY);
     186                async_data_void(EBUSY);
    195187                ipc_answer_0(rid, EBUSY);
    196188                return;
     
    201193                ipc_hangup(mountee_phone);
    202194                (void) ops->node_put(fn);
    203                 ipc_answer_0(callid, rc);
     195                async_data_void(rc);
    204196                ipc_answer_0(rid, rc);
    205197                return;
     
    207199       
    208200        ipc_call_t answer;
    209         aid_t msg = async_send_1(mountee_phone, VFS_OUT_MOUNTED, mr_dev_handle,
     201        rc = async_data_forward_1_1(mountee_phone, VFS_OUT_MOUNTED, mr_dev_handle,
    210202            &answer);
    211         ipc_forward_fast(callid, mountee_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
    212         async_wait_for(msg, &rc);
    213203       
    214204        if (rc == EOK) {
Note: See TracChangeset for help on using the changeset viewer.