/trunk/uspace/srv/fs/tmpfs/tmpfs.h |
---|
60,6 → 60,7 |
extern fs_reg_t tmpfs_reg; |
extern void tmpfs_mount(ipc_callid_t, ipc_call_t *); |
extern void tmpfs_lookup(ipc_callid_t, ipc_call_t *); |
extern void tmpfs_read(ipc_callid_t, ipc_call_t *); |
extern void tmpfs_write(ipc_callid_t, ipc_call_t *); |
/trunk/uspace/srv/fs/tmpfs/tmpfs.c |
---|
58,7 → 58,7 |
[IPC_METHOD_TO_VFS_OP(VFS_READ)] = VFS_OP_DEFINED, |
[IPC_METHOD_TO_VFS_OP(VFS_WRITE)] = VFS_OP_DEFINED, |
[IPC_METHOD_TO_VFS_OP(VFS_TRUNCATE)] = VFS_OP_DEFINED, |
[IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_NULL, |
[IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_DEFINED, |
[IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_NULL, |
[IPC_METHOD_TO_VFS_OP(VFS_DESTROY)] = VFS_OP_DEFINED, |
} |
103,6 → 103,9 |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case VFS_MOUNT: |
tmpfs_mount(callid, &call); |
break; |
case VFS_LOOKUP: |
tmpfs_lookup(callid, &call); |
break; |
/trunk/uspace/srv/fs/tmpfs/tmpfs_ops.c |
---|
393,6 → 393,21 |
return EOK; |
} |
void tmpfs_mount(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t mr_dev_handle = (dev_handle_t)IPC_GET_ARG1(*request); |
fs_index_t mr_index = (fs_index_t)IPC_GET_ARG2(*request); |
fs_handle_t mp_fs_handle = (fs_handle_t)IPC_GET_ARG3(*request); |
dev_handle_t mp_dev_handle = (dev_handle_t)IPC_GET_ARG4(*request); |
fs_index_t mp_index = (fs_index_t)IPC_GET_ARG5(*request); |
if ((mr_index == root->index) && |
(mp_fs_handle == tmpfs_reg.fs_handle) && |
(mp_index == mr_index)) |
ipc_answer_0(rid, EOK); |
else |
ipc_answer_0(rid, ENOTSUP); |
} |
void tmpfs_lookup(ipc_callid_t rid, ipc_call_t *request) |
{ |
/* Initialize TMPFS. */ |
/trunk/uspace/srv/vfs/vfs_ops.c |
---|
85,6 → 85,7 |
dev_handle_t dev_handle; |
vfs_node_t *mp_node = NULL; |
int rc; |
int phone; |
/* |
* We expect the library to do the device-name to device-handle |
225,11 → 226,29 |
} else { |
/* We still don't have the root file system mounted. */ |
if ((size == 1) && (buf[0] == '/')) { |
/* For this simple, but important case, we are done. */ |
/* |
* For this simple, but important case, |
* we are almost done. |
*/ |
free(buf); |
/* Inform the mount point about the root mount. */ |
phone = vfs_grab_phone(mr_res.triplet.fs_handle); |
rc = async_req_5_0(phone, VFS_MOUNT, |
(ipcarg_t) mr_res.triplet.dev_handle, |
(ipcarg_t) mr_res.triplet.index, |
(ipcarg_t) mr_res.triplet.fs_handle, |
(ipcarg_t) mr_res.triplet.dev_handle, |
(ipcarg_t) mr_res.triplet.index); |
vfs_release_phone(phone); |
if (rc == EOK) |
rootfs = mr_res.triplet; |
else |
vfs_node_put(mr_node); |
futex_up(&rootfs_futex); |
free(buf); |
ipc_answer_0(rid, EOK); |
ipc_answer_0(rid, rc); |
return; |
} else { |
/* |
257,7 → 276,7 |
* @todo |
* Add more IPC parameters so that we can send mount mode/flags. |
*/ |
int phone = vfs_grab_phone(mp_res.triplet.fs_handle); |
phone = vfs_grab_phone(mp_res.triplet.fs_handle); |
rc = async_req_5_0(phone, VFS_MOUNT, |
(ipcarg_t) mp_res.triplet.dev_handle, |
(ipcarg_t) mp_res.triplet.index, |