[rtems commit] libblock: Use unprotected chain operations

Sebastian Huber sebh at rtems.org
Thu Apr 12 08:40:32 UTC 2012


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Mar 26 12:56:01 2012 +0200

libblock: Use unprotected chain operations

The transfer chain is accessed by at most one thread at a time.

---

 cpukit/libblock/src/bdbuf.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c
index 89951f4..9af2f4a 100644
--- a/cpukit/libblock/src/bdbuf.c
+++ b/cpukit/libblock/src/bdbuf.c
@@ -2269,7 +2269,7 @@ rtems_bdbuf_swapout_write (rtems_bdbuf_swapout_transfer* transfer)
     transfer->write_req->status = RTEMS_RESOURCE_IN_USE;
     transfer->write_req->bufnum = 0;
 
-    while ((node = rtems_chain_get(&transfer->bds)) != NULL)
+    while ((node = rtems_chain_get_unprotected(&transfer->bds)) != NULL)
     {
       rtems_bdbuf_buffer* bd = (rtems_bdbuf_buffer*) node;
       bool                write = false;
@@ -2291,7 +2291,7 @@ rtems_bdbuf_swapout_write (rtems_bdbuf_swapout_transfer* transfer)
           transfer->write_req->bufnum &&
           (bd->block != (last_block + bufs_per_bd)))
       {
-        rtems_chain_prepend (&transfer->bds, &bd->link);
+        rtems_chain_prepend_unprotected (&transfer->bds, &bd->link);
         write = true;
       }
       else
@@ -2438,7 +2438,7 @@ rtems_bdbuf_swapout_modified_processing (const rtems_disk_device **dd_ptr,
 
           if (bd->block > tbd->block)
           {
-            rtems_chain_insert (tnode, node);
+            rtems_chain_insert_unprotected (tnode, node);
             node = NULL;
           }
           else
@@ -2446,7 +2446,7 @@ rtems_bdbuf_swapout_modified_processing (const rtems_disk_device **dd_ptr,
         }
 
         if (node)
-          rtems_chain_prepend (transfer, node);
+          rtems_chain_prepend_unprotected (transfer, node);
 
         node = next_node;
       }




More information about the vc mailing list