Changeset cf2af94 in mainline for uspace/srv/fs


Ignore:
Timestamp:
2011-02-09T11:46:47Z (15 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
Children:
cb15135a
Parents:
a49c4002 (diff), 0b37882 (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

Local modifications:

  • change pipefs and ext2 to build again (use async_* calls instead of ipc_*)
Location:
uspace/srv/fs
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/devfs/devfs.c

    ra49c4002 rcf2af94  
    4040
    4141#include <stdio.h>
    42 #include <ipc/ipc.h>
    4342#include <ipc/services.h>
     43#include <ipc/ns.h>
    4444#include <async.h>
    4545#include <errno.h>
     
    5353static vfs_info_t devfs_vfs_info = {
    5454        .name = NAME,
     55        .concurrent_read_write = false,
     56        .write_retains_size = false,
    5557};
    5658
     
    6062{
    6163        if (iid)
    62                 ipc_answer_0(iid, EOK);
     64                async_answer_0(iid, EOK);
    6365       
    6466        while (true) {
     
    6668                ipc_callid_t callid = async_get_call(&call);
    6769               
    68                 switch  (IPC_GET_METHOD(call)) {
     70                switch  (IPC_GET_IMETHOD(call)) {
    6971                case IPC_M_PHONE_HUNGUP:
    7072                        return;
     
    109111                        break;
    110112                default:
    111                         ipc_answer_0(callid, ENOTSUP);
     113                        async_answer_0(callid, ENOTSUP);
    112114                        break;
    113115                }
     
    124126        }
    125127       
    126         int vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0);
     128        int vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
    127129        if (vfs_phone < EOK) {
    128130                printf(NAME ": Unable to connect to VFS\n");
  • uspace/srv/fs/devfs/devfs_ops.c

    ra49c4002 rcf2af94  
    3636 */
    3737
    38 #include <ipc/ipc.h>
    3938#include <macros.h>
    4039#include <bool.h>
     
    6059typedef struct {
    6160        devmap_handle_t handle;
    62         int phone;
     61        int phone;              /**< When < 0, the structure is incomplete. */
    6362        size_t refcount;
    6463        link_t link;
     64        fibril_condvar_t cv;    /**< Broadcast when completed. */
    6565} device_t;
    6666
     
    130130{
    131131        devfs_node_t *node = (devfs_node_t *) pfn->data;
     132        int ret;
    132133       
    133134        if (node->handle == 0) {
     
    145146                               
    146147                                if (str_cmp(devs[pos].name, component) == 0) {
     148                                        ret = devfs_node_get_internal(rfn, DEV_HANDLE_NAMESPACE, devs[pos].handle);
    147149                                        free(devs);
    148                                         return devfs_node_get_internal(rfn, DEV_HANDLE_NAMESPACE, devs[pos].handle);
     150                                        return ret;
    149151                                }
    150152                        }
     
    162164                                for (pos = 0; pos < count; pos++) {
    163165                                        if (str_cmp(devs[pos].name, component) == 0) {
     166                                                ret = devfs_node_get_internal(rfn, DEV_HANDLE_DEVICE, devs[pos].handle);
    164167                                                free(devs);
    165                                                 return devfs_node_get_internal(rfn, DEV_HANDLE_DEVICE, devs[pos].handle);
     168                                                return ret;
    166169                                        }
    167170                                }
     
    184187                        for (pos = 0; pos < count; pos++) {
    185188                                if (str_cmp(devs[pos].name, component) == 0) {
     189                                        ret = devfs_node_get_internal(rfn, DEV_HANDLE_DEVICE, devs[pos].handle);
    186190                                        free(devs);
    187                                         return devfs_node_get_internal(rfn, DEV_HANDLE_DEVICE, devs[pos].handle);
     191                                        return ret;
    188192                                }
    189193                        }
     
    227231                        [DEVICES_KEY_HANDLE] = (unsigned long) node->handle
    228232                };
    229                
     233                link_t *lnk;
     234
    230235                fibril_mutex_lock(&devices_mutex);
    231                 link_t *lnk = hash_table_find(&devices, key);
     236restart:
     237                lnk = hash_table_find(&devices, key);
    232238                if (lnk == NULL) {
    233239                        device_t *dev = (device_t *) malloc(sizeof(device_t));
     
    237243                        }
    238244                       
     245                        dev->handle = node->handle;
     246                        dev->phone = -1;        /* mark as incomplete */
     247                        dev->refcount = 1;
     248                        fibril_condvar_initialize(&dev->cv);
     249
     250                        /*
     251                         * Insert the incomplete device structure so that other
     252                         * fibrils will not race with us when we drop the mutex
     253                         * below.
     254                         */
     255                        hash_table_insert(&devices, key, &dev->link);
     256
     257                        /*
     258                         * Drop the mutex to allow recursive devfs requests.
     259                         */
     260                        fibril_mutex_unlock(&devices_mutex);
     261
    239262                        int phone = devmap_device_connect(node->handle, 0);
     263
     264                        fibril_mutex_lock(&devices_mutex);
     265
     266                        /*
     267                         * Notify possible waiters about this device structure
     268                         * being completed (or destroyed).
     269                         */
     270                        fibril_condvar_broadcast(&dev->cv);
     271
    240272                        if (phone < 0) {
     273                                /*
     274                                 * Connecting failed, need to remove the
     275                                 * entry and free the device structure.
     276                                 */
     277                                hash_table_remove(&devices, key, DEVICES_KEYS);
    241278                                fibril_mutex_unlock(&devices_mutex);
     279
    242280                                free(dev);
    243281                                return ENOENT;
    244282                        }
    245283                       
    246                         dev->handle = node->handle;
     284                        /* Set the correct phone. */
    247285                        dev->phone = phone;
    248                         dev->refcount = 1;
    249                        
    250                         hash_table_insert(&devices, key, &dev->link);
    251286                } else {
    252287                        device_t *dev = hash_table_get_instance(lnk, device_t, link);
     288
     289                        if (dev->phone < 0) {
     290                                /*
     291                                 * Wait until the device structure is completed
     292                                 * and start from the beginning as the device
     293                                 * structure might have entirely disappeared
     294                                 * while we were not holding the mutex in
     295                                 * fibril_condvar_wait().
     296                                 */
     297                                fibril_condvar_wait(&dev->cv, &devices_mutex);
     298                                goto restart;
     299                        }
     300
    253301                        dev->refcount++;
    254302                }
     
    409457                return false;
    410458       
    411         if (devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING) < 0)
    412                 return false;
    413        
    414459        return true;
    415460}
     
    420465       
    421466        /* Accept the mount options */
    422         ipcarg_t retval = async_data_write_accept((void **) &opts, true, 0, 0,
     467        sysarg_t retval = async_data_write_accept((void **) &opts, true, 0, 0,
    423468            0, NULL);
    424469        if (retval != EOK) {
    425                 ipc_answer_0(rid, retval);
     470                async_answer_0(rid, retval);
    426471                return;
    427472        }
    428473       
    429474        free(opts);
    430         ipc_answer_3(rid, EOK, 0, 0, 0);
     475        async_answer_3(rid, EOK, 0, 0, 0);
    431476}
    432477
     
    438483void devfs_unmounted(ipc_callid_t rid, ipc_call_t *request)
    439484{
    440         ipc_answer_0(rid, ENOTSUP);
     485        async_answer_0(rid, ENOTSUP);
    441486}
    442487
     
    471516                size_t size;
    472517                if (!async_data_read_receive(&callid, &size)) {
    473                         ipc_answer_0(callid, EINVAL);
    474                         ipc_answer_0(rid, EINVAL);
     518                        async_answer_0(callid, EINVAL);
     519                        async_answer_0(rid, EINVAL);
    475520                        return;
    476521                }
     
    493538                        async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
    494539                        free(desc);
    495                         ipc_answer_1(rid, EOK, 1);
     540                        async_answer_1(rid, EOK, 1);
    496541                        return;
    497542                }
     
    508553                                async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
    509554                                free(desc);
    510                                 ipc_answer_1(rid, EOK, 1);
     555                                async_answer_1(rid, EOK, 1);
    511556                                return;
    512557                        }
     
    515560                }
    516561               
    517                 ipc_answer_0(callid, ENOENT);
    518                 ipc_answer_1(rid, ENOENT, 0);
     562                async_answer_0(callid, ENOENT);
     563                async_answer_1(rid, ENOENT, 0);
    519564                return;
    520565        }
     
    527572                size_t size;
    528573                if (!async_data_read_receive(&callid, &size)) {
    529                         ipc_answer_0(callid, EINVAL);
    530                         ipc_answer_0(rid, EINVAL);
     574                        async_answer_0(callid, EINVAL);
     575                        async_answer_0(rid, EINVAL);
    531576                        return;
    532577                }
     
    538583                        async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
    539584                        free(desc);
    540                         ipc_answer_1(rid, EOK, 1);
     585                        async_answer_1(rid, EOK, 1);
    541586                        return;
    542587                }
    543588               
    544589                free(desc);
    545                 ipc_answer_0(callid, ENOENT);
    546                 ipc_answer_1(rid, ENOENT, 0);
     590                async_answer_0(callid, ENOENT);
     591                async_answer_1(rid, ENOENT, 0);
    547592                return;
    548593        }
     
    559604                if (lnk == NULL) {
    560605                        fibril_mutex_unlock(&devices_mutex);
    561                         ipc_answer_0(rid, ENOENT);
     606                        async_answer_0(rid, ENOENT);
    562607                        return;
    563608                }
    564609               
    565610                device_t *dev = hash_table_get_instance(lnk, device_t, link);
     611                assert(dev->phone >= 0);
    566612               
    567613                ipc_callid_t callid;
    568614                if (!async_data_read_receive(&callid, NULL)) {
    569615                        fibril_mutex_unlock(&devices_mutex);
    570                         ipc_answer_0(callid, EINVAL);
    571                         ipc_answer_0(rid, EINVAL);
     616                        async_answer_0(callid, EINVAL);
     617                        async_answer_0(rid, EINVAL);
    572618                        return;
    573619                }
     
    575621                /* Make a request at the driver */
    576622                ipc_call_t answer;
    577                 aid_t msg = async_send_3(dev->phone, IPC_GET_METHOD(*request),
     623                aid_t msg = async_send_3(dev->phone, IPC_GET_IMETHOD(*request),
    578624                    IPC_GET_ARG1(*request), IPC_GET_ARG2(*request),
    579625                    IPC_GET_ARG3(*request), &answer);
    580626               
    581627                /* Forward the IPC_M_DATA_READ request to the driver */
    582                 ipc_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
     628                async_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
    583629                fibril_mutex_unlock(&devices_mutex);
    584630               
    585631                /* Wait for reply from the driver. */
    586                 ipcarg_t rc;
     632                sysarg_t rc;
    587633                async_wait_for(msg, &rc);
    588634                size_t bytes = IPC_GET_ARG1(answer);
    589635               
    590636                /* Driver reply is the final result of the whole operation */
    591                 ipc_answer_1(rid, rc, bytes);
    592                 return;
    593         }
    594        
    595         ipc_answer_0(rid, ENOENT);
     637                async_answer_1(rid, rc, bytes);
     638                return;
     639        }
     640       
     641        async_answer_0(rid, ENOENT);
    596642}
    597643
     
    600646        fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
    601647        if (index == 0) {
    602                 ipc_answer_0(rid, ENOTSUP);
     648                async_answer_0(rid, ENOTSUP);
    603649                return;
    604650        }
     
    608654        if (type == DEV_HANDLE_NAMESPACE) {
    609655                /* Namespace directory */
    610                 ipc_answer_0(rid, ENOTSUP);
     656                async_answer_0(rid, ENOTSUP);
    611657                return;
    612658        }
     
    622668                if (lnk == NULL) {
    623669                        fibril_mutex_unlock(&devices_mutex);
    624                         ipc_answer_0(rid, ENOENT);
     670                        async_answer_0(rid, ENOENT);
    625671                        return;
    626672                }
    627673               
    628674                device_t *dev = hash_table_get_instance(lnk, device_t, link);
     675                assert(dev->phone >= 0);
    629676               
    630677                ipc_callid_t callid;
    631678                if (!async_data_write_receive(&callid, NULL)) {
    632679                        fibril_mutex_unlock(&devices_mutex);
    633                         ipc_answer_0(callid, EINVAL);
    634                         ipc_answer_0(rid, EINVAL);
     680                        async_answer_0(callid, EINVAL);
     681                        async_answer_0(rid, EINVAL);
    635682                        return;
    636683                }
     
    638685                /* Make a request at the driver */
    639686                ipc_call_t answer;
    640                 aid_t msg = async_send_3(dev->phone, IPC_GET_METHOD(*request),
     687                aid_t msg = async_send_3(dev->phone, IPC_GET_IMETHOD(*request),
    641688                    IPC_GET_ARG1(*request), IPC_GET_ARG2(*request),
    642689                    IPC_GET_ARG3(*request), &answer);
    643690               
    644691                /* Forward the IPC_M_DATA_WRITE request to the driver */
    645                 ipc_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
     692                async_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
    646693               
    647694                fibril_mutex_unlock(&devices_mutex);
    648695               
    649696                /* Wait for reply from the driver. */
    650                 ipcarg_t rc;
     697                sysarg_t rc;
    651698                async_wait_for(msg, &rc);
    652699                size_t bytes = IPC_GET_ARG1(answer);
    653700               
    654701                /* Driver reply is the final result of the whole operation */
    655                 ipc_answer_1(rid, rc, bytes);
    656                 return;
    657         }
    658        
    659         ipc_answer_0(rid, ENOENT);
     702                async_answer_1(rid, rc, bytes);
     703                return;
     704        }
     705       
     706        async_answer_0(rid, ENOENT);
    660707}
    661708
    662709void devfs_truncate(ipc_callid_t rid, ipc_call_t *request)
    663710{
    664         ipc_answer_0(rid, ENOTSUP);
     711        async_answer_0(rid, ENOTSUP);
    665712}
    666713
     
    670717       
    671718        if (index == 0) {
    672                 ipc_answer_0(rid, EOK);
     719                async_answer_0(rid, EOK);
    673720                return;
    674721        }
     
    678725        if (type == DEV_HANDLE_NAMESPACE) {
    679726                /* Namespace directory */
    680                 ipc_answer_0(rid, EOK);
     727                async_answer_0(rid, EOK);
    681728                return;
    682729        }
     
    691738                if (lnk == NULL) {
    692739                        fibril_mutex_unlock(&devices_mutex);
    693                         ipc_answer_0(rid, ENOENT);
     740                        async_answer_0(rid, ENOENT);
    694741                        return;
    695742                }
    696743               
    697744                device_t *dev = hash_table_get_instance(lnk, device_t, link);
     745                assert(dev->phone >= 0);
    698746                dev->refcount--;
    699747               
    700748                if (dev->refcount == 0) {
    701                         ipc_hangup(dev->phone);
     749                        async_hangup(dev->phone);
    702750                        hash_table_remove(&devices, key, DEVICES_KEYS);
    703751                }
     
    705753                fibril_mutex_unlock(&devices_mutex);
    706754               
    707                 ipc_answer_0(rid, EOK);
    708                 return;
    709         }
    710        
    711         ipc_answer_0(rid, ENOENT);
     755                async_answer_0(rid, EOK);
     756                return;
     757        }
     758       
     759        async_answer_0(rid, ENOENT);
    712760}
    713761
     
    717765       
    718766        if (index == 0) {
    719                 ipc_answer_0(rid, EOK);
     767                async_answer_0(rid, EOK);
    720768                return;
    721769        }
     
    725773        if (type == DEV_HANDLE_NAMESPACE) {
    726774                /* Namespace directory */
    727                 ipc_answer_0(rid, EOK);
     775                async_answer_0(rid, EOK);
    728776                return;
    729777        }
     
    738786                if (lnk == NULL) {
    739787                        fibril_mutex_unlock(&devices_mutex);
    740                         ipc_answer_0(rid, ENOENT);
     788                        async_answer_0(rid, ENOENT);
    741789                        return;
    742790                }
    743791               
    744792                device_t *dev = hash_table_get_instance(lnk, device_t, link);
     793                assert(dev->phone >= 0);
    745794               
    746795                /* Make a request at the driver */
    747796                ipc_call_t answer;
    748                 aid_t msg = async_send_2(dev->phone, IPC_GET_METHOD(*request),
     797                aid_t msg = async_send_2(dev->phone, IPC_GET_IMETHOD(*request),
    749798                    IPC_GET_ARG1(*request), IPC_GET_ARG2(*request), &answer);
    750799               
     
    752801               
    753802                /* Wait for reply from the driver */
    754                 ipcarg_t rc;
     803                sysarg_t rc;
    755804                async_wait_for(msg, &rc);
    756805               
    757806                /* Driver reply is the final result of the whole operation */
    758                 ipc_answer_0(rid, rc);
    759                 return;
    760         }
    761        
    762         ipc_answer_0(rid, ENOENT);
     807                async_answer_0(rid, rc);
     808                return;
     809        }
     810       
     811        async_answer_0(rid, ENOENT);
    763812}
    764813
    765814void devfs_destroy(ipc_callid_t rid, ipc_call_t *request)
    766815{
    767         ipc_answer_0(rid, ENOTSUP);
     816        async_answer_0(rid, ENOTSUP);
    768817}
    769818
  • uspace/srv/fs/devfs/devfs_ops.h

    ra49c4002 rcf2af94  
    3434#define DEVFS_DEVFS_OPS_H_
    3535
    36 #include <ipc/ipc.h>
     36#include <ipc/common.h>
    3737#include <bool.h>
    3838
  • uspace/srv/fs/ext2/ext2.c

    ra49c4002 rcf2af94  
    3838
    3939#include "ext2.h"
    40 #include <ipc/ipc.h>
    4140#include <ipc/services.h>
     41#include <ipc/ns.h>
    4242#include <async.h>
    4343#include <errno.h>
     
    8282                 * created by IPC_M_CONNECT_TO_ME.
    8383                 */
    84                 ipc_answer_0(iid, EOK);
     84                async_answer_0(iid, EOK);
    8585        }
    8686       
     
    9191       
    9292                callid = async_get_call(&call);
    93                 switch  (IPC_GET_METHOD(call)) {
     93                switch  (IPC_GET_IMETHOD(call)) {
    9494                case IPC_M_PHONE_HUNGUP:
    9595                        return;
     
    134134                        break;
    135135                default:
    136                         ipc_answer_0(callid, ENOTSUP);
     136                        async_answer_0(callid, ENOTSUP);
    137137                        break;
    138138                }
     
    147147        printf(NAME ": HelenOS EXT2 file system server\n");
    148148
    149         vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0);
     149        vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
    150150        if (vfs_phone < EOK) {
    151151                printf(NAME ": failed to connect to VFS\n");
  • uspace/srv/fs/ext2/ext2.h

    ra49c4002 rcf2af94  
    3535
    3636#include <libext2.h>
    37 #include <ipc/ipc.h>
    3837#include <fibril_synch.h>
    3938#include <libfs.h>
  • uspace/srv/fs/ext2/ext2_ops.c

    ra49c4002 rcf2af94  
    4141#include <libblock.h>
    4242#include <libext2.h>
    43 #include <ipc/ipc.h>
    4443#include <ipc/services.h>
    4544#include <ipc/devmap.h>
     
    219218//      devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
    220219        // TODO
    221         ipc_answer_0(rid, ENOTSUP);
     220        async_answer_0(rid, ENOTSUP);
    222221}
    223222
     
    231230//      devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
    232231        // TODO
    233         ipc_answer_0(rid, ENOTSUP);
     232        async_answer_0(rid, ENOTSUP);
    234233}
    235234
     
    252251       
    253252        // TODO
    254         ipc_answer_0(rid, ENOTSUP);
     253        async_answer_0(rid, ENOTSUP);
    255254}
    256255
     
    263262       
    264263        // TODO
    265         ipc_answer_0(rid, ENOTSUP);
     264        async_answer_0(rid, ENOTSUP);
    266265}
    267266
     
    274273       
    275274        // TODO
    276         ipc_answer_0(rid, ENOTSUP);
     275        async_answer_0(rid, ENOTSUP);
    277276}
    278277
    279278void ext2_close(ipc_callid_t rid, ipc_call_t *request)
    280279{
    281         ipc_answer_0(rid, EOK);
     280        async_answer_0(rid, EOK);
    282281}
    283282
     
    288287       
    289288        // TODO
    290         ipc_answer_0(rid, ENOTSUP);
     289        async_answer_0(rid, ENOTSUP);
    291290}
    292291
     
    307306       
    308307        // TODO
    309         ipc_answer_0(rid, ENOTSUP);
     308        async_answer_0(rid, ENOTSUP);
    310309}
    311310
  • uspace/srv/fs/fat/fat.c

    ra49c4002 rcf2af94  
    3838
    3939#include "fat.h"
    40 #include <ipc/ipc.h>
    4140#include <ipc/services.h>
     41#include <ipc/ns.h>
    4242#include <async.h>
    4343#include <errno.h>
     
    5252vfs_info_t fat_vfs_info = {
    5353        .name = NAME,
     54        .concurrent_read_write = false,
     55        .write_retains_size = false,   
    5456};
    5557
     
    8284                 * created by IPC_M_CONNECT_TO_ME.
    8385                 */
    84                 ipc_answer_0(iid, EOK);
     86                async_answer_0(iid, EOK);
    8587        }
    8688       
     
    9193       
    9294                callid = async_get_call(&call);
    93                 switch  (IPC_GET_METHOD(call)) {
     95                switch  (IPC_GET_IMETHOD(call)) {
    9496                case IPC_M_PHONE_HUNGUP:
    9597                        return;
     
    134136                        break;
    135137                default:
    136                         ipc_answer_0(callid, ENOTSUP);
     138                        async_answer_0(callid, ENOTSUP);
    137139                        break;
    138140                }
     
    151153                goto err;
    152154
    153         vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0);
     155        vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
    154156        if (vfs_phone < EOK) {
    155157                printf(NAME ": failed to connect to VFS\n");
  • uspace/srv/fs/fat/fat.h

    ra49c4002 rcf2af94  
    3535
    3636#include "fat_fat.h"
    37 #include <ipc/ipc.h>
    3837#include <fibril_synch.h>
    3938#include <libfs.h>
  • uspace/srv/fs/fat/fat_ops.c

    ra49c4002 rcf2af94  
    4242#include <libfs.h>
    4343#include <libblock.h>
    44 #include <ipc/ipc.h>
    4544#include <ipc/services.h>
    4645#include <ipc/devmap.h>
     
    955954       
    956955        if (rc != EOK) {
    957                 ipc_answer_0(rid, rc);
     956                async_answer_0(rid, rc);
    958957                return;
    959958        }
     
    970969        rc = block_init(devmap_handle, BS_SIZE);
    971970        if (rc != EOK) {
    972                 ipc_answer_0(rid, rc);
     971                async_answer_0(rid, rc);
    973972                return;
    974973        }
     
    978977        if (rc != EOK) {
    979978                block_fini(devmap_handle);
    980                 ipc_answer_0(rid, rc);
     979                async_answer_0(rid, rc);
    981980                return;
    982981        }
     
    987986        if (BPS(bs) != BS_SIZE) {
    988987                block_fini(devmap_handle);
    989                 ipc_answer_0(rid, ENOTSUP);
     988                async_answer_0(rid, ENOTSUP);
    990989                return;
    991990        }
     
    995994        if (rc != EOK) {
    996995                block_fini(devmap_handle);
    997                 ipc_answer_0(rid, rc);
     996                async_answer_0(rid, rc);
    998997                return;
    999998        }
     
    10041003                (void) block_cache_fini(devmap_handle);
    10051004                block_fini(devmap_handle);
    1006                 ipc_answer_0(rid, rc);
     1005                async_answer_0(rid, rc);
    10071006                return;
    10081007        }
     
    10121011                (void) block_cache_fini(devmap_handle);
    10131012                block_fini(devmap_handle);
    1014                 ipc_answer_0(rid, rc);
     1013                async_answer_0(rid, rc);
    10151014                return;
    10161015        }
     
    10221021                block_fini(devmap_handle);
    10231022                fat_idx_fini_by_devmap_handle(devmap_handle);
    1024                 ipc_answer_0(rid, ENOMEM);
     1023                async_answer_0(rid, ENOMEM);
    10251024                return;
    10261025        }
     
    10321031                block_fini(devmap_handle);
    10331032                fat_idx_fini_by_devmap_handle(devmap_handle);
    1034                 ipc_answer_0(rid, ENOMEM);
     1033                async_answer_0(rid, ENOMEM);
    10351034                return;
    10361035        }
     
    10441043                block_fini(devmap_handle);
    10451044                fat_idx_fini_by_devmap_handle(devmap_handle);
    1046                 ipc_answer_0(rid, ENOMEM);
     1045                async_answer_0(rid, ENOMEM);
    10471046                return;
    10481047        }
     
    10621061        fibril_mutex_unlock(&ridxp->lock);
    10631062
    1064         ipc_answer_3(rid, EOK, ridxp->index, rootp->size, rootp->lnkcnt);
     1063        async_answer_3(rid, EOK, ridxp->index, rootp->size, rootp->lnkcnt);
    10651064}
    10661065
     
    10791078        rc = fat_root_get(&fn, devmap_handle);
    10801079        if (rc != EOK) {
    1081                 ipc_answer_0(rid, rc);
     1080                async_answer_0(rid, rc);
    10821081                return;
    10831082        }
     
    10901089        if (nodep->refcnt != 2) {
    10911090                (void) fat_node_put(fn);
    1092                 ipc_answer_0(rid, EBUSY);
     1091                async_answer_0(rid, EBUSY);
    10931092                return;
    10941093        }
     
    11101109        block_fini(devmap_handle);
    11111110
    1112         ipc_answer_0(rid, EOK);
     1111        async_answer_0(rid, EOK);
    11131112}
    11141113
     
    11381137        rc = fat_node_get(&fn, devmap_handle, index);
    11391138        if (rc != EOK) {
    1140                 ipc_answer_0(rid, rc);
     1139                async_answer_0(rid, rc);
    11411140                return;
    11421141        }
    11431142        if (!fn) {
    1144                 ipc_answer_0(rid, ENOENT);
     1143                async_answer_0(rid, ENOENT);
    11451144                return;
    11461145        }
     
    11511150        if (!async_data_read_receive(&callid, &len)) {
    11521151                fat_node_put(fn);
    1153                 ipc_answer_0(callid, EINVAL);
    1154                 ipc_answer_0(rid, EINVAL);
     1152                async_answer_0(callid, EINVAL);
     1153                async_answer_0(rid, EINVAL);
    11551154                return;
    11561155        }
     
    11751174                        if (rc != EOK) {
    11761175                                fat_node_put(fn);
    1177                                 ipc_answer_0(callid, rc);
    1178                                 ipc_answer_0(rid, rc);
     1176                                async_answer_0(callid, rc);
     1177                                async_answer_0(rid, rc);
    11791178                                return;
    11801179                        }
     
    11841183                        if (rc != EOK) {
    11851184                                fat_node_put(fn);
    1186                                 ipc_answer_0(rid, rc);
     1185                                async_answer_0(rid, rc);
    11871186                                return;
    11881187                        }
     
    12411240miss:
    12421241                rc = fat_node_put(fn);
    1243                 ipc_answer_0(callid, rc != EOK ? rc : ENOENT);
    1244                 ipc_answer_1(rid, rc != EOK ? rc : ENOENT, 0);
     1242                async_answer_0(callid, rc != EOK ? rc : ENOENT);
     1243                async_answer_1(rid, rc != EOK ? rc : ENOENT, 0);
    12451244                return;
    12461245
    12471246err:
    12481247                (void) fat_node_put(fn);
    1249                 ipc_answer_0(callid, rc);
    1250                 ipc_answer_0(rid, rc);
     1248                async_answer_0(callid, rc);
     1249                async_answer_0(rid, rc);
    12511250                return;
    12521251
     
    12571256
    12581257        rc = fat_node_put(fn);
    1259         ipc_answer_1(rid, rc, (ipcarg_t)bytes);
     1258        async_answer_1(rid, rc, (sysarg_t)bytes);
    12601259}
    12611260
     
    12771276        rc = fat_node_get(&fn, devmap_handle, index);
    12781277        if (rc != EOK) {
    1279                 ipc_answer_0(rid, rc);
     1278                async_answer_0(rid, rc);
    12801279                return;
    12811280        }
    12821281        if (!fn) {
    1283                 ipc_answer_0(rid, ENOENT);
     1282                async_answer_0(rid, ENOENT);
    12841283                return;
    12851284        }
     
    12901289        if (!async_data_write_receive(&callid, &len)) {
    12911290                (void) fat_node_put(fn);
    1292                 ipc_answer_0(callid, EINVAL);
    1293                 ipc_answer_0(rid, EINVAL);
     1291                async_answer_0(callid, EINVAL);
     1292                async_answer_0(rid, EINVAL);
    12941293                return;
    12951294        }
     
    13191318                if (rc != EOK) {
    13201319                        (void) fat_node_put(fn);
    1321                         ipc_answer_0(callid, rc);
    1322                         ipc_answer_0(rid, rc);
     1320                        async_answer_0(callid, rc);
     1321                        async_answer_0(rid, rc);
    13231322                        return;
    13241323                }
     
    13261325                if (rc != EOK) {
    13271326                        (void) fat_node_put(fn);
    1328                         ipc_answer_0(callid, rc);
    1329                         ipc_answer_0(rid, rc);
     1327                        async_answer_0(callid, rc);
     1328                        async_answer_0(rid, rc);
    13301329                        return;
    13311330                }
     
    13361335                if (rc != EOK) {
    13371336                        (void) fat_node_put(fn);
    1338                         ipc_answer_0(rid, rc);
     1337                        async_answer_0(rid, rc);
    13391338                        return;
    13401339                }
     
    13451344                size = nodep->size;
    13461345                rc = fat_node_put(fn);
    1347                 ipc_answer_2(rid, rc, bytes, nodep->size);
     1346                async_answer_2(rid, rc, bytes, nodep->size);
    13481347                return;
    13491348        } else {
     
    13611360                        /* could not allocate a chain of nclsts clusters */
    13621361                        (void) fat_node_put(fn);
    1363                         ipc_answer_0(callid, rc);
    1364                         ipc_answer_0(rid, rc);
     1362                        async_answer_0(callid, rc);
     1363                        async_answer_0(rid, rc);
    13651364                        return;
    13661365                }
     
    13701369                        (void) fat_free_clusters(bs, devmap_handle, mcl);
    13711370                        (void) fat_node_put(fn);
    1372                         ipc_answer_0(callid, rc);
    1373                         ipc_answer_0(rid, rc);
     1371                        async_answer_0(callid, rc);
     1372                        async_answer_0(rid, rc);
    13741373                        return;
    13751374                }
     
    13791378                        (void) fat_free_clusters(bs, devmap_handle, mcl);
    13801379                        (void) fat_node_put(fn);
    1381                         ipc_answer_0(callid, rc);
    1382                         ipc_answer_0(rid, rc);
     1380                        async_answer_0(callid, rc);
     1381                        async_answer_0(rid, rc);
    13831382                        return;
    13841383                }
     
    13901389                        (void) fat_free_clusters(bs, devmap_handle, mcl);
    13911390                        (void) fat_node_put(fn);
    1392                         ipc_answer_0(rid, rc);
     1391                        async_answer_0(rid, rc);
    13931392                        return;
    13941393                }
     
    14011400                        (void) fat_free_clusters(bs, devmap_handle, mcl);
    14021401                        (void) fat_node_put(fn);
    1403                         ipc_answer_0(rid, rc);
     1402                        async_answer_0(rid, rc);
    14041403                        return;
    14051404                }
     
    14071406                nodep->dirty = true;            /* need to sync node */
    14081407                rc = fat_node_put(fn);
    1409                 ipc_answer_2(rid, rc, bytes, size);
     1408                async_answer_2(rid, rc, bytes, size);
    14101409                return;
    14111410        }
     
    14251424        rc = fat_node_get(&fn, devmap_handle, index);
    14261425        if (rc != EOK) {
    1427                 ipc_answer_0(rid, rc);
     1426                async_answer_0(rid, rc);
    14281427                return;
    14291428        }
    14301429        if (!fn) {
    1431                 ipc_answer_0(rid, ENOENT);
     1430                async_answer_0(rid, ENOENT);
    14321431                return;
    14331432        }
     
    14751474out:
    14761475        fat_node_put(fn);
    1477         ipc_answer_0(rid, rc);
     1476        async_answer_0(rid, rc);
    14781477        return;
    14791478}
     
    14811480void fat_close(ipc_callid_t rid, ipc_call_t *request)
    14821481{
    1483         ipc_answer_0(rid, EOK);
     1482        async_answer_0(rid, EOK);
    14841483}
    14851484
     
    14931492        rc = fat_node_get(&fn, devmap_handle, index);
    14941493        if (rc != EOK) {
    1495                 ipc_answer_0(rid, rc);
     1494                async_answer_0(rid, rc);
    14961495                return;
    14971496        }
    14981497        if (!fn) {
    1499                 ipc_answer_0(rid, ENOENT);
     1498                async_answer_0(rid, ENOENT);
    15001499                return;
    15011500        }
    15021501
    15031502        rc = fat_destroy_node(fn);
    1504         ipc_answer_0(rid, rc);
     1503        async_answer_0(rid, rc);
    15051504}
    15061505
     
    15231522        int rc = fat_node_get(&fn, devmap_handle, index);
    15241523        if (rc != EOK) {
    1525                 ipc_answer_0(rid, rc);
     1524                async_answer_0(rid, rc);
    15261525                return;
    15271526        }
    15281527        if (!fn) {
    1529                 ipc_answer_0(rid, ENOENT);
     1528                async_answer_0(rid, ENOENT);
    15301529                return;
    15311530        }
     
    15371536       
    15381537        fat_node_put(fn);
    1539         ipc_answer_0(rid, rc);
     1538        async_answer_0(rid, rc);
    15401539}
    15411540
  • uspace/srv/fs/pipefs/pipefs.c

    ra49c4002 rcf2af94  
    4242
    4343#include "pipefs.h"
    44 #include <ipc/ipc.h>
    4544#include <ipc/services.h>
     45#include <ipc/ns.h>
    4646#include <async.h>
    4747#include <errno.h>
     
    8888                 * created by IPC_M_CONNECT_TO_ME.
    8989                 */
    90                 ipc_answer_0(iid, EOK);
     90                async_answer_0(iid, EOK);
    9191        }
    9292       
     
    9797       
    9898                callid = async_get_call(&call);
    99                 switch  (IPC_GET_METHOD(call)) {
     99                switch  (IPC_GET_IMETHOD(call)) {
    100100                case IPC_M_PHONE_HUNGUP:
    101101                        return;
     
    140140                        break;
    141141                default:
    142                         ipc_answer_0(callid, ENOTSUP);
     142                        async_answer_0(callid, ENOTSUP);
    143143                        break;
    144144                }
     
    155155        }
    156156
    157         int vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0);
     157        int vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
    158158        if (vfs_phone < EOK) {
    159159                printf(NAME ": Unable to connect to VFS\n");
  • uspace/srv/fs/pipefs/pipefs.h

    ra49c4002 rcf2af94  
    3434#define PIPEFS_PIPEFS_H_
    3535
    36 #include <ipc/ipc.h>
    3736#include <libfs.h>
    3837#include <atomic.h>
  • uspace/srv/fs/pipefs/pipefs_ops.c

    ra49c4002 rcf2af94  
    3939#include "pipefs.h"
    4040#include "../../vfs/vfs.h"
    41 #include <ipc/ipc.h>
    4241#include <macros.h>
    4342#include <stdint.h>
     
    457456        rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL);
    458457        if (rc != EOK) {
    459                 ipc_answer_0(rid, rc);
     458                async_answer_0(rid, rc);
    460459                return;
    461460        }
     
    466465                (void) pipefs_node_put(rootfn);
    467466                free(opts);
    468                 ipc_answer_0(rid, EEXIST);
     467                async_answer_0(rid, EEXIST);
    469468                return;
    470469        }
     
    473472        if (!pipefs_instance_init(devmap_handle)) {
    474473                free(opts);
    475                 ipc_answer_0(rid, ENOMEM);
     474                async_answer_0(rid, ENOMEM);
    476475                return;
    477476        }
     
    480479        assert(rc == EOK);
    481480        pipefs_node_t *rootp = PIPEFS_NODE(rootfn);
    482         ipc_answer_3(rid, EOK, rootp->index, rootp->size, rootp->lnkcnt);
     481        async_answer_3(rid, EOK, rootp->index, rootp->size, rootp->lnkcnt);
    483482        free(opts);
    484483}
     
    494493
    495494        pipefs_instance_done(devmap_handle);
    496         ipc_answer_0(rid, EOK);
     495        async_answer_0(rid, EOK);
    497496}
    498497
     
    524523        hlp = hash_table_find(&nodes, key);
    525524        if (!hlp) {
    526                 ipc_answer_0(rid, ENOENT);
     525                async_answer_0(rid, ENOENT);
    527526                return;
    528527        }
     
    536535        size_t size;
    537536        if (!async_data_read_receive(&callid, &size)) {
    538                 ipc_answer_0(callid, EINVAL);
    539                 ipc_answer_0(rid, EINVAL);
     537                async_answer_0(callid, EINVAL);
     538                async_answer_0(rid, EINVAL);
    540539                return;
    541540        }
     
    548547                 */
    549548                if (pos < nodep->start) {
    550                         ipc_answer_0(callid, ENOTSUP);
    551                         ipc_answer_0(rid, ENOTSUP);
     549                        async_answer_0(callid, ENOTSUP);
     550                        async_answer_0(rid, ENOTSUP);
    552551                        return;
    553552                }
     
    606605                         * and remove this else clause
    607606                         */
    608                         ipc_answer_0(callid, ENOTSUP);
    609                         ipc_answer_1(rid, ENOTSUP, 0);
     607                        async_answer_0(callid, ENOTSUP);
     608                        async_answer_1(rid, ENOTSUP, 0);
    610609                        return;
    611610                }
     
    628627
    629628                if (lnk == &nodep->cs_head) {
    630                         ipc_answer_0(callid, ENOENT);
    631                         ipc_answer_1(rid, ENOENT, 0);
     629                        async_answer_0(callid, ENOENT);
     630                        async_answer_1(rid, ENOENT, 0);
    632631                        return;
    633632                }
     
    643642         * Answer the VFS_READ call.
    644643         */
    645         ipc_answer_1(rid, EOK, bytes);
     644        async_answer_1(rid, EOK, bytes);
    646645}
    647646
     
    663662        hlp = hash_table_find(&nodes, key);
    664663        if (!hlp) {
    665                 ipc_answer_0(rid, ENOENT);
     664                async_answer_0(rid, ENOENT);
    666665                return;
    667666        }
     
    675674        size_t size;
    676675        if (!async_data_write_receive(&callid, &size)) {
    677                 ipc_answer_0(callid, EINVAL);   
    678                 ipc_answer_0(rid, EINVAL);
     676                async_answer_0(callid, EINVAL);
     677                async_answer_0(rid, EINVAL);
    679678                return;
    680679        }
     
    684683         */
    685684        if (pos != nodep->size) {
    686                 ipc_answer_0(callid, ENOTSUP);
    687                 ipc_answer_2(rid, EOK, 0, nodep->size);
     685                async_answer_0(callid, ENOTSUP);
     686                async_answer_2(rid, EOK, 0, nodep->size);
    688687                return;
    689688        }
     
    696695        void *newdata = malloc(size);
    697696        if (!newdata) {
    698                 ipc_answer_0(callid, ENOMEM);
    699                 ipc_answer_2(rid, EOK, 0, nodep->size);
     697                async_answer_0(callid, ENOMEM);
     698                async_answer_2(rid, EOK, 0, nodep->size);
    700699                return;
    701700        }
     
    705704        if (!newblock) {
    706705                free(newdata);
    707                 ipc_answer_0(callid, ENOMEM);
    708                 ipc_answer_2(rid, EOK, 0, nodep->size);
     706                async_answer_0(callid, ENOMEM);
     707                async_answer_2(rid, EOK, 0, nodep->size);
    709708                return;
    710709        }
     
    715714                free(newblock);
    716715                free(newdata);
    717                 ipc_answer_0(callid, rc);
    718                 ipc_answer_2(rid, EOK, 0, nodep->size);
     716                async_answer_0(callid, rc);
     717                async_answer_2(rid, EOK, 0, nodep->size);
    719718                return;
    720719        }
     
    727726        nodep->size += size;
    728727       
    729         ipc_answer_2(rid, EOK, size, nodep->size);
     728        async_answer_2(rid, EOK, size, nodep->size);
    730729}
    731730
     
    735734         * PIPEFS does not support resizing of files
    736735         */
    737         ipc_answer_0(rid, ENOTSUP);
     736        async_answer_0(rid, ENOTSUP);
    738737}
    739738
    740739void pipefs_close(ipc_callid_t rid, ipc_call_t *request)
    741740{
    742         ipc_answer_0(rid, EOK);
     741        async_answer_0(rid, EOK);
    743742}
    744743
     
    756755        hlp = hash_table_find(&nodes, key);
    757756        if (!hlp) {
    758                 ipc_answer_0(rid, ENOENT);
     757                async_answer_0(rid, ENOENT);
    759758                return;
    760759        }
     
    762761            nh_link);
    763762        rc = pipefs_destroy_node(FS_NODE(nodep));
    764         ipc_answer_0(rid, rc);
     763        async_answer_0(rid, rc);
    765764}
    766765
     
    781780         * thus the sync operation is a no-op.
    782781         */
    783         ipc_answer_0(rid, EOK);
     782        async_answer_0(rid, EOK);
    784783}
    785784
  • uspace/srv/fs/tmpfs/tmpfs.c

    ra49c4002 rcf2af94  
    4242
    4343#include "tmpfs.h"
    44 #include <ipc/ipc.h>
    4544#include <ipc/services.h>
     45#include <ipc/ns.h>
    4646#include <async.h>
    4747#include <errno.h>
     
    5757vfs_info_t tmpfs_vfs_info = {
    5858        .name = NAME,
     59        .concurrent_read_write = false,
     60        .write_retains_size = false,
    5961};
    6062
     
    8890                 * created by IPC_M_CONNECT_TO_ME.
    8991                 */
    90                 ipc_answer_0(iid, EOK);
     92                async_answer_0(iid, EOK);
    9193        }
    9294       
     
    9799       
    98100                callid = async_get_call(&call);
    99                 switch  (IPC_GET_METHOD(call)) {
     101                switch  (IPC_GET_IMETHOD(call)) {
    100102                case IPC_M_PHONE_HUNGUP:
    101103                        return;
     
    140142                        break;
    141143                default:
    142                         ipc_answer_0(callid, ENOTSUP);
     144                        async_answer_0(callid, ENOTSUP);
    143145                        break;
    144146                }
     
    155157        }
    156158
    157         int vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0);
     159        int vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
    158160        if (vfs_phone < EOK) {
    159161                printf(NAME ": Unable to connect to VFS\n");
  • uspace/srv/fs/tmpfs/tmpfs.h

    ra49c4002 rcf2af94  
    3434#define TMPFS_TMPFS_H_
    3535
    36 #include <ipc/ipc.h>
    3736#include <libfs.h>
    3837#include <atomic.h>
  • uspace/srv/fs/tmpfs/tmpfs_ops.c

    ra49c4002 rcf2af94  
    3939#include "tmpfs.h"
    4040#include "../../vfs/vfs.h"
    41 #include <ipc/ipc.h>
    4241#include <macros.h>
    4342#include <stdint.h>
     
    450449        rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL);
    451450        if (rc != EOK) {
    452                 ipc_answer_0(rid, rc);
     451                async_answer_0(rid, rc);
    453452                return;
    454453        }
     
    459458                (void) tmpfs_node_put(rootfn);
    460459                free(opts);
    461                 ipc_answer_0(rid, EEXIST);
     460                async_answer_0(rid, EEXIST);
    462461                return;
    463462        }
     
    466465        if (!tmpfs_instance_init(devmap_handle)) {
    467466                free(opts);
    468                 ipc_answer_0(rid, ENOMEM);
     467                async_answer_0(rid, ENOMEM);
    469468                return;
    470469        }
     
    475474        if (str_cmp(opts, "restore") == 0) {
    476475                if (tmpfs_restore(devmap_handle))
    477                         ipc_answer_3(rid, EOK, rootp->index, rootp->size,
     476                        async_answer_3(rid, EOK, rootp->index, rootp->size,
    478477                            rootp->lnkcnt);
    479478                else
    480                         ipc_answer_0(rid, ELIMIT);
     479                        async_answer_0(rid, ELIMIT);
    481480        } else {
    482                 ipc_answer_3(rid, EOK, rootp->index, rootp->size,
     481                async_answer_3(rid, EOK, rootp->index, rootp->size,
    483482                    rootp->lnkcnt);
    484483        }
     
    496495
    497496        tmpfs_instance_done(devmap_handle);
    498         ipc_answer_0(rid, EOK);
     497        async_answer_0(rid, EOK);
    499498}
    500499
     
    526525        hlp = hash_table_find(&nodes, key);
    527526        if (!hlp) {
    528                 ipc_answer_0(rid, ENOENT);
     527                async_answer_0(rid, ENOENT);
    529528                return;
    530529        }
     
    538537        size_t size;
    539538        if (!async_data_read_receive(&callid, &size)) {
    540                 ipc_answer_0(callid, EINVAL);
    541                 ipc_answer_0(rid, EINVAL);
     539                async_answer_0(callid, EINVAL);
     540                async_answer_0(rid, EINVAL);
    542541                return;
    543542        }
     
    566565
    567566                if (lnk == &nodep->cs_head) {
    568                         ipc_answer_0(callid, ENOENT);
    569                         ipc_answer_1(rid, ENOENT, 0);
     567                        async_answer_0(callid, ENOENT);
     568                        async_answer_1(rid, ENOENT, 0);
    570569                        return;
    571570                }
     
    581580         * Answer the VFS_READ call.
    582581         */
    583         ipc_answer_1(rid, EOK, bytes);
     582        async_answer_1(rid, EOK, bytes);
    584583}
    585584
     
    601600        hlp = hash_table_find(&nodes, key);
    602601        if (!hlp) {
    603                 ipc_answer_0(rid, ENOENT);
     602                async_answer_0(rid, ENOENT);
    604603                return;
    605604        }
     
    613612        size_t size;
    614613        if (!async_data_write_receive(&callid, &size)) {
    615                 ipc_answer_0(callid, EINVAL);   
    616                 ipc_answer_0(rid, EINVAL);
     614                async_answer_0(callid, EINVAL);
     615                async_answer_0(rid, EINVAL);
    617616                return;
    618617        }
     
    624623                /* The file size is not changing. */
    625624                (void) async_data_write_finalize(callid, nodep->data + pos, size);
    626                 ipc_answer_2(rid, EOK, size, nodep->size);
     625                async_answer_2(rid, EOK, size, nodep->size);
    627626                return;
    628627        }
     
    637636        void *newdata = realloc(nodep->data, nodep->size + delta);
    638637        if (!newdata) {
    639                 ipc_answer_0(callid, ENOMEM);
    640                 ipc_answer_2(rid, EOK, 0, nodep->size);
     638                async_answer_0(callid, ENOMEM);
     639                async_answer_2(rid, EOK, 0, nodep->size);
    641640                return;
    642641        }
     
    646645        nodep->data = newdata;
    647646        (void) async_data_write_finalize(callid, nodep->data + pos, size);
    648         ipc_answer_2(rid, EOK, size, nodep->size);
     647        async_answer_2(rid, EOK, size, nodep->size);
    649648}
    650649
     
    665664        link_t *hlp = hash_table_find(&nodes, key);
    666665        if (!hlp) {
    667                 ipc_answer_0(rid, ENOENT);
     666                async_answer_0(rid, ENOENT);
    668667                return;
    669668        }
     
    672671       
    673672        if (size == nodep->size) {
    674                 ipc_answer_0(rid, EOK);
     673                async_answer_0(rid, EOK);
    675674                return;
    676675        }
    677676       
    678677        if (size > SIZE_MAX) {
    679                 ipc_answer_0(rid, ENOMEM);
     678                async_answer_0(rid, ENOMEM);
    680679                return;
    681680        }
     
    683682        void *newdata = realloc(nodep->data, size);
    684683        if (!newdata) {
    685                 ipc_answer_0(rid, ENOMEM);
     684                async_answer_0(rid, ENOMEM);
    686685                return;
    687686        }
     
    694693        nodep->size = size;
    695694        nodep->data = newdata;
    696         ipc_answer_0(rid, EOK);
     695        async_answer_0(rid, EOK);
    697696}
    698697
    699698void tmpfs_close(ipc_callid_t rid, ipc_call_t *request)
    700699{
    701         ipc_answer_0(rid, EOK);
     700        async_answer_0(rid, EOK);
    702701}
    703702
     
    715714        hlp = hash_table_find(&nodes, key);
    716715        if (!hlp) {
    717                 ipc_answer_0(rid, ENOENT);
     716                async_answer_0(rid, ENOENT);
    718717                return;
    719718        }
     
    721720            nh_link);
    722721        rc = tmpfs_destroy_node(FS_NODE(nodep));
    723         ipc_answer_0(rid, rc);
     722        async_answer_0(rid, rc);
    724723}
    725724
     
    740739         * thus the sync operation is a no-op.
    741740         */
    742         ipc_answer_0(rid, EOK);
     741        async_answer_0(rid, EOK);
    743742}
    744743
Note: See TracChangeset for help on using the changeset viewer.