Changeset b74959bd in mainline for uspace/srv/vfs/vfs_mount.c


Ignore:
Timestamp:
2007-11-20T21:33:32Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8498915
Parents:
3209923
Message:

Modify ipc_answer_*() to make use of all six syscall arguments. The recommended
means of answering calls is via the ipc_answer_m() macros (where m denotes the
number of return arguments) that automatically decide between the fast register
version or the slow universal version of ipc_answer().

File:
1 edited

Legend:

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

    r3209923 rb74959bd  
    8585         */
    8686        ipc_callid_t callid;
    87         ipc_call_t call;
    8887        size_t size;
    89         if (!ipc_data_receive(&callid, &call, NULL, &size)) {
    90                 ipc_answer_fast_0(callid, EINVAL);
    91                 ipc_answer_fast_0(rid, EINVAL);
     88        if (!ipc_data_receive(&callid, NULL, &size)) {
     89                ipc_answer_0(callid, EINVAL);
     90                ipc_answer_0(rid, EINVAL);
    9291                return;
    9392        }
     
    10099        if ((size < FS_NAME_MAXLEN + 1) ||
    101100            (size > FS_NAME_MAXLEN + MAX_PATH_LEN)) {
    102                 ipc_answer_fast_0(callid, EINVAL);
    103                 ipc_answer_fast_0(rid, EINVAL);
     101                ipc_answer_0(callid, EINVAL);
     102                ipc_answer_0(rid, EINVAL);
    104103                return;
    105104        }
     
    111110        buf = malloc(size);
    112111        if (!buf) {
    113                 ipc_answer_fast_0(callid, ENOMEM);
    114                 ipc_answer_fast_0(rid, ENOMEM);
     112                ipc_answer_0(callid, ENOMEM);
     113                ipc_answer_0(rid, ENOMEM);
    115114                return;
    116115        }
     
    119118         * Deliver the data.
    120119         */
    121         (void) ipc_data_deliver(callid, &call, buf, size);
     120        (void) ipc_data_deliver(callid, buf, size);
    122121
    123122        char fs_name[FS_NAME_MAXLEN + 1];
     
    132131        if (!fs_handle) {
    133132                free(buf);
    134                 ipc_answer_fast_0(rid, ENOENT);
     133                ipc_answer_0(rid, ENOENT);
    135134                return;
    136135        }
     
    147146        if (rc != EOK) {
    148147                free(buf);
    149                 ipc_answer_fast_0(rid, rc);
     148                ipc_answer_0(rid, rc);
    150149                return;
    151150        }
     
    153152        if (!mr_node) {
    154153                free(buf);
    155                 ipc_answer_fast_0(rid, ENOMEM);
     154                ipc_answer_0(rid, ENOMEM);
    156155                return;
    157156        }
     
    177176                        vfs_node_put(mr_node);  /* failed -> drop reference */
    178177                        free(buf);
    179                         ipc_answer_fast_0(rid, rc);
     178                        ipc_answer_0(rid, rc);
    180179                        return;
    181180                }
     
    186185                        vfs_node_put(mr_node);  /* failed -> drop reference */
    187186                        free(buf);
    188                         ipc_answer_fast_0(rid, ENOMEM);
     187                        ipc_answer_0(rid, ENOMEM);
    189188                        return;
    190189                }
     
    207206                        futex_up(&rootfs_futex);
    208207                        free(buf);
    209                         ipc_answer_fast_0(rid, EOK);
     208                        ipc_answer_0(rid, EOK);
    210209                        return;
    211210                } else {
     
    217216                        free(buf);
    218217                        vfs_node_put(mr_node);  /* failed -> drop reference */
    219                         ipc_answer_fast_0(rid, ENOENT);
     218                        ipc_answer_0(rid, ENOENT);
    220219                        return;
    221220                }
     
    255254       
    256255        if (rc2 == EOK)
    257                 ipc_answer_fast_0(rid, rc1);
     256                ipc_answer_0(rid, rc1);
    258257        else if (rc1 == EOK)
    259                 ipc_answer_fast_0(rid, rc2);
     258                ipc_answer_0(rid, rc2);
    260259        else
    261                 ipc_answer_fast_0(rid, rc1);
     260                ipc_answer_0(rid, rc1);
    262261}
    263262
Note: See TracChangeset for help on using the changeset viewer.