Changes in uspace/srv/vfs/vfs.c [9934f7d:0fe52ef] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs.c

    r9934f7d r0fe52ef  
    3636 */
    3737
     38#include <vfs/vfs.h>
    3839#include <ipc/services.h>
     40#include <abi/ipc/event.h>
     41#include <event.h>
    3942#include <ns.h>
    4043#include <async.h>
     
    4548#include <as.h>
    4649#include <atomic.h>
     50#include <macros.h>
    4751#include "vfs.h"
    4852
    4953#define NAME  "vfs"
     54
     55enum {
     56        VFS_TASK_STATE_CHANGE
     57};
    5058
    5159static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
     
    8088                        vfs_open(callid, &call);
    8189                        break;
    82                 case VFS_IN_OPEN_NODE:
    83                         vfs_open_node(callid, &call);
    84                         break;
    8590                case VFS_IN_CLOSE:
    8691                        vfs_close(callid, &call);
     
    118123                case VFS_IN_DUP:
    119124                        vfs_dup(callid, &call);
     125                        break;
     126                case VFS_IN_WAIT_HANDLE:
     127                        vfs_wait_handle(callid, &call);
     128                        break;
    120129                default:
    121130                        async_answer_0(callid, ENOTSUP);
     
    128137         * connection fibril terminates.
    129138         */
     139}
     140
     141static void notification_received(ipc_callid_t callid, ipc_call_t *call)
     142{
     143        switch (IPC_GET_IMETHOD(*call)) {
     144        case VFS_TASK_STATE_CHANGE:
     145                if (IPC_GET_ARG1(*call) == VFS_PASS_HANDLE)
     146                        vfs_pass_handle(
     147                            (task_id_t) MERGE_LOUP32(IPC_GET_ARG4(*call),
     148                            IPC_GET_ARG5(*call)), call->in_task_id,
     149                            (int) IPC_GET_ARG2(*call));
     150                break;
     151        default:
     152                break;
     153        }
    130154}
    131155
     
    170194
    171195        /*
     196         * Set notification handler and subscribe to notifications.
     197         */
     198        async_set_interrupt_received(notification_received);
     199        event_task_subscribe(EVENT_TASK_STATE_CHANGE, VFS_TASK_STATE_CHANGE);
     200
     201        /*
    172202         * Register at the naming service.
    173203         */
Note: See TracChangeset for help on using the changeset viewer.