Changeset 696979ce in mainline for uspace/lib


Ignore:
Timestamp:
2010-02-06T10:54:21Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5bda2f96
Parents:
3f93cdbe (diff), 25e963a (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 from mainline.

Location:
uspace/lib
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/arch/ia64/include/fibril.h

    r3f93cdbe r696979ce  
    5252/* Stack is divided into two equal parts (for memory stack and register stack). */
    5353#define PSTHREAD_INITIAL_STACK_DIVISION 2 
    54 
    55 #ifdef context_set
    56 #undef context_set
    57 #endif
    5854
    5955#define context_set(c, _pc, stack, size, tls)                                                           \
  • uspace/lib/libc/arch/sparc64/include/fibril.h

    r3f93cdbe r696979ce  
    4242#define SP_DELTA        (STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE)
    4343
    44 #ifdef context_set
    45 #undef context_set
    46 #endif
    47 
    4844#define context_set(c, _pc, stack, size, ptls) \
    4945        do { \
  • uspace/lib/libc/generic/async.c

    r3f93cdbe r696979ce  
    12871287}
    12881288
     1289/** Wrapper for forwarding any read request
     1290 *
     1291 *
     1292 */
     1293int async_data_read_forward_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
     1294    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipc_call_t *dataptr)
     1295{
     1296        ipc_callid_t callid;
     1297        if (!async_data_read_receive(&callid, NULL)) {
     1298                ipc_answer_0(callid, EINVAL);
     1299                return EINVAL;
     1300        }
     1301       
     1302        aid_t msg = async_send_fast(phoneid, method, arg1, arg2, arg3, arg4,
     1303            dataptr);
     1304        if (msg == 0) {
     1305                ipc_answer_0(callid, EINVAL);
     1306                return EINVAL;
     1307        }
     1308       
     1309        int retval = ipc_forward_fast(callid, phoneid, 0, 0, 0,
     1310            IPC_FF_ROUTE_FROM_ME);
     1311        if (retval != EOK) {
     1312                async_wait_for(msg, NULL);
     1313                ipc_answer_0(callid, retval);
     1314                return retval;
     1315        }
     1316       
     1317        ipcarg_t rc;
     1318        async_wait_for(msg, &rc);
     1319       
     1320        return (int) rc;
     1321}
     1322
    12891323/** Wrapper for making IPC_M_DATA_WRITE calls using the async framework.
    12901324 *
    1291  * @param phoneid       Phone that will be used to contact the receiving side.
    1292  * @param src           Address of the beginning of the source buffer.
    1293  * @param size          Size of the source buffer.
    1294  *
    1295  * @return              Zero on success or a negative error code from errno.h.
     1325 * @param phoneid Phone that will be used to contact the receiving side.
     1326 * @param src     Address of the beginning of the source buffer.
     1327 * @param size    Size of the source buffer.
     1328 *
     1329 * @return Zero on success or a negative error code from errno.h.
     1330 *
    12961331 */
    12971332int async_data_write_start(int phoneid, const void *src, size_t size)
     
    13081343 * So far, this wrapper is to be used from within a connection fibril.
    13091344 *
    1310  * @param callid        Storage where the hash of the IPC_M_DATA_WRITE call will
    1311  *                      be stored.
    1312  * @param size          Storage where the suggested size will be stored. May be
    1313  *                      NULL
    1314  *
    1315  * @return              Non-zero on success, zero on failure.
     1345 * @param callid Storage where the hash of the IPC_M_DATA_WRITE call will
     1346 *               be stored.
     1347 * @param size   Storage where the suggested size will be stored. May be
     1348 *               NULL
     1349 *
     1350 * @return Non-zero on success, zero on failure.
     1351 *
    13161352 */
    13171353int async_data_write_receive(ipc_callid_t *callid, size_t *size)
     
    13201356       
    13211357        assert(callid);
    1322 
     1358       
    13231359        *callid = async_get_call(&data);
    13241360        if (IPC_GET_METHOD(data) != IPC_M_DATA_WRITE)
    13251361                return 0;
     1362       
    13261363        if (size)
    13271364                *size = (size_t) IPC_GET_ARG2(data);
     1365       
    13281366        return 1;
    13291367}
     
    13341372 * so that the user doesn't have to remember the meaning of each IPC argument.
    13351373 *
    1336  * @param callid        Hash of the IPC_M_DATA_WRITE call to answer.
    1337  * @param dst           Final destination address for the IPC_M_DATA_WRITE call.
    1338  * @param size          Final size for the IPC_M_DATA_WRITE call.
    1339  *
    1340  * @return              Zero on success or a value from @ref errno.h on failure.
     1374 * @param callid Hash of the IPC_M_DATA_WRITE call to answer.
     1375 * @param dst    Final destination address for the IPC_M_DATA_WRITE call.
     1376 * @param size   Final size for the IPC_M_DATA_WRITE call.
     1377 *
     1378 * @return Zero on success or a value from @ref errno.h on failure.
     1379 *
    13411380 */
    13421381int async_data_write_finalize(ipc_callid_t callid, void *dst, size_t size)
     
    13451384}
    13461385
    1347 /** Wrapper for receiving blobs via the async_data_write_*
     1386/** Wrapper for receiving binary data or strings
    13481387 *
    13491388 * This wrapper only makes it more comfortable to use async_data_write_*
    1350  * functions to receive blobs.
    1351  *
    1352  * @param blob     Pointer to data pointer (which should be later disposed
    1353  *                 by free()). If the operation fails, the pointer is not
    1354  *                 touched.
    1355  * @param max_size Maximum size (in bytes) of the blob to receive. 0 means
    1356  *                 no limit.
    1357  * @param received If not NULL, the size of the received data is stored here.
     1389 * functions to receive binary data or strings.
     1390 *
     1391 * @param data       Pointer to data pointer (which should be later disposed
     1392 *                   by free()). If the operation fails, the pointer is not
     1393 *                   touched.
     1394 * @param nullterm   If true then the received data is always zero terminated.
     1395 *                   This also causes to allocate one extra byte beyond the
     1396 *                   raw transmitted data.
     1397 * @param min_size   Minimum size (in bytes) of the data to receive.
     1398 * @param max_size   Maximum size (in bytes) of the data to receive. 0 means
     1399 *                   no limit.
     1400 * @param granulariy If non-zero then the size of the received data has to
     1401 *                   be divisible by this value.
     1402 * @param received   If not NULL, the size of the received data is stored here.
    13581403 *
    13591404 * @return Zero on success or a value from @ref errno.h on failure.
    13601405 *
    13611406 */
    1362 int async_data_blob_receive(char **blob, const size_t max_size, size_t *received)
     1407int async_data_write_accept(void **data, const bool nullterm,
     1408    const size_t min_size, const size_t max_size, const size_t granularity,
     1409    size_t *received)
    13631410{
    13641411        ipc_callid_t callid;
     
    13691416        }
    13701417       
     1418        if (size < min_size) {
     1419                ipc_answer_0(callid, EINVAL);
     1420                return EINVAL;
     1421        }
     1422       
    13711423        if ((max_size > 0) && (size > max_size)) {
    13721424                ipc_answer_0(callid, EINVAL);
     
    13741426        }
    13751427       
    1376         char *data = (char *) malloc(size);
    1377         if (data == NULL) {
     1428        if ((granularity > 0) && ((size % granularity) != 0)) {
     1429                ipc_answer_0(callid, EINVAL);
     1430                return EINVAL;
     1431        }
     1432       
     1433        void *_data;
     1434       
     1435        if (nullterm)
     1436                _data = malloc(size + 1);
     1437        else
     1438                _data = malloc(size);
     1439       
     1440        if (_data == NULL) {
    13781441                ipc_answer_0(callid, ENOMEM);
    13791442                return ENOMEM;
    13801443        }
    13811444       
    1382         int rc = async_data_write_finalize(callid, data, size);
     1445        int rc = async_data_write_finalize(callid, _data, size);
    13831446        if (rc != EOK) {
    1384                 free(data);
     1447                free(_data);
    13851448                return rc;
    13861449        }
    13871450       
    1388         *blob = data;
     1451        if (nullterm)
     1452                ((char *) _data)[size] = 0;
     1453       
     1454        *data = _data;
    13891455        if (received != NULL)
    13901456                *received = size;
     
    13931459}
    13941460
    1395 /** Wrapper for receiving strings via the async_data_write_*
    1396  *
    1397  * This wrapper only makes it more comfortable to use async_data_write_*
    1398  * functions to receive strings.
    1399  *
    1400  * @param str      Pointer to string pointer (which should be later disposed
    1401  *                 by free()). If the operation fails, the pointer is not
    1402  *                 touched.
    1403  * @param max_size Maximum size (in bytes) of the string to receive. 0 means
    1404  *                 no limit.
    1405  *
    1406  * @return Zero on success or a value from @ref errno.h on failure.
    1407  *
    1408  */
    1409 int async_data_string_receive(char **str, const size_t max_size)
     1461/** Wrapper for voiding any data that is about to be received
     1462 *
     1463 * This wrapper can be used to void any pending data
     1464 *
     1465 * @param retval Error value from @ref errno.h to be returned to the caller.
     1466 *
     1467 */
     1468void async_data_write_void(const int retval)
    14101469{
    14111470        ipc_callid_t callid;
    1412         size_t size;
    1413         if (!async_data_write_receive(&callid, &size)) {
     1471        async_data_write_receive(&callid, NULL);
     1472        ipc_answer_0(callid, retval);
     1473}
     1474
     1475/** Wrapper for forwarding any data that is about to be received
     1476 *
     1477 *
     1478 */
     1479int async_data_write_forward_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
     1480    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipc_call_t *dataptr)
     1481{
     1482        ipc_callid_t callid;
     1483        if (!async_data_write_receive(&callid, NULL)) {
    14141484                ipc_answer_0(callid, EINVAL);
    14151485                return EINVAL;
    14161486        }
    14171487       
    1418         if ((max_size > 0) && (size > max_size)) {
     1488        aid_t msg = async_send_fast(phoneid, method, arg1, arg2, arg3, arg4,
     1489            dataptr);
     1490        if (msg == 0) {
    14191491                ipc_answer_0(callid, EINVAL);
    14201492                return EINVAL;
    14211493        }
    14221494       
    1423         char *data = (char *) malloc(size + 1);
    1424         if (data == NULL) {
    1425                 ipc_answer_0(callid, ENOMEM);
    1426                 return ENOMEM;
    1427         }
    1428        
    1429         int rc = async_data_write_finalize(callid, data, size);
    1430         if (rc != EOK) {
    1431                 free(data);
    1432                 return rc;
    1433         }
    1434        
    1435         data[size] = 0;
    1436         *str = data;
    1437         return EOK;
     1495        int retval = ipc_forward_fast(callid, phoneid, 0, 0, 0,
     1496            IPC_FF_ROUTE_FROM_ME);
     1497        if (retval != EOK) {
     1498                async_wait_for(msg, NULL);
     1499                ipc_answer_0(callid, retval);
     1500                return retval;
     1501        }
     1502       
     1503        ipcarg_t rc;
     1504        async_wait_for(msg, &rc);
     1505       
     1506        return (int) rc;
    14381507}
    14391508
  • uspace/lib/libc/generic/clipboard.c

    r3f93cdbe r696979ce  
    8484                clip_connect();
    8585               
    86                 aid_t req = async_send_1(clip_phone, CLIPBOARD_PUT_DATA, CLIPBOARD_TAG_BLOB, NULL);
     86                aid_t req = async_send_1(clip_phone, CLIPBOARD_PUT_DATA, CLIPBOARD_TAG_DATA, NULL);
    8787                ipcarg_t rc = async_data_write_start(clip_phone, (void *) str, size);
    8888                if (rc != EOK) {
     
    139139                        *str = sbuf;
    140140                        return EOK;
    141                 case CLIPBOARD_TAG_BLOB:
     141                case CLIPBOARD_TAG_DATA:
    142142                        sbuf = malloc(size + 1);
    143143                        if (sbuf == NULL)
  • uspace/lib/libc/generic/vfs/vfs.c

    r3f93cdbe r696979ce  
    120120    const char *opts, unsigned int flags)
    121121{
    122         int res;
    123         ipcarg_t rc;
    124         ipcarg_t rc_orig;
    125         aid_t req;
     122        int null_id = -1;
     123        char null[DEVMAP_NAME_MAXLEN];
     124       
     125        if (str_cmp(fqdn, "") == 0) {
     126                /* No device specified, create a fresh
     127                   null/%d device instead */
     128                null_id = devmap_null_create();
     129               
     130                if (null_id == -1)
     131                        return ENOMEM;
     132               
     133                snprintf(null, DEVMAP_NAME_MAXLEN, "null/%d", null_id);
     134                fqdn = null;
     135        }
     136       
    126137        dev_handle_t dev_handle;
    127        
    128         res = devmap_device_get_handle(fqdn, &dev_handle, flags);
    129         if (res != EOK)
     138        int res = devmap_device_get_handle(fqdn, &dev_handle, flags);
     139        if (res != EOK) {
     140                if (null_id != -1)
     141                        devmap_null_destroy(null_id);
     142               
    130143                return res;
     144        }
    131145       
    132146        size_t mpa_size;
    133147        char *mpa = absolutize(mp, &mpa_size);
    134         if (!mpa)
    135                 return ENOMEM;
    136        
    137         futex_down(&vfs_phone_futex);
    138         async_serialize_start();
    139         vfs_connect();
    140        
    141         req = async_send_2(vfs_phone, VFS_IN_MOUNT, dev_handle, flags, NULL);
    142         rc = async_data_write_start(vfs_phone, (void *) mpa, mpa_size);
     148        if (!mpa) {
     149                if (null_id != -1)
     150                        devmap_null_destroy(null_id);
     151               
     152                return ENOMEM;
     153        }
     154       
     155        futex_down(&vfs_phone_futex);
     156        async_serialize_start();
     157        vfs_connect();
     158       
     159        ipcarg_t rc_orig;
     160        aid_t req = async_send_2(vfs_phone, VFS_IN_MOUNT, dev_handle, flags, NULL);
     161        ipcarg_t rc = async_data_write_start(vfs_phone, (void *) mpa, mpa_size);
    143162        if (rc != EOK) {
    144163                async_wait_for(req, &rc_orig);
     
    146165                futex_up(&vfs_phone_futex);
    147166                free(mpa);
     167               
     168                if (null_id != -1)
     169                        devmap_null_destroy(null_id);
     170               
    148171                if (rc_orig == EOK)
    149172                        return (int) rc;
     
    158181                futex_up(&vfs_phone_futex);
    159182                free(mpa);
    160                 if (rc_orig == EOK)
    161                         return (int) rc;
    162                 else
    163                         return (int) rc_orig;
    164         }
    165 
     183               
     184                if (null_id != -1)
     185                        devmap_null_destroy(null_id);
     186               
     187                if (rc_orig == EOK)
     188                        return (int) rc;
     189                else
     190                        return (int) rc_orig;
     191        }
     192       
    166193        rc = async_data_write_start(vfs_phone, (void *) fs_name, str_size(fs_name));
    167194        if (rc != EOK) {
     
    170197                futex_up(&vfs_phone_futex);
    171198                free(mpa);
    172                 if (rc_orig == EOK)
    173                         return (int) rc;
    174                 else
    175                         return (int) rc_orig;
    176         }
    177 
     199               
     200                if (null_id != -1)
     201                        devmap_null_destroy(null_id);
     202               
     203                if (rc_orig == EOK)
     204                        return (int) rc;
     205                else
     206                        return (int) rc_orig;
     207        }
     208       
    178209        /* Ask VFS whether it likes fs_name. */
    179210        rc = async_req_0_0(vfs_phone, IPC_M_PING);
     
    183214                futex_up(&vfs_phone_futex);
    184215                free(mpa);
     216               
     217                if (null_id != -1)
     218                        devmap_null_destroy(null_id);
     219               
    185220                if (rc_orig == EOK)
    186221                        return (int) rc;
     
    193228        futex_up(&vfs_phone_futex);
    194229        free(mpa);
     230       
     231        if ((rc != EOK) && (null_id != -1))
     232                devmap_null_destroy(null_id);
    195233       
    196234        return (int) rc;
  • uspace/lib/libc/include/async.h

    r3f93cdbe r696979ce  
    277277extern int async_share_out_receive(ipc_callid_t *, size_t *, int *);
    278278extern int async_share_out_finalize(ipc_callid_t, void *);
     279
     280/*
     281 * User-friendly wrappers for async_data_read_forward_fast().
     282 */
     283#define async_data_read_forward_0_0(phoneid, method, answer) \
     284        async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL)
     285#define async_data_read_forward_0_1(phoneid, method, answer) \
     286        async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, (answer))
     287#define async_data_read_forward_1_0(phoneid, method, arg1, answer) \
     288        async_data_read_forward_fast((phoneid), (method), (arg1), 0, 0, 0, NULL)
     289#define async_data_read_forward_1_1(phoneid, method, arg1, answer) \
     290        async_data_read_forward_fast((phoneid), (method), (arg1), 0, 0, 0, (answer))
     291#define async_data_read_forward_2_0(phoneid, method, arg1, arg2, answer) \
     292        async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, NULL)
     293#define async_data_read_forward_2_1(phoneid, method, arg1, arg2, answer) \
     294        async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \
     295            (answer))
     296#define async_data_read_forward_3_0(phoneid, method, arg1, arg2, arg3, answer) \
     297        async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, \
     298            NULL)
     299#define async_data_read_forward_3_1(phoneid, method, arg1, arg2, arg3, answer) \
     300        async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, \
     301            (answer))
     302#define async_data_read_forward_4_0(phoneid, method, arg1, arg2, arg3, arg4, answer) \
     303        async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
     304            (arg4), NULL)
     305#define async_data_read_forward_4_1(phoneid, method, arg1, arg2, arg3, arg4, answer) \
     306        async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
     307            (arg4), (answer))
     308
    279309extern int async_data_read_start(int, void *, size_t);
    280310extern int async_data_read_receive(ipc_callid_t *, size_t *);
    281311extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
     312
     313extern int async_data_read_forward_fast(int, ipcarg_t, ipcarg_t, ipcarg_t,
     314    ipcarg_t, ipcarg_t, ipc_call_t *);
     315
     316/*
     317 * User-friendly wrappers for async_data_write_forward_fast().
     318 */
     319#define async_data_write_forward_0_0(phoneid, method, answer) \
     320        async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL)
     321#define async_data_write_forward_0_1(phoneid, method, answer) \
     322        async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, (answer))
     323#define async_data_write_forward_1_0(phoneid, method, arg1, answer) \
     324        async_data_write_forward_fast((phoneid), (method), (arg1), 0, 0, 0, NULL)
     325#define async_data_write_forward_1_1(phoneid, method, arg1, answer) \
     326        async_data_write_forward_fast((phoneid), (method), (arg1), 0, 0, 0, \
     327            (answer))
     328#define async_data_write_forward_2_0(phoneid, method, arg1, arg2, answer) \
     329        async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \
     330            NULL)
     331#define async_data_write_forward_2_1(phoneid, method, arg1, arg2, answer) \
     332        async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \
     333            (answer))
     334#define async_data_write_forward_3_0(phoneid, method, arg1, arg2, arg3, answer) \
     335        async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
     336            0, NULL)
     337#define async_data_write_forward_3_1(phoneid, method, arg1, arg2, arg3, answer) \
     338        async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
     339            0, (answer))
     340#define async_data_write_forward_4_0(phoneid, method, arg1, arg2, arg3, arg4, answer) \
     341        async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
     342            (arg4), NULL)
     343#define async_data_write_forward_4_1(phoneid, method, arg1, arg2, arg3, arg4, answer) \
     344        async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
     345            (arg4), (answer))
     346
    282347extern int async_data_write_start(int, const void *, size_t);
    283348extern int async_data_write_receive(ipc_callid_t *, size_t *);
    284349extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
    285350
    286 extern int async_data_blob_receive(char **, const size_t, size_t *);
    287 extern int async_data_string_receive(char **, const size_t);
     351extern int async_data_write_accept(void **, const bool, const size_t,
     352    const size_t, const size_t, size_t *);
     353extern void async_data_write_void(const int);
     354
     355extern int async_data_write_forward_fast(int, ipcarg_t, ipcarg_t, ipcarg_t,
     356    ipcarg_t, ipcarg_t, ipc_call_t *);
    288357
    289358#endif
  • uspace/lib/libc/include/fibril.h

    r3f93cdbe r696979ce  
    4040#include <libarch/tls.h>
    4141
    42 #ifndef context_set
    43 #define context_set(c, _pc, stack, size, ptls) \
     42#define context_set_generic(c, _pc, stack, size, ptls) \
    4443        (c)->pc = (sysarg_t) (_pc); \
    4544        (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
    4645        (c)->tls = (sysarg_t) (ptls);
    47 #endif /* context_set */
    4846
    49 #define FIBRIL_SERIALIZED       1
    50 #define FIBRIL_WRITER           2
     47#define FIBRIL_SERIALIZED  1
     48#define FIBRIL_WRITER      2
    5149
    5250typedef enum {
     
    5957typedef sysarg_t fid_t;
    6058
    61 struct fibril {
     59typedef struct fibril {
    6260        link_t link;
    6361        context_t ctx;
     
    7068        int retval;
    7169        int flags;
    72 };
    73 typedef struct fibril fibril_t;
     70} fibril_t;
    7471
    7572/** Fibril-local variable specifier */
    7673#define fibril_local __thread
    7774
    78 extern int context_save(context_t *c) __attribute__ ((returns_twice));
    79 extern void context_restore(context_t *c) __attribute__ ((noreturn));
     75extern int context_save(context_t *ctx) __attribute__((returns_twice));
     76extern void context_restore(context_t *ctx) __attribute__((noreturn));
    8077
    8178extern fid_t fibril_create(int (*func)(void *), void *arg);
     
    9087extern void fibril_dec_sercount(void);
    9188
    92 static inline int fibril_yield(void) {
     89static inline int fibril_yield(void)
     90{
    9391        return fibril_switch(FIBRIL_PREEMPT);
    9492}
  • uspace/lib/libc/include/ipc/clipboard.h

    r3f93cdbe r696979ce  
    4646typedef enum {
    4747        CLIPBOARD_TAG_NONE,
    48         CLIPBOARD_TAG_BLOB
     48        CLIPBOARD_TAG_DATA
    4949} clipboard_tag_t;
    5050
  • uspace/lib/libfs/libfs.c

    r3f93cdbe r696979ce  
    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_write_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_write_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_write_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,
    210             &answer);
    211         ipc_forward_fast(callid, mountee_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
    212         async_wait_for(msg, &rc);
     201        rc = async_data_write_forward_1_1(mountee_phone, VFS_OUT_MOUNTED,
     202            mr_dev_handle, &answer);
    213203       
    214204        if (rc == EOK) {
Note: See TracChangeset for help on using the changeset viewer.