Changes in uspace/srv/fs/tmpfs/tmpfs_ops.c [b72efe8:ffa2c8ef] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/tmpfs/tmpfs_ops.c
rb72efe8 rffa2c8ef 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_ list);87 *has_children = !list_empty(&TMPFS_NODE(fn)->cs_head); 88 88 return EOK; 89 89 } … … 180 180 nh_link); 181 181 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);182 while (!list_empty(&nodep->cs_head)) { 183 tmpfs_dentry_t *dentryp = list_get_instance(nodep->cs_head.next, 184 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_ list);216 list_initialize(&nodep->cs_head); 217 217 } 218 218 … … 262 262 { 263 263 tmpfs_node_t *parentp = TMPFS_NODE(pfn); 264 265 list_foreach(parentp->cs_list, lnk) { 264 link_t *lnk; 265 266 for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head; 267 lnk = lnk->next) { 266 268 tmpfs_dentry_t *dentryp; 267 269 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); … … 351 353 352 354 assert(!nodep->lnkcnt); 353 assert(list_empty(&nodep->cs_ list));355 assert(list_empty(&nodep->cs_head)); 354 356 355 357 unsigned long key[] = { … … 371 373 tmpfs_node_t *childp = TMPFS_NODE(cfn); 372 374 tmpfs_dentry_t *dentryp; 375 link_t *lnk; 373 376 374 377 assert(parentp->type == TMPFS_DIRECTORY); 375 378 376 379 /* Check for duplicit entries. */ 377 list_foreach(parentp->cs_list, lnk) { 380 for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head; 381 lnk = lnk->next) { 378 382 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); 379 383 if (!str_cmp(dentryp->name, nm)) … … 397 401 dentryp->node = childp; 398 402 childp->lnkcnt++; 399 list_append(&dentryp->link, &parentp->cs_ list);403 list_append(&dentryp->link, &parentp->cs_head); 400 404 401 405 return EOK; … … 407 411 tmpfs_node_t *childp = NULL; 408 412 tmpfs_dentry_t *dentryp; 413 link_t *lnk; 409 414 410 415 if (!parentp) 411 416 return EBUSY; 412 417 413 list_foreach(parentp->cs_list, lnk) { 418 for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head; 419 lnk = lnk->next) { 414 420 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); 415 421 if (!str_cmp(dentryp->name, nm)) { … … 417 423 assert(FS_NODE(childp) == cfn); 418 424 break; 419 } 425 } 420 426 } 421 427 … … 423 429 return ENOENT; 424 430 425 if ((childp->lnkcnt == 1) && !list_empty(&childp->cs_ list))431 if ((childp->lnkcnt == 1) && !list_empty(&childp->cs_head)) 426 432 return ENOTEMPTY; 427 433 … … 544 550 tmpfs_dentry_t *dentryp; 545 551 link_t *lnk; 552 aoff64_t i; 546 553 547 554 assert(nodep->type == TMPFS_DIRECTORY); … … 552 559 * hash table. 553 560 */ 554 lnk = list_nth(&nodep->cs_list, pos); 555 556 if (lnk == NULL) { 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) { 557 567 async_answer_0(callid, ENOENT); 558 568 async_answer_1(rid, ENOENT, 0);
Note:
See TracChangeset
for help on using the changeset viewer.