Changeset 79ae36dd in mainline for uspace/srv/fs/tmpfs/tmpfs.c


Ignore:
Timestamp:
2011-06-08T19:01:55Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0eff68e
Parents:
764d71e
Message:

new async framework with integrated exchange tracking

  • strict isolation between low-level IPC and high-level async framework with integrated exchange tracking
    • each IPC connection is represented by an async_sess_t structure
    • each IPC exchange is represented by an async_exch_t structure
    • exchange management is either based on atomic messages (EXCHANGE_ATOMIC), locking (EXCHANGE_SERIALIZE) or connection cloning (EXCHANGE_CLONE)
  • async_obsolete: temporary compatibility layer to keep old async clients working (several pieces of code are currently broken, but only non-essential functionality)
  • IPC_M_PHONE_HANGUP is now method no. 0 (for elegant boolean evaluation)
  • IPC_M_DEBUG_ALL has been renamed to IPC_M_DEBUG
  • IPC_M_PING has been removed (VFS protocol now has VFS_IN_PING)
  • console routines in libc have been rewritten for better abstraction
  • additional use for libc-private header files (FILE structure opaque to the client)
  • various cstyle changes (typos, indentation, missing externs in header files, improved comments, etc.)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/tmpfs/tmpfs.c

    r764d71e r79ae36dd  
    3030/** @addtogroup fs
    3131 * @{
    32  */ 
     32 */
    3333
    3434/**
     
    4343#include "tmpfs.h"
    4444#include <ipc/services.h>
    45 #include <ipc/ns.h>
     45#include <ns.h>
    4646#include <async.h>
    4747#include <errno.h>
     
    9494       
    9595        dprintf(NAME ": connection opened\n");
    96         while (1) {
    97                 ipc_callid_t callid;
     96       
     97        while (true) {
    9898                ipc_call_t call;
    99        
    100                 callid = async_get_call(&call);
    101                 switch  (IPC_GET_IMETHOD(call)) {
    102                 case IPC_M_PHONE_HUNGUP:
     99                ipc_callid_t callid = async_get_call(&call);
     100               
     101                if (!IPC_GET_IMETHOD(call))
    103102                        return;
     103               
     104                switch (IPC_GET_IMETHOD(call)) {
    104105                case VFS_OUT_MOUNTED:
    105106                        tmpfs_mounted(callid, &call);
     
    151152{
    152153        printf(NAME ": HelenOS TMPFS file system server\n");
    153 
     154       
    154155        if (!tmpfs_init()) {
    155156                printf(NAME ": failed to initialize TMPFS\n");
    156157                return -1;
    157158        }
    158 
    159         int vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
    160         if (vfs_phone < EOK) {
     159       
     160        async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
     161            SERVICE_VFS, 0, 0);
     162        if (!vfs_sess) {
    161163                printf(NAME ": Unable to connect to VFS\n");
    162164                return -1;
    163165        }
    164 
    165         int rc = fs_register(vfs_phone, &tmpfs_reg, &tmpfs_vfs_info,
     166       
     167        int rc = fs_register(vfs_sess, &tmpfs_reg, &tmpfs_vfs_info,
    166168            tmpfs_connection);
    167169        if (rc != EOK) {
     
    169171                return rc;
    170172        }
    171 
     173       
    172174        printf(NAME ": Accepting connections\n");
    173175        task_retval(0);
    174176        async_manager();
    175         /* not reached */
     177       
     178        /* Not reached */
    176179        return 0;
    177180}
     
    179182/**
    180183 * @}
    181  */ 
     184 */
Note: See TracChangeset for help on using the changeset viewer.