Changeset 12573db in mainline for uspace/srv/fs/devfs/devfs_ops.c


Ignore:
Timestamp:
2011-01-31T20:32:33Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
37cf3792
Parents:
4fe94c66 (diff), 197ef43 (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.

File:
1 edited

Legend:

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

    r4fe94c66 r12573db  
    3636 */
    3737
    38 #include <ipc/ipc.h>
    3938#include <macros.h>
    4039#include <bool.h>
     
    465464            0, NULL);
    466465        if (retval != EOK) {
    467                 ipc_answer_0(rid, retval);
     466                async_answer_0(rid, retval);
    468467                return;
    469468        }
    470469       
    471470        free(opts);
    472         ipc_answer_3(rid, EOK, 0, 0, 0);
     471        async_answer_3(rid, EOK, 0, 0, 0);
    473472}
    474473
     
    480479void devfs_unmounted(ipc_callid_t rid, ipc_call_t *request)
    481480{
    482         ipc_answer_0(rid, ENOTSUP);
     481        async_answer_0(rid, ENOTSUP);
    483482}
    484483
     
    513512                size_t size;
    514513                if (!async_data_read_receive(&callid, &size)) {
    515                         ipc_answer_0(callid, EINVAL);
    516                         ipc_answer_0(rid, EINVAL);
     514                        async_answer_0(callid, EINVAL);
     515                        async_answer_0(rid, EINVAL);
    517516                        return;
    518517                }
     
    535534                        async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
    536535                        free(desc);
    537                         ipc_answer_1(rid, EOK, 1);
     536                        async_answer_1(rid, EOK, 1);
    538537                        return;
    539538                }
     
    550549                                async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
    551550                                free(desc);
    552                                 ipc_answer_1(rid, EOK, 1);
     551                                async_answer_1(rid, EOK, 1);
    553552                                return;
    554553                        }
     
    557556                }
    558557               
    559                 ipc_answer_0(callid, ENOENT);
    560                 ipc_answer_1(rid, ENOENT, 0);
     558                async_answer_0(callid, ENOENT);
     559                async_answer_1(rid, ENOENT, 0);
    561560                return;
    562561        }
     
    569568                size_t size;
    570569                if (!async_data_read_receive(&callid, &size)) {
    571                         ipc_answer_0(callid, EINVAL);
    572                         ipc_answer_0(rid, EINVAL);
     570                        async_answer_0(callid, EINVAL);
     571                        async_answer_0(rid, EINVAL);
    573572                        return;
    574573                }
     
    580579                        async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
    581580                        free(desc);
    582                         ipc_answer_1(rid, EOK, 1);
     581                        async_answer_1(rid, EOK, 1);
    583582                        return;
    584583                }
    585584               
    586585                free(desc);
    587                 ipc_answer_0(callid, ENOENT);
    588                 ipc_answer_1(rid, ENOENT, 0);
     586                async_answer_0(callid, ENOENT);
     587                async_answer_1(rid, ENOENT, 0);
    589588                return;
    590589        }
     
    601600                if (lnk == NULL) {
    602601                        fibril_mutex_unlock(&devices_mutex);
    603                         ipc_answer_0(rid, ENOENT);
     602                        async_answer_0(rid, ENOENT);
    604603                        return;
    605604                }
     
    611610                if (!async_data_read_receive(&callid, NULL)) {
    612611                        fibril_mutex_unlock(&devices_mutex);
    613                         ipc_answer_0(callid, EINVAL);
    614                         ipc_answer_0(rid, EINVAL);
     612                        async_answer_0(callid, EINVAL);
     613                        async_answer_0(rid, EINVAL);
    615614                        return;
    616615                }
     
    623622               
    624623                /* Forward the IPC_M_DATA_READ request to the driver */
    625                 ipc_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
     624                async_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
    626625                fibril_mutex_unlock(&devices_mutex);
    627626               
     
    632631               
    633632                /* Driver reply is the final result of the whole operation */
    634                 ipc_answer_1(rid, rc, bytes);
    635                 return;
    636         }
    637        
    638         ipc_answer_0(rid, ENOENT);
     633                async_answer_1(rid, rc, bytes);
     634                return;
     635        }
     636       
     637        async_answer_0(rid, ENOENT);
    639638}
    640639
     
    643642        fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
    644643        if (index == 0) {
    645                 ipc_answer_0(rid, ENOTSUP);
     644                async_answer_0(rid, ENOTSUP);
    646645                return;
    647646        }
     
    651650        if (type == DEV_HANDLE_NAMESPACE) {
    652651                /* Namespace directory */
    653                 ipc_answer_0(rid, ENOTSUP);
     652                async_answer_0(rid, ENOTSUP);
    654653                return;
    655654        }
     
    665664                if (lnk == NULL) {
    666665                        fibril_mutex_unlock(&devices_mutex);
    667                         ipc_answer_0(rid, ENOENT);
     666                        async_answer_0(rid, ENOENT);
    668667                        return;
    669668                }
     
    675674                if (!async_data_write_receive(&callid, NULL)) {
    676675                        fibril_mutex_unlock(&devices_mutex);
    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                }
     
    687686               
    688687                /* Forward the IPC_M_DATA_WRITE request to the driver */
    689                 ipc_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
     688                async_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
    690689               
    691690                fibril_mutex_unlock(&devices_mutex);
     
    697696               
    698697                /* Driver reply is the final result of the whole operation */
    699                 ipc_answer_1(rid, rc, bytes);
    700                 return;
    701         }
    702        
    703         ipc_answer_0(rid, ENOENT);
     698                async_answer_1(rid, rc, bytes);
     699                return;
     700        }
     701       
     702        async_answer_0(rid, ENOENT);
    704703}
    705704
    706705void devfs_truncate(ipc_callid_t rid, ipc_call_t *request)
    707706{
    708         ipc_answer_0(rid, ENOTSUP);
     707        async_answer_0(rid, ENOTSUP);
    709708}
    710709
     
    714713       
    715714        if (index == 0) {
    716                 ipc_answer_0(rid, EOK);
     715                async_answer_0(rid, EOK);
    717716                return;
    718717        }
     
    722721        if (type == DEV_HANDLE_NAMESPACE) {
    723722                /* Namespace directory */
    724                 ipc_answer_0(rid, EOK);
     723                async_answer_0(rid, EOK);
    725724                return;
    726725        }
     
    735734                if (lnk == NULL) {
    736735                        fibril_mutex_unlock(&devices_mutex);
    737                         ipc_answer_0(rid, ENOENT);
     736                        async_answer_0(rid, ENOENT);
    738737                        return;
    739738                }
     
    744743               
    745744                if (dev->refcount == 0) {
    746                         ipc_hangup(dev->phone);
     745                        async_hangup(dev->phone);
    747746                        hash_table_remove(&devices, key, DEVICES_KEYS);
    748747                }
     
    750749                fibril_mutex_unlock(&devices_mutex);
    751750               
    752                 ipc_answer_0(rid, EOK);
    753                 return;
    754         }
    755        
    756         ipc_answer_0(rid, ENOENT);
     751                async_answer_0(rid, EOK);
     752                return;
     753        }
     754       
     755        async_answer_0(rid, ENOENT);
    757756}
    758757
     
    762761       
    763762        if (index == 0) {
    764                 ipc_answer_0(rid, EOK);
     763                async_answer_0(rid, EOK);
    765764                return;
    766765        }
     
    770769        if (type == DEV_HANDLE_NAMESPACE) {
    771770                /* Namespace directory */
    772                 ipc_answer_0(rid, EOK);
     771                async_answer_0(rid, EOK);
    773772                return;
    774773        }
     
    783782                if (lnk == NULL) {
    784783                        fibril_mutex_unlock(&devices_mutex);
    785                         ipc_answer_0(rid, ENOENT);
     784                        async_answer_0(rid, ENOENT);
    786785                        return;
    787786                }
     
    802801               
    803802                /* Driver reply is the final result of the whole operation */
    804                 ipc_answer_0(rid, rc);
    805                 return;
    806         }
    807        
    808         ipc_answer_0(rid, ENOENT);
     803                async_answer_0(rid, rc);
     804                return;
     805        }
     806       
     807        async_answer_0(rid, ENOENT);
    809808}
    810809
    811810void devfs_destroy(ipc_callid_t rid, ipc_call_t *request)
    812811{
    813         ipc_answer_0(rid, ENOTSUP);
     812        async_answer_0(rid, ENOTSUP);
    814813}
    815814
Note: See TracChangeset for help on using the changeset viewer.