Subversion Repositories HelenOS

Rev

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

Rev 2957 Rev 2958
Line 83... Line 83...
83
void vfs_mount(ipc_callid_t rid, ipc_call_t *request)
83
void vfs_mount(ipc_callid_t rid, ipc_call_t *request)
84
{
84
{
85
    dev_handle_t dev_handle;
85
    dev_handle_t dev_handle;
86
    vfs_node_t *mp_node = NULL;
86
    vfs_node_t *mp_node = NULL;
87
    int rc;
87
    int rc;
-
 
88
    int phone;
88
 
89
 
89
    /*
90
    /*
90
     * We expect the library to do the device-name to device-handle
91
     * We expect the library to do the device-name to device-handle
91
     * translation for us, thus the device handle will arrive as ARG1
92
     * translation for us, thus the device handle will arrive as ARG1
92
     * in the request.
93
     * in the request.
Line 223... Line 224...
223
         */
224
         */
224
        rwlock_write_unlock(&namespace_rwlock);
225
        rwlock_write_unlock(&namespace_rwlock);
225
    } else {
226
    } else {
226
        /* We still don't have the root file system mounted. */
227
        /* We still don't have the root file system mounted. */
227
        if ((size == 1) && (buf[0] == '/')) {
228
        if ((size == 1) && (buf[0] == '/')) {
-
 
229
            /*
228
            /* For this simple, but important case, we are done. */
230
             * For this simple, but important case,
229
            rootfs = mr_res.triplet;
231
             * we are almost done.
230
            futex_up(&rootfs_futex);
232
             */
231
            free(buf);
233
            free(buf);
-
 
234
           
-
 
235
            /* Inform the mount point about the root mount. */
-
 
236
            phone = vfs_grab_phone(mr_res.triplet.fs_handle);
-
 
237
            rc = async_req_5_0(phone, VFS_MOUNT,
-
 
238
                (ipcarg_t) mr_res.triplet.dev_handle,
-
 
239
                (ipcarg_t) mr_res.triplet.index,
-
 
240
                (ipcarg_t) mr_res.triplet.fs_handle,
-
 
241
                (ipcarg_t) mr_res.triplet.dev_handle,
-
 
242
                (ipcarg_t) mr_res.triplet.index);
-
 
243
            vfs_release_phone(phone);
-
 
244
 
-
 
245
            if (rc == EOK)
-
 
246
                rootfs = mr_res.triplet;
-
 
247
            else
-
 
248
                vfs_node_put(mr_node);
-
 
249
 
-
 
250
            futex_up(&rootfs_futex);
232
            ipc_answer_0(rid, EOK);
251
            ipc_answer_0(rid, rc);
233
            return;
252
            return;
234
        } else {
253
        } else {
235
            /*
254
            /*
236
             * We can't resolve this without the root filesystem
255
             * We can't resolve this without the root filesystem
237
             * being mounted first.
256
             * being mounted first.
Line 255... Line 274...
255
 
274
 
256
    /**
275
    /**
257
     * @todo
276
     * @todo
258
     * Add more IPC parameters so that we can send mount mode/flags.
277
     * Add more IPC parameters so that we can send mount mode/flags.
259
     */
278
     */
260
    int phone = vfs_grab_phone(mp_res.triplet.fs_handle);
279
    phone = vfs_grab_phone(mp_res.triplet.fs_handle);
261
    rc = async_req_5_0(phone, VFS_MOUNT,
280
    rc = async_req_5_0(phone, VFS_MOUNT,
262
        (ipcarg_t) mp_res.triplet.dev_handle,
281
        (ipcarg_t) mp_res.triplet.dev_handle,
263
        (ipcarg_t) mp_res.triplet.index,
282
        (ipcarg_t) mp_res.triplet.index,
264
        (ipcarg_t) mr_res.triplet.fs_handle,
283
        (ipcarg_t) mr_res.triplet.fs_handle,
265
        (ipcarg_t) mr_res.triplet.dev_handle,
284
        (ipcarg_t) mr_res.triplet.dev_handle,