Changeset 79ae36dd in mainline for uspace/srv/fs/ext2fs/ext2fs.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/ext2fs/ext2fs.c

    r764d71e r79ae36dd  
    4040#include "ext2fs.h"
    4141#include <ipc/services.h>
    42 #include <ipc/ns.h>
     42#include <ns.h>
    4343#include <async.h>
    4444#include <errno.h>
     
    8787       
    8888        dprintf(NAME ": connection opened\n");
    89         while (1) {
    90                 ipc_callid_t callid;
     89        while (true) {
    9190                ipc_call_t call;
    92        
    93                 callid = async_get_call(&call);
    94                 switch  (IPC_GET_IMETHOD(call)) {
    95                 case IPC_M_PHONE_HUNGUP:
     91                ipc_callid_t callid = async_get_call(&call);
     92               
     93                if (!IPC_GET_IMETHOD(call))
    9694                        return;
     95               
     96                switch (IPC_GET_IMETHOD(call)) {
    9797                case VFS_OUT_MOUNTED:
    9898                        ext2fs_mounted(callid, &call);
     
    143143int main(int argc, char **argv)
    144144{
    145         int vfs_phone;
    146         int rc;
    147 
    148145        printf(NAME ": HelenOS EXT2 file system server\n");
    149 
    150         vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
    151         if (vfs_phone < EOK) {
     146       
     147        async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
     148            SERVICE_VFS, 0, 0);
     149        if (!vfs_sess) {
    152150                printf(NAME ": failed to connect to VFS\n");
    153151                return -1;
    154152        }
    155153
    156         rc = ext2fs_global_init();
     154        int rc = ext2fs_global_init();
    157155        if (rc != EOK) {
    158156                printf(NAME ": Failed global initialization\n");
     
    160158        }       
    161159               
    162         rc = fs_register(vfs_phone, &ext2fs_reg, &ext2fs_vfs_info, ext2fs_connection);
     160        rc = fs_register(vfs_sess, &ext2fs_reg, &ext2fs_vfs_info, ext2fs_connection);
    163161        if (rc != EOK) {
    164162                fprintf(stdout, NAME ": Failed to register fs (%d)\n", rc);
Note: See TracChangeset for help on using the changeset viewer.