Changeset c028b22 in mainline for uspace/srv/fs/fat/fat_ops.c


Ignore:
Timestamp:
2011-07-08T17:01:01Z (13 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cc1a727
Parents:
4e36219 (diff), 026793d (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.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    r4e36219 rc028b22  
    6767
    6868/** List of cached free FAT nodes. */
    69 static LIST_INITIALIZE(ffn_head);
     69static LIST_INITIALIZE(ffn_list);
    7070
    7171/*
     
    147147static int fat_node_fini_by_devmap_handle(devmap_handle_t devmap_handle)
    148148{
    149         link_t *lnk;
    150149        fat_node_t *nodep;
    151150        int rc;
     
    159158restart:
    160159        fibril_mutex_lock(&ffn_mutex);
    161         for (lnk = ffn_head.next; lnk != &ffn_head; lnk = lnk->next) {
     160        list_foreach(ffn_list, lnk) {
    162161                nodep = list_get_instance(lnk, fat_node_t, ffn_link);
    163162                if (!fibril_mutex_trylock(&nodep->lock)) {
     
    196195                free(nodep);
    197196
    198                 /* Need to restart because we changed the ffn_head list. */
     197                /* Need to restart because we changed ffn_list. */
    199198                goto restart;
    200199        }
     
    211210
    212211        fibril_mutex_lock(&ffn_mutex);
    213         if (!list_empty(&ffn_head)) {
     212        if (!list_empty(&ffn_list)) {
    214213                /* Try to use a cached free node structure. */
    215214                fat_idx_t *idxp_tmp;
    216                 nodep = list_get_instance(ffn_head.next, fat_node_t, ffn_link);
     215                nodep = list_get_instance(list_first(&ffn_list), fat_node_t,
     216                    ffn_link);
    217217                if (!fibril_mutex_trylock(&nodep->lock))
    218218                        goto skip_cache;
     
    473473                if (nodep->idx) {
    474474                        fibril_mutex_lock(&ffn_mutex);
    475                         list_append(&nodep->ffn_link, &ffn_head);
     475                        list_append(&nodep->ffn_link, &ffn_list);
    476476                        fibril_mutex_unlock(&ffn_mutex);
    477477                } else {
     
    970970
    971971        /* initialize libblock */
    972         rc = block_init(devmap_handle, BS_SIZE);
     972        rc = block_init(EXCHANGE_SERIALIZE, devmap_handle, BS_SIZE);
    973973        if (rc != EOK) {
    974974                async_answer_0(rid, rc);
Note: See TracChangeset for help on using the changeset viewer.