Ignore:
File:
1 edited

Legend:

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

    r852b801 rffa2c8ef  
    3838
    3939#include "fat.h"
    40 #include <ipc/ipc.h>
    4140#include <ipc/services.h>
     41#include <ipc/ns.h>
    4242#include <async.h>
    4343#include <errno.h>
    4444#include <unistd.h>
     45#include <task.h>
    4546#include <stdio.h>
    4647#include <libfs.h>
    4748#include "../../vfs/vfs.h"
    4849
     50#define NAME    "fat"
    4951
    5052vfs_info_t fat_vfs_info = {
    51         .name = "fat",
     53        .name = NAME,
     54        .concurrent_read_write = false,
     55        .write_retains_size = false,   
    5256};
    5357
     
    8084                 * created by IPC_M_CONNECT_TO_ME.
    8185                 */
    82                 ipc_answer_0(iid, EOK);
     86                async_answer_0(iid, EOK);
    8387        }
    8488       
    85         dprintf("VFS-FAT connection established.\n");
     89        dprintf(NAME ": connection opened\n");
    8690        while (1) {
    8791                ipc_callid_t callid;
     
    8993       
    9094                callid = async_get_call(&call);
    91                 switch  (IPC_GET_METHOD(call)) {
     95                switch  (IPC_GET_IMETHOD(call)) {
    9296                case IPC_M_PHONE_HUNGUP:
    9397                        return;
     
    97101                case VFS_OUT_MOUNT:
    98102                        fat_mount(callid, &call);
     103                        break;
     104                case VFS_OUT_UNMOUNTED:
     105                        fat_unmounted(callid, &call);
     106                        break;
     107                case VFS_OUT_UNMOUNT:
     108                        fat_unmount(callid, &call);
    99109                        break;
    100110                case VFS_OUT_LOOKUP:
     
    126136                        break;
    127137                default:
    128                         ipc_answer_0(callid, ENOTSUP);
     138                        async_answer_0(callid, ENOTSUP);
    129139                        break;
    130140                }
     
    137147        int rc;
    138148
    139         printf("fat: HelenOS FAT file system server.\n");
     149        printf(NAME ": HelenOS FAT file system server\n");
    140150
    141151        rc = fat_idx_init();
     
    143153                goto err;
    144154
    145         vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0);
     155        vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
    146156        if (vfs_phone < EOK) {
    147                 printf("fat: failed to connect to VFS\n");
     157                printf(NAME ": failed to connect to VFS\n");
    148158                return -1;
    149159        }
     
    155165        }
    156166       
    157         dprintf("FAT filesystem registered, fs_handle=%d.\n",
    158             fat_reg.fs_handle);
    159 
     167        printf(NAME ": Accepting connections\n");
     168        task_retval(0);
    160169        async_manager();
    161170        /* not reached */
     
    163172
    164173err:
    165         printf("Failed to register the FAT file system (%d)\n", rc);
     174        printf(NAME ": Failed to register file system (%d)\n", rc);
    166175        return rc;
    167176}
Note: See TracChangeset for help on using the changeset viewer.