Changeset 4f46695e in mainline
- Timestamp:
- 2009-05-09T08:39:28Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cf95bc0
- Parents:
- f4876df
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libfs/libfs.c
rf4876df r4f46695e 217 217 } 218 218 goto out; 219 } else if (lflag & L_PARENT) {220 /* return parent */221 ipc_answer_5(rid, EOK, fs_handle, dev_handle,222 ops->index_get(cur), ops->size_get(cur),223 ops->lnkcnt_get(cur));224 219 } 225 220 ipc_answer_0(rid, ENOENT); … … 294 289 295 290 /* handle hit */ 296 if (lflag & L_PARENT) {297 ops->node_put(cur);298 cur = par;299 par = NULL;300 if (!cur) {301 ipc_answer_0(rid, ENOENT);302 goto out;303 }304 }305 291 if (lflag & L_UNLINK) { 306 292 unsigned old_lnkcnt = ops->lnkcnt_get(cur); -
uspace/srv/vfs/vfs.h
rf4876df r4f46695e 167 167 */ 168 168 #define L_UNLINK 32 169 /**170 * L_PARENT performs a lookup but returns the triplet of the parent node.171 * This flag may not be combined with any other lookup flag.172 */173 #define L_PARENT 64174 169 175 170 typedef enum vfs_node_type { -
uspace/srv/vfs/vfs_ops.c
rf4876df r4f46695e 990 990 return; 991 991 } 992 /* Determine the path to the parent of the node with the new name. */ 993 char *parentc = str_dup(newc); 994 if (!parentc) { 995 rwlock_write_unlock(&namespace_rwlock); 996 ipc_answer_0(rid, rc); 997 free(old); 998 free(new); 999 return; 1000 } 1001 char *lastsl = str_rchr(parentc + 1, L'/'); 1002 if (lastsl) 1003 *lastsl = '\0'; 1004 else 1005 parentc[1] = '\0'; 992 1006 /* Lookup parent of the new file name. */ 993 rc = vfs_lookup_internal(newc, L_PARENT, &new_par_lr, NULL); 1007 rc = vfs_lookup_internal(parentc, L_NONE, &new_par_lr, NULL); 1008 free(parentc); /* not needed anymore */ 994 1009 if (rc != EOK) { 995 1010 rwlock_write_unlock(&namespace_rwlock);
Note:
See TracChangeset
for help on using the changeset viewer.