Changeset d60ce4a in mainline for uspace/srv/vfs/vfs_ops.c
- Timestamp:
- 2013-07-25T12:56:08Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bf9dc4e2
- Parents:
- d18c404
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.