[rtems commit] Reset free count properly in rtems_rfs_bitmap_map_clear_all ().

Chris Johns chrisj at rtems.org
Wed Apr 11 01:57:09 UTC 2018


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

Author:    Fan Deng <enetor at gmail.com>
Date:      Tue Oct 10 16:18:09 2017 -0700

Reset free count properly in rtems_rfs_bitmap_map_clear_all().

In rtems_rfs_bitmap_map_clear_all(), control->free is set to 'elements',
which is the number of elements in the bitmap. This is incorrect, as
control->free should contain the number of free bits, not elements.

This change fixes the logic and resets control->free to a correct value.

---

 cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c b/cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c
index 15a9050..348fff6 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c
+++ b/cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c
@@ -298,7 +298,7 @@ rtems_rfs_bitmap_map_clear_all (rtems_rfs_bitmap_control* control)
 
   elements = rtems_rfs_bitmap_elements (control->size);
 
-  control->free = elements;
+  control->free = control->size;
 
   for (e = 0; e < elements; e++)
     map[e] = RTEMS_RFS_BITMAP_ELEMENT_CLEAR;



More information about the vc mailing list