Changeset 8b5690f in mainline for uspace/srv/fs/devfs/devfs_ops.c


Ignore:
Timestamp:
2011-02-03T05:11:01Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ba38f72c
Parents:
22027b6e (diff), 86d7bfa (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

    r22027b6e r8b5690f  
    3636 */
    3737
    38 #include <ipc/ipc.h>
    3938#include <macros.h>
    4039#include <bool.h>
     
    454453                return false;
    455454       
    456         if (devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING) < 0)
    457                 return false;
    458        
    459455        return true;
    460456}
     
    468464            0, NULL);
    469465        if (retval != EOK) {
    470                 ipc_answer_0(rid, retval);
     466                async_answer_0(rid, retval);
    471467                return;
    472468        }
    473469       
    474470        free(opts);
    475         ipc_answer_3(rid, EOK, 0, 0, 0);
     471        async_answer_3(rid, EOK, 0, 0, 0);
    476472}
    477473
     
    483479void devfs_unmounted(ipc_callid_t rid, ipc_call_t *request)
    484480{
    485         ipc_answer_0(rid, ENOTSUP);
     481        async_answer_0(rid, ENOTSUP);
    486482}
    487483
     
    516512                size_t size;
    517513                if (!async_data_read_receive(&callid, &size)) {
    518                         ipc_answer_0(callid, EINVAL);
    519                         ipc_answer_0(rid, EINVAL);
     514                        async_answer_0(callid, EINVAL);
     515                        async_answer_0(rid, EINVAL);
    520516                        return;
    521517                }
     
    538534                        async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
    539535                        free(desc);
    540                         ipc_answer_1(rid, EOK, 1);
     536                        async_answer_1(rid, EOK, 1);
    541537                        return;
    542538                }
     
    553549                                async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
    554550                                free(desc);
    555                                 ipc_answer_1(rid, EOK, 1);
     551                                async_answer_1(rid, EOK, 1);
    556552                                return;
    557553                        }
     
    560556                }
    561557               
    562                 ipc_answer_0(callid, ENOENT);
    563                 ipc_answer_1(rid, ENOENT, 0);
     558                async_answer_0(callid, ENOENT);
     559                async_answer_1(rid, ENOENT, 0);
    564560                return;
    565561        }
     
    572568                size_t size;
    573569                if (!async_data_read_receive(&callid, &size)) {
    574                         ipc_answer_0(callid, EINVAL);
    575                         ipc_answer_0(rid, EINVAL);
     570                        async_answer_0(callid, EINVAL);
     571                        async_answer_0(rid, EINVAL);
    576572                        return;
    577573                }
     
    583579                        async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
    584580                        free(desc);
    585                         ipc_answer_1(rid, EOK, 1);
     581                        async_answer_1(rid, EOK, 1);
    586582                        return;
    587583                }
    588584               
    589585                free(desc);
    590                 ipc_answer_0(callid, ENOENT);
    591                 ipc_answer_1(rid, ENOENT, 0);
     586                async_answer_0(callid, ENOENT);
     587                async_answer_1(rid, ENOENT, 0);
    592588                return;
    593589        }
     
    604600                if (lnk == NULL) {
    605601                        fibril_mutex_unlock(&devices_mutex);
    606                         ipc_answer_0(rid, ENOENT);
     602                        async_answer_0(rid, ENOENT);
    607603                        return;
    608604                }
     
    614610                if (!async_data_read_receive(&callid, NULL)) {
    615611                        fibril_mutex_unlock(&devices_mutex);
    616                         ipc_answer_0(callid, EINVAL);
    617                         ipc_answer_0(rid, EINVAL);
     612                        async_answer_0(callid, EINVAL);
     613                        async_answer_0(rid, EINVAL);
    618614                        return;
    619615                }
     
    626622               
    627623                /* Forward the IPC_M_DATA_READ request to the driver */
    628                 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);
    629625                fibril_mutex_unlock(&devices_mutex);
    630626               
     
    635631               
    636632                /* Driver reply is the final result of the whole operation */
    637                 ipc_answer_1(rid, rc, bytes);
    638                 return;
    639         }
    640        
    641         ipc_answer_0(rid, ENOENT);
     633                async_answer_1(rid, rc, bytes);
     634                return;
     635        }
     636       
     637        async_answer_0(rid, ENOENT);
    642638}
    643639
     
    646642        fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
    647643        if (index == 0) {
    648                 ipc_answer_0(rid, ENOTSUP);
     644                async_answer_0(rid, ENOTSUP);
    649645                return;
    650646        }
     
    654650        if (type == DEV_HANDLE_NAMESPACE) {
    655651                /* Namespace directory */
    656                 ipc_answer_0(rid, ENOTSUP);
     652                async_answer_0(rid, ENOTSUP);
    657653                return;
    658654        }
     
    668664                if (lnk == NULL) {
    669665                        fibril_mutex_unlock(&devices_mutex);
    670                         ipc_answer_0(rid, ENOENT);
     666                        async_answer_0(rid, ENOENT);
    671667                        return;
    672668                }
     
    678674                if (!async_data_write_receive(&callid, NULL)) {
    679675                        fibril_mutex_unlock(&devices_mutex);
    680                         ipc_answer_0(callid, EINVAL);
    681                         ipc_answer_0(rid, EINVAL);
     676                        async_answer_0(callid, EINVAL);
     677                        async_answer_0(rid, EINVAL);
    682678                        return;
    683679                }
     
    690686               
    691687                /* Forward the IPC_M_DATA_WRITE request to the driver */
    692                 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);
    693689               
    694690                fibril_mutex_unlock(&devices_mutex);
     
    700696               
    701697                /* Driver reply is the final result of the whole operation */
    702                 ipc_answer_1(rid, rc, bytes);
    703                 return;
    704         }
    705        
    706         ipc_answer_0(rid, ENOENT);
     698                async_answer_1(rid, rc, bytes);
     699                return;
     700        }
     701       
     702        async_answer_0(rid, ENOENT);
    707703}
    708704
    709705void devfs_truncate(ipc_callid_t rid, ipc_call_t *request)
    710706{
    711         ipc_answer_0(rid, ENOTSUP);
     707        async_answer_0(rid, ENOTSUP);
    712708}
    713709
     
    717713       
    718714        if (index == 0) {
    719                 ipc_answer_0(rid, EOK);
     715                async_answer_0(rid, EOK);
    720716                return;
    721717        }
     
    725721        if (type == DEV_HANDLE_NAMESPACE) {
    726722                /* Namespace directory */
    727                 ipc_answer_0(rid, EOK);
     723                async_answer_0(rid, EOK);
    728724                return;
    729725        }
     
    738734                if (lnk == NULL) {
    739735                        fibril_mutex_unlock(&devices_mutex);
    740                         ipc_answer_0(rid, ENOENT);
     736                        async_answer_0(rid, ENOENT);
    741737                        return;
    742738                }
     
    747743               
    748744                if (dev->refcount == 0) {
    749                         ipc_hangup(dev->phone);
     745                        async_hangup(dev->phone);
    750746                        hash_table_remove(&devices, key, DEVICES_KEYS);
    751747                }
     
    753749                fibril_mutex_unlock(&devices_mutex);
    754750               
    755                 ipc_answer_0(rid, EOK);
    756                 return;
    757         }
    758        
    759         ipc_answer_0(rid, ENOENT);
     751                async_answer_0(rid, EOK);
     752                return;
     753        }
     754       
     755        async_answer_0(rid, ENOENT);
    760756}
    761757
     
    765761       
    766762        if (index == 0) {
    767                 ipc_answer_0(rid, EOK);
     763                async_answer_0(rid, EOK);
    768764                return;
    769765        }
     
    773769        if (type == DEV_HANDLE_NAMESPACE) {
    774770                /* Namespace directory */
    775                 ipc_answer_0(rid, EOK);
     771                async_answer_0(rid, EOK);
    776772                return;
    777773        }
     
    786782                if (lnk == NULL) {
    787783                        fibril_mutex_unlock(&devices_mutex);
    788                         ipc_answer_0(rid, ENOENT);
     784                        async_answer_0(rid, ENOENT);
    789785                        return;
    790786                }
     
    805801               
    806802                /* Driver reply is the final result of the whole operation */
    807                 ipc_answer_0(rid, rc);
    808                 return;
    809         }
    810        
    811         ipc_answer_0(rid, ENOENT);
     803                async_answer_0(rid, rc);
     804                return;
     805        }
     806       
     807        async_answer_0(rid, ENOENT);
    812808}
    813809
    814810void devfs_destroy(ipc_callid_t rid, ipc_call_t *request)
    815811{
    816         ipc_answer_0(rid, ENOTSUP);
     812        async_answer_0(rid, ENOTSUP);
    817813}
    818814
Note: See TracChangeset for help on using the changeset viewer.