Changeset 34ca870 in mainline for uspace/srv/vfs/vfs_ops.c


Ignore:
Timestamp:
2009-06-17T21:07:56Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6ebe721
Parents:
61d2315
Message:

Handle each VFS request using a dedicated connection.

File:
1 edited

Legend:

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

    r61d2315 r34ca870  
    144144                            str_size(opts));
    145145                        if (rc != EOK) {
     146                                async_wait_for(msg, NULL);
    146147                                vfs_release_phone(phone);
    147                                 async_wait_for(msg, NULL);
    148148                                fibril_rwlock_write_unlock(&namespace_rwlock);
    149149                                ipc_answer_0(rid, rc);
    150150                                return;
    151151                        }
     152                        async_wait_for(msg, &rc);
    152153                        vfs_release_phone(phone);
    153                         async_wait_for(msg, &rc);
    154154                       
    155155                        if (rc != EOK) {
     
    198198        int mountee_phone = vfs_grab_phone(fs_handle);
    199199        assert(mountee_phone >= 0);
    200         vfs_release_phone(mountee_phone);
    201200
    202201        phone = vfs_grab_phone(mp_res.triplet.fs_handle);
     
    210209        rc = async_req_1_0(phone, IPC_M_CONNECTION_CLONE, mountee_phone);
    211210        if (rc != EOK) {
     211                async_wait_for(msg, NULL);
     212                vfs_release_phone(mountee_phone);
    212213                vfs_release_phone(phone);
    213                 async_wait_for(msg, NULL);
    214214                /* Mount failed, drop reference to mp_node. */
    215215                if (mp_node)
     
    219219                return;
    220220        }
     221
     222        vfs_release_phone(mountee_phone);
    221223       
    222224        /* send the mount options */
    223225        rc = ipc_data_write_start(phone, (void *)opts, str_size(opts));
    224226        if (rc != EOK) {
     227                async_wait_for(msg, NULL);
    225228                vfs_release_phone(phone);
    226                 async_wait_for(msg, NULL);
    227229                /* Mount failed, drop reference to mp_node. */
    228230                if (mp_node)
     
    232234                return;
    233235        }
     236        async_wait_for(msg, &rc);
    234237        vfs_release_phone(phone);
    235         async_wait_for(msg, &rc);
    236238       
    237239        if (rc == EOK) {
     
    756758        msg = async_send_2(fs_phone, IPC_GET_METHOD(*request),
    757759            file->node->dev_handle, file->node->index, &answer);
    758        
    759         vfs_release_phone(fs_phone);
    760760
    761761        /* Wait for reply from the FS server. */
    762762        ipcarg_t rc;
    763763        async_wait_for(msg, &rc);
    764        
     764
     765        vfs_release_phone(fs_phone);
    765766        fibril_mutex_unlock(&file->lock);
    766767       
     
    792793            file->node->dev_handle, file->node->index, &answer);
    793794
    794         vfs_release_phone(fs_phone);
    795 
    796795        /* Wait for reply from the FS server. */
    797796        ipcarg_t rc;
    798797        async_wait_for(msg, &rc);
    799798       
     799        vfs_release_phone(fs_phone);
    800800        fibril_mutex_unlock(&file->lock);
    801801       
     
    819819         */
    820820        fibril_mutex_lock(&file->lock);
    821        
    822821        int fs_phone = vfs_grab_phone(file->node->fs_handle);
    823822       
     
    828827            file->node->dev_handle, file->node->index, &answer);
    829828
    830         vfs_release_phone(fs_phone);
    831        
    832829        /* Wait for reply from the FS server. */
    833830        ipcarg_t rc;
    834831        async_wait_for(msg, &rc);
    835        
     832
     833        vfs_release_phone(fs_phone);
    836834        fibril_mutex_unlock(&file->lock);
    837835       
     
    924922        ipc_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
    925923
    926         vfs_release_phone(fs_phone);
    927        
    928924        /* Wait for reply from the FS server. */
    929925        ipcarg_t rc;
    930926        async_wait_for(msg, &rc);
     927       
     928        vfs_release_phone(fs_phone);
    931929       
    932930        size_t bytes = IPC_GET_ARG1(answer);
Note: See TracChangeset for help on using the changeset viewer.