[rtems commit] libblock: Remove const qualifier

Sebastian Huber sebh at rtems.org
Tue Jun 12 08:10:15 UTC 2012


Module:    rtems
Branch:    master
Commit:    7d4a85944199898409e60fa12a37ea71522ee6eb
Changeset: http://git.rtems.org/rtems/commit/?id=7d4a85944199898409e60fa12a37ea71522ee6eb

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Jun 12 08:54:19 2012 +0200

libblock: Remove const qualifier

This allows addtion of per disk statistics for example.

---

 cpukit/libblock/include/rtems/bdbuf.h |    2 +-
 cpukit/libblock/src/bdbuf.c           |   34 ++++++++++++++++----------------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/cpukit/libblock/include/rtems/bdbuf.h b/cpukit/libblock/include/rtems/bdbuf.h
index 5275c13..f63c1c5 100644
--- a/cpukit/libblock/include/rtems/bdbuf.h
+++ b/cpukit/libblock/include/rtems/bdbuf.h
@@ -318,7 +318,7 @@ typedef struct rtems_bdbuf_buffer
     signed char                bal;    /**< The balance of the sub-tree */
   } avl;
 
-  const rtems_disk_device *dd;  /**< disk device */
+  rtems_disk_device *dd;        /**< disk device */
 
   rtems_blkdev_bnum block;      /**< block number on the device */
 
diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c
index 424b9a3..1d683b3 100644
--- a/cpukit/libblock/src/bdbuf.c
+++ b/cpukit/libblock/src/bdbuf.c
@@ -58,7 +58,7 @@
 typedef struct rtems_bdbuf_swapout_transfer
 {
   rtems_chain_control   bds;         /**< The transfer list of BDs. */
-  const rtems_disk_device *dd;       /**< The device the transfer is for. */
+  rtems_disk_device    *dd;          /**< The device the transfer is for. */
   bool                  syncing;     /**< The data is a sync'ing. */
   rtems_blkdev_request* write_req;   /**< The write request array. */
   uint32_t              bufs_per_bd; /**< Number of buffers per bd. */
@@ -113,7 +113,7 @@ typedef struct rtems_bdbuf_cache
   rtems_id            sync_lock;         /**< Sync calls block writes. */
   bool                sync_active;       /**< True if a sync is active. */
   rtems_id            sync_requester;    /**< The sync requester. */
-  const rtems_disk_device *sync_device;  /**< The device to sync and
+  rtems_disk_device  *sync_device;       /**< The device to sync and
                                           * BDBUF_INVALID_DEV not a device
                                           * sync. */
 
@@ -1223,7 +1223,7 @@ rtems_bdbuf_group_realloc (rtems_bdbuf_group* group, size_t new_bds_per_group)
 
 static void
 rtems_bdbuf_setup_empty_buffer (rtems_bdbuf_buffer *bd,
-                                const rtems_disk_device *dd,
+                                rtems_disk_device  *dd,
                                 rtems_blkdev_bnum   block)
 {
   bd->dd        = dd ;
@@ -1239,8 +1239,8 @@ rtems_bdbuf_setup_empty_buffer (rtems_bdbuf_buffer *bd,
 }
 
 static rtems_bdbuf_buffer *
-rtems_bdbuf_get_buffer_from_lru_list (const rtems_disk_device *dd,
-                                      rtems_blkdev_bnum block)
+rtems_bdbuf_get_buffer_from_lru_list (rtems_disk_device *dd,
+                                      rtems_blkdev_bnum  block)
 {
   rtems_chain_node *node = rtems_chain_first (&bdbuf_cache.lru);
 
@@ -1707,8 +1707,8 @@ rtems_bdbuf_sync_after_access (rtems_bdbuf_buffer *bd)
 }
 
 static rtems_bdbuf_buffer *
-rtems_bdbuf_get_buffer_for_read_ahead (const rtems_disk_device *dd,
-                                       rtems_blkdev_bnum block)
+rtems_bdbuf_get_buffer_for_read_ahead (rtems_disk_device *dd,
+                                       rtems_blkdev_bnum  block)
 {
   rtems_bdbuf_buffer *bd = NULL;
 
@@ -1732,8 +1732,8 @@ rtems_bdbuf_get_buffer_for_read_ahead (const rtems_disk_device *dd,
 }
 
 static rtems_bdbuf_buffer *
-rtems_bdbuf_get_buffer_for_access (const rtems_disk_device *dd,
-                                   rtems_blkdev_bnum block)
+rtems_bdbuf_get_buffer_for_access (rtems_disk_device *dd,
+                                   rtems_blkdev_bnum  block)
 {
   rtems_bdbuf_buffer *bd = NULL;
 
@@ -1874,9 +1874,9 @@ rtems_bdbuf_transfer_done (void* arg, rtems_status_code status)
 }
 
 static rtems_status_code
-rtems_bdbuf_execute_transfer_request (const rtems_disk_device *dd,
-                                      rtems_blkdev_request    *req,
-                                      bool                     cache_locked)
+rtems_bdbuf_execute_transfer_request (rtems_disk_device    *dd,
+                                      rtems_blkdev_request *req,
+                                      bool                  cache_locked)
 {
   rtems_status_code sc = RTEMS_SUCCESSFUL;
   int result = 0;
@@ -1936,9 +1936,9 @@ rtems_bdbuf_execute_transfer_request (const rtems_disk_device *dd,
 }
 
 static rtems_status_code
-rtems_bdbuf_execute_read_request (const rtems_disk_device *dd,
-                                  rtems_bdbuf_buffer      *bd,
-                                  uint32_t                 transfer_count)
+rtems_bdbuf_execute_read_request (rtems_disk_device  *dd,
+                                  rtems_bdbuf_buffer *bd,
+                                  uint32_t            transfer_count)
 {
   rtems_blkdev_request *req = NULL;
   rtems_blkdev_bnum media_block = bd->block;
@@ -2285,7 +2285,7 @@ rtems_bdbuf_swapout_write (rtems_bdbuf_swapout_transfer* transfer)
      */
     uint32_t bufs_per_bd = 0;
 
-    const rtems_disk_device *dd = transfer->dd;
+    rtems_disk_device *dd = transfer->dd;
 
     bufs_per_bd = dd->block_size / bdbuf_config.buffer_min;
 
@@ -2384,7 +2384,7 @@ rtems_bdbuf_swapout_write (rtems_bdbuf_swapout_transfer* transfer)
  *                    amount.
  */
 static void
-rtems_bdbuf_swapout_modified_processing (const rtems_disk_device **dd_ptr,
+rtems_bdbuf_swapout_modified_processing (rtems_disk_device  **dd_ptr,
                                          rtems_chain_control* chain,
                                          rtems_chain_control* transfer,
                                          bool                 sync_active,




More information about the vc mailing list