Changeset 3d60c1b in rtems


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

libblock: Change error status to fatal error

Calling the bdbuf API functions in the not configured state is now a
fatal error.

Location:
cpukit/libblock
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/include/rtems/bdbuf.h

    r462ee70f r3d60c1b  
    471471 * of the partition on the media.
    472472 *
     473 * Before you can use this function, the rtems_bdbuf_init() routine must be
     474 * called at least once to initialize the cache, otherwise a fatal error will
     475 * occur.
     476 *
    473477 * @param dd [in] The disk device.
    474478 * @param block [in] Linear media block number.
     
    476480 *
    477481 * @retval RTEMS_SUCCESSFUL Successful operation.
    478  * @retval RTEMS_NOT_CONFIGURED Not initialized.
    479  * @retval RTEMS_INVALID_ID No such device.
    480482 * @retval RTEMS_INVALID_NUMBER Invalid block size.
    481483 */
     
    502504 * first.
    503505 *
     506 * Before you can use this function, the rtems_bdbuf_init() routine must be
     507 * called at least once to initialize the cache, otherwise a fatal error will
     508 * occur.
     509 *
    504510 * @param dd [in] The disk device.
    505511 * @param block [in] Linear media block number.
     
    507513 *
    508514 * @retval RTEMS_SUCCESSFUL Successful operation.
    509  * @retval RTEMS_NOT_CONFIGURED Not initialized.
    510  * @retval RTEMS_INVALID_ID No such device.
    511515 * @retval RTEMS_INVALID_NUMBER Invalid block size.
    512516 * @retval RTEMS_IO_ERROR IO error.
     
    527531 * queue. The buffers is returned to the end of the LRU list.
    528532 *
    529  * @param bd [in] Reference to the buffer descriptor.
     533 * Before you can use this function, the rtems_bdbuf_init() routine must be
     534 * called at least once to initialize the cache, otherwise a fatal error will
     535 * occur.
     536 *
     537 * @param bd [in] Reference to the buffer descriptor.  The buffer descriptor
     538 * reference must not be @c NULL and must be obtained via rtems_bdbuf_get() or
     539 * rtems_bdbuf_read().
    530540 *
    531541 * @retval RTEMS_SUCCESSFUL Successful operation.
    532  * @retval RTEMS_NOT_CONFIGURED Not initialized.
    533542 * @retval RTEMS_INVALID_ADDRESS The reference is NULL.
    534543 */
     
    546555 * before the hold timer has expired the buffer will be returned to the user.
    547556 *
    548  * @param bd [in] Reference to the buffer descriptor.
     557 * Before you can use this function, the rtems_bdbuf_init() routine must be
     558 * called at least once to initialize the cache, otherwise a fatal error will
     559 * occur.
     560 *
     561 * @param bd [in] Reference to the buffer descriptor.  The buffer descriptor
     562 * reference must not be @c NULL and must be obtained via rtems_bdbuf_get() or
     563 * rtems_bdbuf_read().
    549564 *
    550565 * @retval RTEMS_SUCCESSFUL Successful operation.
    551  * @retval RTEMS_NOT_CONFIGURED Not initialized.
    552566 * @retval RTEMS_INVALID_ADDRESS The reference is NULL.
    553567 */
     
    563577 * @note This code does not lock the sync mutex and stop additions to the
    564578 *       modified queue.
    565 
    566  * @param bd [in] Reference to the buffer descriptor.
     579 *
     580 * Before you can use this function, the rtems_bdbuf_init() routine must be
     581 * called at least once to initialize the cache, otherwise a fatal error will
     582 * occur.
     583 *
     584 * @param bd [in] Reference to the buffer descriptor.  The buffer descriptor
     585 * reference must not be @c NULL and must be obtained via rtems_bdbuf_get() or
     586 * rtems_bdbuf_read().
    567587 *
    568588 * @retval RTEMS_SUCCESSFUL Successful operation.
    569  * @retval RTEMS_NOT_CONFIGURED Not initialized.
    570589 * @retval RTEMS_INVALID_ADDRESS The reference is NULL.
    571590 */
     
    582601 * nested call will be blocked until the first sync request has complete.
    583602 *
     603 * Before you can use this function, the rtems_bdbuf_init() routine must be
     604 * called at least once to initialize the cache, otherwise a fatal error will
     605 * occur.
     606 *
    584607 * @param dd [in] The disk device.
    585608 *
    586609 * @retval RTEMS_SUCCESSFUL Successful operation.
    587  * @retval RTEMS_NOT_CONFIGURED Not initialized.
    588  * @retval RTEMS_INVALID_ID No such device.
    589610 */
    590611rtems_status_code
     
    595616 *
    596617 * This may result in loss of data.
     618 *
     619 * Before you can use this function, the rtems_bdbuf_init() routine must be
     620 * called at least once to initialize the cache, otherwise a fatal error will
     621 * occur.
     622 *
     623 * @param dd [in] The disk device.
    597624 */
    598625void
  • cpukit/libblock/src/bdbuf.c

    r462ee70f r3d60c1b  
    155155#define RTEMS_BLKDEV_FATAL_BDBUF_TREE_RM       RTEMS_BLKDEV_FATAL_ERROR(9)
    156156#define RTEMS_BLKDEV_FATAL_BDBUF_SWAPOUT       RTEMS_BLKDEV_FATAL_ERROR(10)
     157
     158/*
     159 * The lock/unlock fatal errors occur in case the bdbuf is not initialized with
     160 * rtems_bdbuf_init().  General system corruption like stack overflow etc. may
     161 * also trigger these fatal errors.
     162 */
    157163#define RTEMS_BLKDEV_FATAL_BDBUF_SYNC_LOCK     RTEMS_BLKDEV_FATAL_ERROR(11)
    158164#define RTEMS_BLKDEV_FATAL_BDBUF_SYNC_UNLOCK   RTEMS_BLKDEV_FATAL_ERROR(12)
    159165#define RTEMS_BLKDEV_FATAL_BDBUF_CACHE_LOCK    RTEMS_BLKDEV_FATAL_ERROR(13)
    160166#define RTEMS_BLKDEV_FATAL_BDBUF_CACHE_UNLOCK  RTEMS_BLKDEV_FATAL_ERROR(14)
     167
    161168#define RTEMS_BLKDEV_FATAL_BDBUF_PREEMPT_DIS   RTEMS_BLKDEV_FATAL_ERROR(15)
    162169#define RTEMS_BLKDEV_FATAL_BDBUF_CACHE_WAIT_2  RTEMS_BLKDEV_FATAL_ERROR(16)
     
    17421749                         size_t             *bds_per_group_ptr)
    17431750{
    1744   if (!bdbuf_cache.initialised)
    1745     return RTEMS_NOT_CONFIGURED;
    1746 
    17471751  if (media_block_ptr != NULL)
    17481752  {
     
    20702074rtems_bdbuf_check_bd_and_lock_cache (rtems_bdbuf_buffer *bd, const char *kind)
    20712075{
    2072   if (!bdbuf_cache.initialised)
    2073     return RTEMS_NOT_CONFIGURED;
    20742076  if (bd == NULL)
    20752077    return RTEMS_INVALID_ADDRESS;
     
    21852187rtems_bdbuf_syncdev (const rtems_disk_device *dd)
    21862188{
    2187   rtems_status_code  sc = RTEMS_SUCCESSFUL;
    2188 
    21892189  if (rtems_bdbuf_tracer)
    21902190    printf ("bdbuf:syncdev: %08x\n", (unsigned) dd->dev);
    2191 
    2192   sc = rtems_bdbuf_obtain_disk (dd, 0, NULL, NULL);
    2193   if (sc != RTEMS_SUCCESSFUL)
    2194     return sc;
    21952191
    21962192  /*
Note: See TracChangeset for help on using the changeset viewer.