Changeset cac458f in mainline for uspace/srv/fs/tmpfs/tmpfs_ops.c
- Timestamp:
- 2011-06-22T01:59:39Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 41e2118
- Parents:
- 79506d6 (diff), f1fae414 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/tmpfs/tmpfs_ops.c
r79506d6 rcac458f 85 85 static int tmpfs_has_children(bool *has_children, fs_node_t *fn) 86 86 { 87 *has_children = !list_empty(&TMPFS_NODE(fn)->cs_ head);87 *has_children = !list_empty(&TMPFS_NODE(fn)->cs_list); 88 88 return EOK; 89 89 } … … 180 180 nh_link); 181 181 182 while (!list_empty(&nodep->cs_ head)) {183 tmpfs_dentry_t *dentryp = list_get_instance( nodep->cs_head.next,184 tmpfs_dentry_t, link);182 while (!list_empty(&nodep->cs_list)) { 183 tmpfs_dentry_t *dentryp = list_get_instance( 184 list_first(&nodep->cs_list), tmpfs_dentry_t, link); 185 185 186 186 assert(nodep->type == TMPFS_DIRECTORY); … … 214 214 nodep->data = NULL; 215 215 link_initialize(&nodep->nh_link); 216 list_initialize(&nodep->cs_ head);216 list_initialize(&nodep->cs_list); 217 217 } 218 218 … … 262 262 { 263 263 tmpfs_node_t *parentp = TMPFS_NODE(pfn); 264 link_t *lnk; 265 266 for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head; 267 lnk = lnk->next) { 264 265 list_foreach(parentp->cs_list, lnk) { 268 266 tmpfs_dentry_t *dentryp; 269 267 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); … … 353 351 354 352 assert(!nodep->lnkcnt); 355 assert(list_empty(&nodep->cs_ head));353 assert(list_empty(&nodep->cs_list)); 356 354 357 355 unsigned long key[] = { … … 373 371 tmpfs_node_t *childp = TMPFS_NODE(cfn); 374 372 tmpfs_dentry_t *dentryp; 375 link_t *lnk;376 373 377 374 assert(parentp->type == TMPFS_DIRECTORY); 378 375 379 376 /* Check for duplicit entries. */ 380 for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head; 381 lnk = lnk->next) { 377 list_foreach(parentp->cs_list, lnk) { 382 378 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); 383 379 if (!str_cmp(dentryp->name, nm)) … … 401 397 dentryp->node = childp; 402 398 childp->lnkcnt++; 403 list_append(&dentryp->link, &parentp->cs_ head);399 list_append(&dentryp->link, &parentp->cs_list); 404 400 405 401 return EOK; … … 411 407 tmpfs_node_t *childp = NULL; 412 408 tmpfs_dentry_t *dentryp; 413 link_t *lnk;414 409 415 410 if (!parentp) 416 411 return EBUSY; 417 412 418 for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head; 419 lnk = lnk->next) { 413 list_foreach(parentp->cs_list, lnk) { 420 414 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); 421 415 if (!str_cmp(dentryp->name, nm)) { … … 423 417 assert(FS_NODE(childp) == cfn); 424 418 break; 425 } 419 } 426 420 } 427 421 … … 429 423 return ENOENT; 430 424 431 if ((childp->lnkcnt == 1) && !list_empty(&childp->cs_ head))425 if ((childp->lnkcnt == 1) && !list_empty(&childp->cs_list)) 432 426 return ENOTEMPTY; 433 427 … … 550 544 tmpfs_dentry_t *dentryp; 551 545 link_t *lnk; 552 aoff64_t i;553 546 554 547 assert(nodep->type == TMPFS_DIRECTORY); … … 559 552 * hash table. 560 553 */ 561 for (i = 0, lnk = nodep->cs_head.next; 562 (i < pos) && (lnk != &nodep->cs_head); 563 i++, lnk = lnk->next) 564 ; 565 566 if (lnk == &nodep->cs_head) { 554 lnk = list_nth(&nodep->cs_list, pos); 555 556 if (lnk == NULL) { 567 557 async_answer_0(callid, ENOENT); 568 558 async_answer_1(rid, ENOENT, 0);
Note:
See TracChangeset
for help on using the changeset viewer.