Changeset d60ce4a in mainline
- Timestamp:
- 2013-07-25T12:56:08Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bf9dc4e2
- Parents:
- d18c404
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/trace/trace.c
rd18c404 rd60ce4a 714 714 o = oper_new("sync", 1, arg_def, V_ERRNO, 0, resp_def); 715 715 proto_add_oper(p, VFS_IN_SYNC, o); 716 o = oper_new("unlink", 0, arg_def, V_ERRNO, 0, resp_def);717 proto_add_oper(p, VFS_IN_UNLINK, o);718 716 o = oper_new("rename", 0, arg_def, V_ERRNO, 0, resp_def); 719 717 proto_add_oper(p, VFS_IN_RENAME, o); -
uspace/srv/vfs/vfs.c
rd18c404 rd60ce4a 109 109 vfs_fstat(callid, &call); 110 110 break; 111 case VFS_IN_UNLINK:112 vfs_unlink(callid, &call);113 break;114 111 case VFS_IN_UNLINK2: 115 112 vfs_unlink2(callid, &call); -
uspace/srv/vfs/vfs.h
rd18c404 rd60ce4a 219 219 extern void vfs_truncate(ipc_callid_t, ipc_call_t *); 220 220 extern void vfs_fstat(ipc_callid_t, ipc_call_t *); 221 extern void vfs_unlink(ipc_callid_t, ipc_call_t *);222 221 extern void vfs_rename(ipc_callid_t, ipc_call_t *); 223 222 extern void vfs_wait_handle(ipc_callid_t, ipc_call_t *); -
uspace/srv/vfs/vfs_ops.c
rd18c404 rd60ce4a 1063 1063 } 1064 1064 1065 void vfs_unlink(ipc_callid_t rid, ipc_call_t *request)1066 {1067 int lflag = IPC_GET_ARG1(*request);1068 1069 char *path;1070 int rc = async_data_write_accept((void **) &path, true, 0, 0, 0, NULL);1071 if (rc != EOK) {1072 async_answer_0(rid, rc);1073 return;1074 }1075 1076 fibril_rwlock_write_lock(&namespace_rwlock);1077 lflag &= L_DIRECTORY; /* sanitize lflag */1078 vfs_lookup_res_t lr;1079 rc = vfs_lookup_internal(path, lflag | L_UNLINK, &lr, NULL);1080 free(path);1081 if (rc != EOK) {1082 fibril_rwlock_write_unlock(&namespace_rwlock);1083 async_answer_0(rid, rc);1084 return;1085 }1086 1087 /*1088 * The name has already been unlinked by vfs_lookup_internal().1089 * We have to get and put the VFS node to ensure that it is1090 * VFS_OUT_DESTROY'ed after the last reference to it is dropped.1091 */1092 vfs_node_t *node = vfs_node_get(&lr);1093 fibril_mutex_lock(&nodes_mutex);1094 node->lnkcnt--;1095 fibril_mutex_unlock(&nodes_mutex);1096 fibril_rwlock_write_unlock(&namespace_rwlock);1097 vfs_node_put(node);1098 async_answer_0(rid, EOK);1099 }1100 1101 1065 void vfs_unlink2(ipc_callid_t rid, ipc_call_t *request) 1102 1066 {
Note:
See TracChangeset
for help on using the changeset viewer.