Changeset cd3e6a2 in mainline


Ignore:
Timestamp:
2009-09-01T21:18:23Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0712ff2
Parents:
aac12264 (diff), 7a56b1ed (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 libblock improvements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libblock/libblock.c

    raac12264 rcd3e6a2  
    345345        link_t *l;
    346346        unsigned long key = boff;
    347         int rc = EOK;
     347        int rc;
    348348       
    349349        devcon = devcon_search(dev_handle);
     
    355355
    356356retry:
     357        rc = EOK;
     358        b = NULL;
     359
    357360        fibril_mutex_lock(&cache->lock);
    358361        l = hash_table_find(&cache->block_hash, &key);
     
    394397                        unsigned long temp_key;
    395398recycle:
    396                         assert(!list_empty(&cache->free_head));
     399                        if (list_empty(&cache->free_head)) {
     400                                fibril_mutex_unlock(&cache->lock);
     401                                rc = ENOMEM;
     402                                goto out;
     403                        }
    397404                        l = cache->free_head.next;
    398405                        b = list_get_instance(l, block_t, free_link);
     
    477484
    478485                fibril_mutex_unlock(&b->lock);
     486        }
     487out:
     488        if ((rc != EOK) && b) {
     489                assert(b->toxic);
     490                (void) block_put(b);
     491                b = NULL;
    479492        }
    480493        *block = b;
Note: See TracChangeset for help on using the changeset viewer.