Changeset 6ebe721 in mainline for uspace/srv/fs/fat/fat_fat.c


Ignore:
Timestamp:
2009-06-17T22:07:42Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4e1b57d
Parents:
34ca870
Message:

Use fibril synchronization in FAT.

File:
1 edited

Legend:

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

    r34ca870 r6ebe721  
    4646#include <align.h>
    4747#include <assert.h>
    48 #include <futex.h>
     48#include <fibril_sync.h>
    4949#include <mem.h>
    5050
    5151/**
    52  * The fat_alloc_lock futex protects all copies of the File Allocation Table
     52 * The fat_alloc_lock mutex protects all copies of the File Allocation Table
    5353 * during allocation of clusters. The lock does not have to be held durring
    5454 * deallocation of clusters.
    5555 */ 
    56 static futex_t fat_alloc_lock = FUTEX_INITIALIZER;
     56static FIBRIL_MUTEX_INITIALIZE(fat_alloc_lock);
    5757
    5858/** Walk the cluster chain.
     
    327327         * Search FAT1 for unused clusters.
    328328         */
    329         futex_down(&fat_alloc_lock);
     329        fibril_mutex_lock(&fat_alloc_lock);
    330330        for (b = 0, cl = 0; b < sf; b++) {
    331331                blk = block_get(dev_handle, rscnt + b, BLOCK_FLAGS_NONE);
     
    351351                                        *lcl = lifo[0];
    352352                                        free(lifo);
    353                                         futex_up(&fat_alloc_lock);
     353                                        fibril_mutex_unlock(&fat_alloc_lock);
    354354                                        return EOK;
    355355                                }
     
    358358                block_put(blk);
    359359        }
    360         futex_up(&fat_alloc_lock);
     360        fibril_mutex_unlock(&fat_alloc_lock);
    361361
    362362        /*
Note: See TracChangeset for help on using the changeset viewer.