Changeset f17667a in mainline for uspace/srv/fs/tmpfs
- Timestamp:
- 2008-02-17T13:32:53Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2616965d
- Parents:
- b5553a2
- Location:
- uspace/srv/fs/tmpfs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/tmpfs/tmpfs.c
rb5553a2 rf17667a 56 56 .ops = { 57 57 [IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] = VFS_OP_DEFINED, 58 [IPC_METHOD_TO_VFS_OP(VFS_OPEN)] = VFS_OP_DEFINED,59 [IPC_METHOD_TO_VFS_OP(VFS_CLOSE)] = VFS_OP_DEFINED,60 58 [IPC_METHOD_TO_VFS_OP(VFS_READ)] = VFS_OP_DEFINED, 61 59 [IPC_METHOD_TO_VFS_OP(VFS_WRITE)] = VFS_OP_DEFINED, 62 [IPC_METHOD_TO_VFS_OP(VFS_TRUNCATE)] = VFS_OP_NULL, 63 [IPC_METHOD_TO_VFS_OP(VFS_RENAME)] = VFS_OP_NULL, 64 [IPC_METHOD_TO_VFS_OP(VFS_OPENDIR)] = VFS_OP_NULL, 65 [IPC_METHOD_TO_VFS_OP(VFS_READDIR)] = VFS_OP_NULL, 66 [IPC_METHOD_TO_VFS_OP(VFS_CLOSEDIR)] = VFS_OP_NULL, 67 [IPC_METHOD_TO_VFS_OP(VFS_UNLINK)] = VFS_OP_NULL, 60 [IPC_METHOD_TO_VFS_OP(VFS_TRUNCATE)] = VFS_OP_DEFINED, 68 61 [IPC_METHOD_TO_VFS_OP(VFS_MOUNT)] = VFS_OP_NULL, 69 62 [IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] = VFS_OP_NULL, 63 [IPC_METHOD_TO_VFS_OP(VFS_FREE)] = VFS_OP_DEFINED, 70 64 } 71 65 }; … … 119 113 tmpfs_write(callid, &call); 120 114 break; 115 case VFS_TRUNCATE: 116 tmpfs_truncate(callid, &call); 117 break; 118 case VFS_FREE: 119 tmpfs_free(callid, &call); 120 break; 121 121 default: 122 122 ipc_answer_0(callid, ENOTSUP); -
uspace/srv/fs/tmpfs/tmpfs.h
rb5553a2 rf17667a 65 65 extern void tmpfs_write(ipc_callid_t, ipc_call_t *); 66 66 extern void tmpfs_truncate(ipc_callid_t, ipc_call_t *); 67 extern void tmpfs_free(ipc_callid_t, ipc_call_t *); 67 68 68 69 #endif -
uspace/srv/fs/tmpfs/tmpfs_ops.c
rb5553a2 rf17667a 497 497 } 498 498 499 void tmpfs_free(ipc_callid_t rid, ipc_call_t *request) 500 { 501 int dev_handle = IPC_GET_ARG1(*request); 502 unsigned long index = IPC_GET_ARG2(*request); 503 504 link_t *hlp; 505 hlp = hash_table_find(&dentries, &index); 506 if (!hlp) { 507 ipc_answer_0(rid, ENOENT); 508 return; 509 } 510 tmpfs_dentry_t *dentry = hash_table_get_instance(hlp, tmpfs_dentry_t, 511 dh_link); 512 513 assert(!dentry->parent); 514 assert(!dentry->child); 515 assert(!dentry->sibling); 516 517 if (dentry->type == TMPFS_FILE) 518 free(dentry->data); 519 free(dentry->name); 520 free(dentry); 521 522 ipc_answer_0(rid, EOK); 523 } 524 499 525 /** 500 526 * @}
Note:
See TracChangeset
for help on using the changeset viewer.