Changeset f49b0ea in mainline for uspace/srv/fs/tmpfs
- Timestamp:
- 2008-06-06T15:16:41Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cde485d
- Parents:
- f86c184
- Location:
- uspace/srv/fs/tmpfs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/tmpfs/tmpfs.c
rf86c184 rf49b0ea 62 62 [IPC_METHOD_TO_VFS_OP(VFS_TRUNCATE)] = VFS_OP_DEFINED, 63 63 [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_DEFINED, 64 [IPC_METHOD_TO_VFS_OP(VFS_MOUNTED)] = VFS_OP_DEFINED, 64 65 [IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_NULL, 65 66 [IPC_METHOD_TO_VFS_OP(VFS_DESTROY)] = VFS_OP_DEFINED, … … 106 107 callid = async_get_call(&call); 107 108 switch (IPC_GET_METHOD(call)) { 109 case VFS_MOUNTED: 110 tmpfs_mounted(callid, &call); 111 break; 108 112 case VFS_MOUNT: 109 113 tmpfs_mount(callid, &call); -
uspace/srv/fs/tmpfs/tmpfs.h
rf86c184 rf49b0ea 41 41 #include <libadt/hash_table.h> 42 42 43 #ifndef dprintf 43 44 #define dprintf(...) printf(__VA_ARGS__) 45 #endif 44 46 45 47 typedef struct tmpfs_dentry { … … 63 65 extern libfs_ops_t tmpfs_libfs_ops; 64 66 67 extern void tmpfs_mounted(ipc_callid_t, ipc_call_t *); 65 68 extern void tmpfs_mount(ipc_callid_t, ipc_call_t *); 66 69 extern void tmpfs_lookup(ipc_callid_t, ipc_call_t *); -
uspace/srv/fs/tmpfs/tmpfs_ops.c
rf86c184 rf49b0ea 394 394 } 395 395 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 { 396 void 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 421 400 /* Initialize TMPFS. */ 422 401 if (!root && !tmpfs_init()) { … … 424 403 return; 425 404 } 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 416 void 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 426 void tmpfs_lookup(ipc_callid_t rid, ipc_call_t *request) 427 { 426 428 libfs_lookup(&tmpfs_libfs_ops, tmpfs_reg.fs_handle, rid, request); 427 429 }
Note:
See TracChangeset
for help on using the changeset viewer.