Changeset feeac0d in mainline for uspace/srv/fs/tmpfs/tmpfs_ops.c


Ignore:
Timestamp:
2013-09-10T16:32:35Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4982d87
Parents:
e8d6ce2
Message:

Simplify use of list_foreach.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/tmpfs/tmpfs_ops.c

    re8d6ce2 rfeeac0d  
    259259        tmpfs_node_t *parentp = TMPFS_NODE(pfn);
    260260
    261         list_foreach(parentp->cs_list, lnk) {
    262                 tmpfs_dentry_t *dentryp;
    263                 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link);
     261        list_foreach(parentp->cs_list, link, tmpfs_dentry_t, dentryp) {
    264262                if (!str_cmp(dentryp->name, component)) {
    265263                        *rfn = FS_NODE(dentryp->node);
     
    365363
    366364        /* Check for duplicit entries. */
    367         list_foreach(parentp->cs_list, lnk) {
    368                 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link);
    369                 if (!str_cmp(dentryp->name, nm))
     365        list_foreach(parentp->cs_list, link, tmpfs_dentry_t, dp) {
     366                if (!str_cmp(dp->name, nm))
    370367                        return EEXIST;
    371368        }
     
    400397        if (!parentp)
    401398                return EBUSY;
    402        
    403         list_foreach(parentp->cs_list, lnk) {
    404                 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link);
    405                 if (!str_cmp(dentryp->name, nm)) {
     399
     400        list_foreach(parentp->cs_list, link, tmpfs_dentry_t, dp) {
     401                if (!str_cmp(dp->name, nm)) {
     402                        dentryp = dp;
    406403                        childp = dentryp->node;
    407404                        assert(FS_NODE(childp) == cfn);
Note: See TracChangeset for help on using the changeset viewer.