Changeset 5b29a08 in rtems


Ignore:
Timestamp:
Jul 6, 2012, 2:39:00 PM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
c5ba8ba
Parents:
2cc4f3c
git-author:
Sebastian Huber <sebastian.huber@…> (07/06/12 14:39:00)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/09/12 08:42:08)
Message:

libblock: Fix read-ahead task wake-up

In case the read-ahead task is not configured we must not send a wake-up
event. This would send the wake-up event to the executing task.

We must send the wake-up event only in case the request list changes
from empty to non-empty. Since otherwise we may send a false transfer
event.

File:
1 edited

Legend:

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

    r2cc4f3c r5b29a08  
    20402040                                      rtems_blkdev_bnum  block)
    20412041{
    2042   if (dd->read_ahead.trigger == block
     2042  if (bdbuf_cache.read_ahead_task != 0
     2043      && dd->read_ahead.trigger == block
    20432044      && !rtems_bdbuf_is_read_ahead_active (dd))
    20442045  {
     
    20462047    rtems_chain_control *chain = &bdbuf_cache.read_ahead_chain;
    20472048
     2049    if (rtems_chain_is_empty (chain))
     2050    {
     2051      sc = rtems_event_send (bdbuf_cache.read_ahead_task,
     2052                             RTEMS_BDBUF_READ_AHEAD_WAKE_UP);
     2053      if (sc != RTEMS_SUCCESSFUL)
     2054        rtems_fatal_error_occurred (RTEMS_BLKDEV_FATAL_BDBUF_RA_WAKE_UP);
     2055    }
     2056
    20482057    rtems_chain_append_unprotected (chain, &dd->read_ahead.node);
    2049     sc = rtems_event_send (bdbuf_cache.read_ahead_task,
    2050                            RTEMS_BDBUF_READ_AHEAD_WAKE_UP);
    2051     if (sc != RTEMS_SUCCESSFUL)
    2052       rtems_fatal_error_occurred (RTEMS_BLKDEV_FATAL_BDBUF_RA_WAKE_UP);
    20532058  }
    20542059}
Note: See TracChangeset for help on using the changeset viewer.