Changeset f49b0ea in mainline for uspace/srv/fs/tmpfs/tmpfs_ops.c


Ignore:
Timestamp:
2008-06-06T15:16:41Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cde485d
Parents:
f86c184
Message:

Split the 'mount another filesystem here' and 'you are being mounted and the
device is this' mount semantics. Add VFS_MOUNTED VFS operation that corresponds
to the latter and reserve VFS_MOUNT only for the former. Because of this
change, the VFS server does not maintain the mr_node VFS node for the name space
root anymore and the VFS_LOOKUP operation is now not meant to be used on
unmounted file system, not even for looking up the root node of unmounted file
systems. In the light of these changes, TMPFS is now initialized from
tmpfs_mounted() function.

File:
1 edited

Legend:

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

    rf86c184 rf49b0ea  
    394394}
    395395
    396 void 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        
    404         if ((mr_index == root->index) &&
    405                 (mp_fs_handle == tmpfs_reg.fs_handle) &&
    406                 (mp_index == mr_index)) {
    407                
    408                 if (mr_dev_handle >= 0) {
    409                         if (tmpfs_restore(mr_dev_handle))
    410                                 ipc_answer_0(rid, EOK);
    411                         else
    412                                 ipc_answer_0(rid, ELIMIT);
    413                 } else
    414                         ipc_answer_0(rid, EOK);
    415         } else
    416                 ipc_answer_0(rid, ENOTSUP);
    417 }
    418 
    419 void tmpfs_lookup(ipc_callid_t rid, ipc_call_t *request)
    420 {
     396void tmpfs_mounted(ipc_callid_t rid, ipc_call_t *request)
     397{
     398        dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
     399
    421400        /* Initialize TMPFS. */
    422401        if (!root && !tmpfs_init()) {
     
    424403                return;
    425404        }
     405
     406        if (dev_handle >= 0) {
     407                if (tmpfs_restore(dev_handle))
     408                        ipc_answer_0(rid, EOK);
     409                else
     410                        ipc_answer_0(rid, ELIMIT);
     411        } else {
     412                        ipc_answer_0(rid, EOK);
     413        }
     414}
     415
     416void tmpfs_mount(ipc_callid_t rid, ipc_call_t *request)
     417{
     418        dev_handle_t mp_dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
     419        fs_index_t mp_index = (fs_index_t) IPC_GET_ARG2(*request);
     420        fs_handle_t mr_fs_handle = (fs_handle_t) IPC_GET_ARG3(*request);
     421        dev_handle_t mr_dev_handle = (dev_handle_t) IPC_GET_ARG4(*request);
     422       
     423        ipc_answer_0(rid, ENOTSUP);
     424}
     425
     426void tmpfs_lookup(ipc_callid_t rid, ipc_call_t *request)
     427{
    426428        libfs_lookup(&tmpfs_libfs_ops, tmpfs_reg.fs_handle, rid, request);
    427429}
Note: See TracChangeset for help on using the changeset viewer.