[PATCH 3/4] libblock: Change error status to fatal error

sebastian.huber at embedded-brains.de sebastian.huber at embedded-brains.de
Wed Mar 28 13:30:27 UTC 2012


From: Sebastian Huber <sebastian.huber at embedded-brains.de>

Calling the bdbuf API functions in the not configured state is now a
fatal error.
---
 cpukit/libblock/include/rtems/bdbuf.h |    9 ---------
 cpukit/libblock/src/bdbuf.c           |   11 -----------
 2 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/cpukit/libblock/include/rtems/bdbuf.h b/cpukit/libblock/include/rtems/bdbuf.h
index 254c745..c2fe0dd 100644
--- a/cpukit/libblock/include/rtems/bdbuf.h
+++ b/cpukit/libblock/include/rtems/bdbuf.h
@@ -475,8 +475,6 @@ rtems_bdbuf_init (void);
  * @param bd [out] Reference to the buffer descriptor pointer.
  *
  * @retval RTEMS_SUCCESSFUL Successful operation. 
- * @retval RTEMS_NOT_CONFIGURED Not initialized.
- * @retval RTEMS_INVALID_ID No such device.
  * @retval RTEMS_INVALID_NUMBER Invalid block size.
  */
 rtems_status_code
@@ -506,8 +504,6 @@ rtems_bdbuf_get (
  * @param bd [out] Reference to the buffer descriptor pointer.
  *
  * @retval RTEMS_SUCCESSFUL Successful operation. 
- * @retval RTEMS_NOT_CONFIGURED Not initialized.
- * @retval RTEMS_INVALID_ID No such device.
  * @retval RTEMS_INVALID_NUMBER Invalid block size.
  * @retval RTEMS_IO_ERROR IO error.
  */
@@ -529,7 +525,6 @@ rtems_bdbuf_read (
  * @param bd [in] Reference to the buffer descriptor.
  *
  * @retval RTEMS_SUCCESSFUL Successful operation. 
- * @retval RTEMS_NOT_CONFIGURED Not initialized.
  * @retval RTEMS_INVALID_ADDRESS The reference is NULL.
  */
 rtems_status_code
@@ -548,7 +543,6 @@ rtems_bdbuf_release (rtems_bdbuf_buffer* bd);
  * @param bd [in] Reference to the buffer descriptor.
  *
  * @retval RTEMS_SUCCESSFUL Successful operation. 
- * @retval RTEMS_NOT_CONFIGURED Not initialized.
  * @retval RTEMS_INVALID_ADDRESS The reference is NULL.
  */
 rtems_status_code
@@ -566,7 +560,6 @@ rtems_bdbuf_release_modified (rtems_bdbuf_buffer* bd);
  * @param bd [in] Reference to the buffer descriptor.
  *
  * @retval RTEMS_SUCCESSFUL Successful operation. 
- * @retval RTEMS_NOT_CONFIGURED Not initialized.
  * @retval RTEMS_INVALID_ADDRESS The reference is NULL.
  */
 rtems_status_code
@@ -584,8 +577,6 @@ rtems_bdbuf_sync (rtems_bdbuf_buffer* bd);
  * @param dd [in] The disk device.
  *
  * @retval RTEMS_SUCCESSFUL Successful operation. 
- * @retval RTEMS_NOT_CONFIGURED Not initialized.
- * @retval RTEMS_INVALID_ID No such device.
  */
 rtems_status_code
 rtems_bdbuf_syncdev (const rtems_disk_device *dd);
diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c
index 9af2f4a..bfbf9f0 100644
--- a/cpukit/libblock/src/bdbuf.c
+++ b/cpukit/libblock/src/bdbuf.c
@@ -1741,9 +1741,6 @@ rtems_bdbuf_obtain_disk (const rtems_disk_device *dd,
                          rtems_blkdev_bnum  *media_block_ptr,
                          size_t             *bds_per_group_ptr)
 {
-  if (!bdbuf_cache.initialised)
-    return RTEMS_NOT_CONFIGURED;
-
   if (media_block_ptr != NULL)
   {
     /*
@@ -2069,8 +2066,6 @@ rtems_bdbuf_read (const rtems_disk_device *dd,
 static rtems_status_code
 rtems_bdbuf_check_bd_and_lock_cache (rtems_bdbuf_buffer *bd, const char *kind)
 {
-  if (!bdbuf_cache.initialised)
-    return RTEMS_NOT_CONFIGURED;
   if (bd == NULL)
     return RTEMS_INVALID_ADDRESS;
   if (rtems_bdbuf_tracer)
@@ -2184,15 +2179,9 @@ rtems_bdbuf_sync (rtems_bdbuf_buffer *bd)
 rtems_status_code
 rtems_bdbuf_syncdev (const rtems_disk_device *dd)
 {
-  rtems_status_code  sc = RTEMS_SUCCESSFUL;
-
   if (rtems_bdbuf_tracer)
     printf ("bdbuf:syncdev: %08x\n", (unsigned) dd->dev);
 
-  sc = rtems_bdbuf_obtain_disk (dd, 0, NULL, NULL);
-  if (sc != RTEMS_SUCCESSFUL)
-    return sc;
-
   /*
    * Take the sync lock before locking the cache. Once we have the sync lock we
    * can lock the cache. If another thread has the sync lock it will cause this
-- 
1.6.4.2




More information about the devel mailing list