Changeset 4f9ab1e in mainline
- Timestamp:
- 2017-03-18T14:25:47Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f6b6b40
- Parents:
- 7f59d6c
- Location:
- uspace/srv/vfs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_lookup.c
r7f59d6c r4f9ab1e 314 314 if (nlen > 0) { 315 315 base = vfs_node_peek(&res); 316 if ( base == NULL || base->mount == NULL) {316 if (!base) { 317 317 rc = ENOENT; 318 318 goto out; 319 319 } 320 if (!base->mount) { 321 vfs_node_put(base); 322 rc = ENOENT; 323 goto out; 324 } 325 vfs_node_put(base); 320 326 if (lflag & L_DISABLE_MOUNTS) { 321 327 rc = EXDEV; … … 330 336 if (result != NULL) { 331 337 /* The found file may be a mount point. Try to cross it. */ 332 if (!(lflag & (L_MP |L_DISABLE_MOUNTS))) {338 if (!(lflag & (L_MP | L_DISABLE_MOUNTS))) { 333 339 base = vfs_node_peek(&res); 334 if (base != NULL && base->mount != NULL) { 335 while (base->mount != NULL) { 336 base = base->mount; 340 if (base && base->mount) { 341 while (base->mount) { 342 vfs_node_addref(base->mount); 343 vfs_node_t *nbase = base->mount; 344 vfs_node_put(base); 345 base = nbase; 337 346 } 338 347 339 result->triplet = *( vfs_triplet_t *)base;348 result->triplet = *((vfs_triplet_t *) base); 340 349 result->type = base->type; 341 result->size = base->size; 342 goto out; 343 } 350 result->size = base->size; 351 vfs_node_put(base); 352 goto out; 353 } 354 if (base) 355 vfs_node_put(base); 344 356 } 345 357 -
uspace/srv/vfs/vfs_node.c
r7f59d6c r4f9ab1e 204 204 if (tmp) { 205 205 node = hash_table_get_inst(tmp, vfs_node_t, nh_link); 206 _vfs_node_addref(node); 206 207 } 207 208 fibril_mutex_unlock(&nodes_mutex); -
uspace/srv/vfs/vfs_ops.c
r7f59d6c r4f9ab1e 618 618 619 619 /* If the node is not held by anyone, try to destroy it. */ 620 if (orig_unlinked && vfs_node_peek(&new_lr_orig) == NULL) { 621 out_destroy(&new_lr_orig.triplet); 620 if (orig_unlinked) { 621 vfs_node_t *node = vfs_node_peek(&new_lr_orig); 622 if (!node) 623 out_destroy(&new_lr_orig.triplet); 624 else 625 vfs_node_put(node); 622 626 } 623 627 … … 824 828 } 825 829 826 vfs_node_t *found_node = vfs_node_peek(&lr); 830 vfs_node_t *found_node = vfs_node_peek(&lr); 831 vfs_node_put(found_node); 827 832 if (expect->node != found_node) { 828 833 rc = ENOENT; … … 841 846 842 847 /* If the node is not held by anyone, try to destroy it. */ 843 if (vfs_node_peek(&lr) == NULL) { 848 vfs_node_t *node = vfs_node_peek(&lr); 849 if (!node) 844 850 out_destroy(&lr.triplet); 845 } 851 else 852 vfs_node_put(node); 846 853 847 854 exit:
Note:
See TracChangeset
for help on using the changeset viewer.