Ignore:
File:
1 edited

Legend:

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

    rffa2c8ef r7ea7db31  
    3636 */
    3737
     38#include <ipc/ipc.h>
    3839#include <macros.h>
    3940#include <bool.h>
     
    464465            0, NULL);
    465466        if (retval != EOK) {
    466                 async_answer_0(rid, retval);
     467                ipc_answer_0(rid, retval);
    467468                return;
    468469        }
    469470       
    470471        free(opts);
    471         async_answer_3(rid, EOK, 0, 0, 0);
     472        ipc_answer_3(rid, EOK, 0, 0, 0);
    472473}
    473474
     
    479480void devfs_unmounted(ipc_callid_t rid, ipc_call_t *request)
    480481{
    481         async_answer_0(rid, ENOTSUP);
     482        ipc_answer_0(rid, ENOTSUP);
    482483}
    483484
     
    512513                size_t size;
    513514                if (!async_data_read_receive(&callid, &size)) {
    514                         async_answer_0(callid, EINVAL);
    515                         async_answer_0(rid, EINVAL);
     515                        ipc_answer_0(callid, EINVAL);
     516                        ipc_answer_0(rid, EINVAL);
    516517                        return;
    517518                }
     
    534535                        async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
    535536                        free(desc);
    536                         async_answer_1(rid, EOK, 1);
     537                        ipc_answer_1(rid, EOK, 1);
    537538                        return;
    538539                }
     
    549550                                async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
    550551                                free(desc);
    551                                 async_answer_1(rid, EOK, 1);
     552                                ipc_answer_1(rid, EOK, 1);
    552553                                return;
    553554                        }
     
    556557                }
    557558               
    558                 async_answer_0(callid, ENOENT);
    559                 async_answer_1(rid, ENOENT, 0);
     559                ipc_answer_0(callid, ENOENT);
     560                ipc_answer_1(rid, ENOENT, 0);
    560561                return;
    561562        }
     
    568569                size_t size;
    569570                if (!async_data_read_receive(&callid, &size)) {
    570                         async_answer_0(callid, EINVAL);
    571                         async_answer_0(rid, EINVAL);
     571                        ipc_answer_0(callid, EINVAL);
     572                        ipc_answer_0(rid, EINVAL);
    572573                        return;
    573574                }
     
    579580                        async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
    580581                        free(desc);
    581                         async_answer_1(rid, EOK, 1);
     582                        ipc_answer_1(rid, EOK, 1);
    582583                        return;
    583584                }
    584585               
    585586                free(desc);
    586                 async_answer_0(callid, ENOENT);
    587                 async_answer_1(rid, ENOENT, 0);
     587                ipc_answer_0(callid, ENOENT);
     588                ipc_answer_1(rid, ENOENT, 0);
    588589                return;
    589590        }
     
    600601                if (lnk == NULL) {
    601602                        fibril_mutex_unlock(&devices_mutex);
    602                         async_answer_0(rid, ENOENT);
     603                        ipc_answer_0(rid, ENOENT);
    603604                        return;
    604605                }
     
    610611                if (!async_data_read_receive(&callid, NULL)) {
    611612                        fibril_mutex_unlock(&devices_mutex);
    612                         async_answer_0(callid, EINVAL);
    613                         async_answer_0(rid, EINVAL);
     613                        ipc_answer_0(callid, EINVAL);
     614                        ipc_answer_0(rid, EINVAL);
    614615                        return;
    615616                }
     
    622623               
    623624                /* Forward the IPC_M_DATA_READ request to the driver */
    624                 async_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
     625                ipc_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
    625626                fibril_mutex_unlock(&devices_mutex);
    626627               
     
    631632               
    632633                /* Driver reply is the final result of the whole operation */
    633                 async_answer_1(rid, rc, bytes);
    634                 return;
    635         }
    636        
    637         async_answer_0(rid, ENOENT);
     634                ipc_answer_1(rid, rc, bytes);
     635                return;
     636        }
     637       
     638        ipc_answer_0(rid, ENOENT);
    638639}
    639640
     
    642643        fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
    643644        if (index == 0) {
    644                 async_answer_0(rid, ENOTSUP);
     645                ipc_answer_0(rid, ENOTSUP);
    645646                return;
    646647        }
     
    650651        if (type == DEV_HANDLE_NAMESPACE) {
    651652                /* Namespace directory */
    652                 async_answer_0(rid, ENOTSUP);
     653                ipc_answer_0(rid, ENOTSUP);
    653654                return;
    654655        }
     
    664665                if (lnk == NULL) {
    665666                        fibril_mutex_unlock(&devices_mutex);
    666                         async_answer_0(rid, ENOENT);
     667                        ipc_answer_0(rid, ENOENT);
    667668                        return;
    668669                }
     
    674675                if (!async_data_write_receive(&callid, NULL)) {
    675676                        fibril_mutex_unlock(&devices_mutex);
    676                         async_answer_0(callid, EINVAL);
    677                         async_answer_0(rid, EINVAL);
     677                        ipc_answer_0(callid, EINVAL);
     678                        ipc_answer_0(rid, EINVAL);
    678679                        return;
    679680                }
     
    686687               
    687688                /* Forward the IPC_M_DATA_WRITE request to the driver */
    688                 async_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
     689                ipc_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
    689690               
    690691                fibril_mutex_unlock(&devices_mutex);
     
    696697               
    697698                /* Driver reply is the final result of the whole operation */
    698                 async_answer_1(rid, rc, bytes);
    699                 return;
    700         }
    701        
    702         async_answer_0(rid, ENOENT);
     699                ipc_answer_1(rid, rc, bytes);
     700                return;
     701        }
     702       
     703        ipc_answer_0(rid, ENOENT);
    703704}
    704705
    705706void devfs_truncate(ipc_callid_t rid, ipc_call_t *request)
    706707{
    707         async_answer_0(rid, ENOTSUP);
     708        ipc_answer_0(rid, ENOTSUP);
    708709}
    709710
     
    713714       
    714715        if (index == 0) {
    715                 async_answer_0(rid, EOK);
     716                ipc_answer_0(rid, EOK);
    716717                return;
    717718        }
     
    721722        if (type == DEV_HANDLE_NAMESPACE) {
    722723                /* Namespace directory */
    723                 async_answer_0(rid, EOK);
     724                ipc_answer_0(rid, EOK);
    724725                return;
    725726        }
     
    734735                if (lnk == NULL) {
    735736                        fibril_mutex_unlock(&devices_mutex);
    736                         async_answer_0(rid, ENOENT);
     737                        ipc_answer_0(rid, ENOENT);
    737738                        return;
    738739                }
     
    743744               
    744745                if (dev->refcount == 0) {
    745                         async_hangup(dev->phone);
     746                        ipc_hangup(dev->phone);
    746747                        hash_table_remove(&devices, key, DEVICES_KEYS);
    747748                }
     
    749750                fibril_mutex_unlock(&devices_mutex);
    750751               
    751                 async_answer_0(rid, EOK);
    752                 return;
    753         }
    754        
    755         async_answer_0(rid, ENOENT);
     752                ipc_answer_0(rid, EOK);
     753                return;
     754        }
     755       
     756        ipc_answer_0(rid, ENOENT);
    756757}
    757758
     
    761762       
    762763        if (index == 0) {
    763                 async_answer_0(rid, EOK);
     764                ipc_answer_0(rid, EOK);
    764765                return;
    765766        }
     
    769770        if (type == DEV_HANDLE_NAMESPACE) {
    770771                /* Namespace directory */
    771                 async_answer_0(rid, EOK);
     772                ipc_answer_0(rid, EOK);
    772773                return;
    773774        }
     
    782783                if (lnk == NULL) {
    783784                        fibril_mutex_unlock(&devices_mutex);
    784                         async_answer_0(rid, ENOENT);
     785                        ipc_answer_0(rid, ENOENT);
    785786                        return;
    786787                }
     
    801802               
    802803                /* Driver reply is the final result of the whole operation */
    803                 async_answer_0(rid, rc);
    804                 return;
    805         }
    806        
    807         async_answer_0(rid, ENOENT);
     804                ipc_answer_0(rid, rc);
     805                return;
     806        }
     807       
     808        ipc_answer_0(rid, ENOENT);
    808809}
    809810
    810811void devfs_destroy(ipc_callid_t rid, ipc_call_t *request)
    811812{
    812         async_answer_0(rid, ENOTSUP);
     813        ipc_answer_0(rid, ENOTSUP);
    813814}
    814815
Note: See TracChangeset for help on using the changeset viewer.