Changeset e811bde in mainline


Ignore:
Timestamp:
2008-05-17T21:04:01Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ce7311fc
Parents:
add5835
Message:

Add synchronization to fat_match().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_ops.c

    radd5835 re811bde  
    392392        block_t *b;
    393393
     394        futex_down(&parentp->idx->lock);
    394395        bps = fat_bps_get(parentp->idx->dev_handle);
    395396        dps = bps / sizeof(fat_dentry_t);
     
    409410                        case FAT_DENTRY_LAST:
    410411                                block_put(b);
     412                                futex_up(&parentp->idx->lock);
    411413                                return NULL;
    412414                        default:
     
    418420                                /* hit */
    419421                                void *node;
     422                                /*
     423                                 * Assume tree hierarchy for locking.  We
     424                                 * already have the parent and now we are going
     425                                 * to lock the child.  Never lock in the oposite
     426                                 * order.
     427                                 */
    420428                                fat_idx_t *idx = fat_idx_get_by_pos(
    421429                                    parentp->idx->dev_handle, parentp->firstc,
    422430                                    i * dps + j);
     431                                futex_up(&parentp->idx->lock);
    423432                                if (!idx) {
    424433                                        /*
     
    437446                block_put(b);
    438447        }
    439 
     448        futex_up(&parentp->idx->lock);
    440449        return NULL;
    441450}
Note: See TracChangeset for help on using the changeset viewer.