Changeset 64b67c3 in mainline


Ignore:
Timestamp:
2008-05-18T21:58:54Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
92f9baca
Parents:
ce7311fc
Message:

Make VFS_MOUNT call even when mounting the root file system.

Location:
uspace/srv
Files:
4 edited

Legend:

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

    rce7311fc r64b67c3  
    5959                [IPC_METHOD_TO_VFS_OP(VFS_WRITE)] = VFS_OP_DEFINED,
    6060                [IPC_METHOD_TO_VFS_OP(VFS_TRUNCATE)] = VFS_OP_DEFINED,
    61                 [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_NULL,
     61                [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_DEFINED,
    6262                [IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_NULL,
    6363                [IPC_METHOD_TO_VFS_OP(VFS_DESTROY)] = VFS_OP_DEFINED,
     
    104104                callid = async_get_call(&call);
    105105                switch  (IPC_GET_METHOD(call)) {
     106                case VFS_MOUNT:
     107                        tmpfs_mount(callid, &call);
     108                        break;
    106109                case VFS_LOOKUP:
    107110                        tmpfs_lookup(callid, &call);
  • uspace/srv/fs/tmpfs/tmpfs.h

    rce7311fc r64b67c3  
    6161extern fs_reg_t tmpfs_reg;
    6262
     63extern void tmpfs_mount(ipc_callid_t, ipc_call_t *);
    6364extern void tmpfs_lookup(ipc_callid_t, ipc_call_t *);
    6465extern void tmpfs_read(ipc_callid_t, ipc_call_t *);
  • uspace/srv/fs/tmpfs/tmpfs_ops.c

    rce7311fc r64b67c3  
    394394}
    395395
     396void tmpfs_mount(ipc_callid_t rid, ipc_call_t *request)
     397{
     398        dev_handle_t mr_dev_handle = (dev_handle_t)IPC_GET_ARG1(*request);
     399        fs_index_t mr_index = (fs_index_t)IPC_GET_ARG2(*request);
     400        fs_handle_t mp_fs_handle = (fs_handle_t)IPC_GET_ARG3(*request);
     401        dev_handle_t mp_dev_handle = (dev_handle_t)IPC_GET_ARG4(*request);
     402        fs_index_t mp_index = (fs_index_t)IPC_GET_ARG5(*request);
     403        if ((mr_index == root->index) &&
     404            (mp_fs_handle == tmpfs_reg.fs_handle) &&
     405            (mp_index == mr_index))
     406                ipc_answer_0(rid, EOK);
     407        else
     408                ipc_answer_0(rid, ENOTSUP);
     409}
     410
    396411void tmpfs_lookup(ipc_callid_t rid, ipc_call_t *request)
    397412{
  • uspace/srv/vfs/vfs_ops.c

    rce7311fc r64b67c3  
    8686        vfs_node_t *mp_node = NULL;
    8787        int rc;
     88        int phone;
    8889
    8990        /*
     
    226227                /* We still don't have the root file system mounted. */
    227228                if ((size == 1) && (buf[0] == '/')) {
    228                         /* For this simple, but important case, we are done. */
    229                         rootfs = mr_res.triplet;
     229                        /*
     230                         * For this simple, but important case,
     231                         * we are almost done.
     232                         */
     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
    230250                        futex_up(&rootfs_futex);
    231                         free(buf);
    232                         ipc_answer_0(rid, EOK);
     251                        ipc_answer_0(rid, rc);
    233252                        return;
    234253                } else {
     
    258277         * Add more IPC parameters so that we can send mount mode/flags.
    259278         */
    260         int phone = vfs_grab_phone(mp_res.triplet.fs_handle);
     279        phone = vfs_grab_phone(mp_res.triplet.fs_handle);
    261280        rc = async_req_5_0(phone, VFS_MOUNT,
    262281            (ipcarg_t) mp_res.triplet.dev_handle,
Note: See TracChangeset for help on using the changeset viewer.