Subversion Repositories HelenOS

Rev

Rev 4563 | Rev 4584 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4563 Rev 4566
Line 41... Line 41...
41
#include <errno.h>
41
#include <errno.h>
42
#include <stdio.h>
42
#include <stdio.h>
43
#include <bool.h>
43
#include <bool.h>
44
#include <string.h>
44
#include <string.h>
45
#include <as.h>
45
#include <as.h>
46
#include <adt/list.h>
-
 
47
#include <atomic.h>
46
#include <atomic.h>
48
#include <assert.h>
-
 
49
#include "vfs.h"
47
#include "vfs.h"
50
 
48
 
51
#define NAME "vfs"
49
#define NAME "vfs"
52
 
50
 
53
static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall)
51
static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall)
Line 139... Line 137...
139
int main(int argc, char **argv)
137
int main(int argc, char **argv)
140
{
138
{
141
    printf(NAME ": HelenOS VFS server\n");
139
    printf(NAME ": HelenOS VFS server\n");
142
   
140
   
143
    /*
141
    /*
144
     * Initialize the list of registered file systems.
-
 
145
     */
-
 
146
    list_initialize(&fs_head);
-
 
147
   
-
 
148
    /*
-
 
149
     * Initialize VFS node hash table.
142
     * Initialize VFS node hash table.
150
     */
143
     */
151
    if (!vfs_nodes_init()) {
144
    if (!vfs_nodes_init()) {
152
        printf(NAME ": Failed to initialize VFS node hash table\n");
145
        printf(NAME ": Failed to initialize VFS node hash table\n");
153
        return ENOMEM;
146
        return ENOMEM;
154
    }
147
    }
155
   
148
   
156
    /*
149
    /*
157
     * Allocate and initialize the Path Lookup Buffer.
150
     * Allocate and initialize the Path Lookup Buffer.
158
     */
151
     */
159
    list_initialize(&plb_head);
-
 
160
    plb = as_get_mappable_page(PLB_SIZE);
152
    plb = as_get_mappable_page(PLB_SIZE);
161
    if (!plb) {
153
    if (!plb) {
162
        printf(NAME ": Cannot allocate a mappable piece of address space\n");
154
        printf(NAME ": Cannot allocate a mappable piece of address space\n");
163
        return ENOMEM;
155
        return ENOMEM;
164
    }
156
    }
Line 174... Line 166...
174
     * Set a connection handling function/fibril.
166
     * Set a connection handling function/fibril.
175
     */
167
     */
176
    async_set_client_connection(vfs_connection);
168
    async_set_client_connection(vfs_connection);
177
 
169
 
178
    /*
170
    /*
179
     * Add a fibril for handling pending mounts.
-
 
180
     */
-
 
181
    fid_t fid = fibril_create(vfs_process_pending_mount, NULL);
-
 
182
    assert(fid);
-
 
183
    fibril_add_ready(fid);
-
 
184
   
-
 
185
    /*
-
 
186
     * Register at the naming service.
171
     * Register at the naming service.
187
     */
172
     */
188
    ipcarg_t phonead;
173
    ipcarg_t phonead;
189
    ipc_connect_to_me(PHONE_NS, SERVICE_VFS, 0, 0, &phonead);
174
    ipc_connect_to_me(PHONE_NS, SERVICE_VFS, 0, 0, &phonead);
190
   
175