Changeset 89a84c0 in rtems for cpukit/libblock


Ignore:
Timestamp:
Mar 26, 2012, 9:43:57 AM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
462ee70f
Parents:
ced0816
git-author:
Sebastian Huber <sebastian.huber@…> (03/26/12 09:43:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/12/12 08:42:42)
Message:

libblock: Use unprotected chain operations

The chains are protected by the bdbuf cache lock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/src/bdbuf.c

    rced0816 r89a84c0  
    10571057  }
    10581058
    1059   rtems_chain_extract (&bd->link);
     1059  rtems_chain_extract_unprotected (&bd->link);
    10601060}
    10611061
     
    10641064{
    10651065  rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_FREE);
    1066   rtems_chain_prepend (&bdbuf_cache.lru, &bd->link);
     1066  rtems_chain_prepend_unprotected (&bdbuf_cache.lru, &bd->link);
    10671067}
    10681068
     
    10771077{
    10781078  rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_CACHED);
    1079   rtems_chain_append (&bdbuf_cache.lru, &bd->link);
     1079  rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
    10801080}
    10811081
     
    11241124
    11251125  rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_MODIFIED);
    1126   rtems_chain_append (&bdbuf_cache.modified, &bd->link);
     1126  rtems_chain_append_unprotected (&bdbuf_cache.modified, &bd->link);
    11271127
    11281128  if (bd->waiters)
     
    14291429    bd->buffer = buffer;
    14301430
    1431     rtems_chain_append (&bdbuf_cache.lru, &bd->link);
     1431    rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
    14321432
    14331433    if ((b % bdbuf_cache.max_bds_per_group) ==
     
    15261526        /* Fall through */
    15271527      case RTEMS_BDBUF_STATE_CACHED:
    1528         rtems_chain_extract (&bd->link);
     1528        rtems_chain_extract_unprotected (&bd->link);
    15291529        /* Fall through */
    15301530      case RTEMS_BDBUF_STATE_EMPTY:
     
    15511551{
    15521552  rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_SYNC);
    1553   rtems_chain_extract (&bd->link);
    1554   rtems_chain_append (&bdbuf_cache.sync, &bd->link);
     1553  rtems_chain_extract_unprotected (&bd->link);
     1554  rtems_chain_append_unprotected (&bdbuf_cache.sync, &bd->link);
    15551555  rtems_bdbuf_wake_swapper ();
    15561556}
     
    16461646  rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_SYNC);
    16471647
    1648   rtems_chain_append (&bdbuf_cache.sync, &bd->link);
     1648  rtems_chain_append_unprotected (&bdbuf_cache.sync, &bd->link);
    16491649
    16501650  if (bd->waiters)
     
    20312031    if (sc == RTEMS_SUCCESSFUL)
    20322032    {
    2033       rtems_chain_extract (&bd->link);
     2033      rtems_chain_extract_unprotected (&bd->link);
    20342034      rtems_bdbuf_group_obtain (bd);
    20352035    }
     
    24292429        rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_TRANSFER);
    24302430
    2431         rtems_chain_extract (node);
     2431        rtems_chain_extract_unprotected (node);
    24322432
    24332433        tnode = tnode->previous;
     
    24992499  {
    25002500    worker = (rtems_bdbuf_swapout_worker*)
    2501       rtems_chain_get (&bdbuf_cache.swapout_workers);
     2501      rtems_chain_get_unprotected (&bdbuf_cache.swapout_workers);
    25022502    if (worker)
    25032503      transfer = &worker->transfer;
     
    26292629    worker->transfer.dd = BDBUF_INVALID_DEV;
    26302630
    2631     rtems_chain_append (&bdbuf_cache.swapout_workers, &worker->link);
     2631    rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
    26322632
    26332633    rtems_bdbuf_unlock_cache ();
     
    26592659      rtems_fatal_error_occurred (RTEMS_BLKDEV_FATAL_BDBUF_SO_NOMEM);
    26602660
    2661     rtems_chain_append (&bdbuf_cache.swapout_workers, &worker->link);
     2661    rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
    26622662    worker->enabled = true;
    26632663    worker->transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
     
    28062806  rtems_chain_node *node = NULL;
    28072807
    2808   while ((node = rtems_chain_get (purge_list)) != NULL)
     2808  while ((node = rtems_chain_get_unprotected (purge_list)) != NULL)
    28092809  {
    28102810    rtems_bdbuf_buffer *bd = (rtems_bdbuf_buffer *) node;
     
    28482848          /* Fall through */
    28492849        case RTEMS_BDBUF_STATE_CACHED:
    2850           rtems_chain_extract (&cur->link);
    2851           rtems_chain_append (purge_list, &cur->link);
     2850          rtems_chain_extract_unprotected (&cur->link);
     2851          rtems_chain_append_unprotected (purge_list, &cur->link);
    28522852          break;
    28532853        case RTEMS_BDBUF_STATE_TRANSFER:
Note: See TracChangeset for help on using the changeset viewer.