summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/libfs/src/rfs/rtems-rfs-group.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-group.c b/cpukit/libfs/src/rfs/rtems-rfs-group.c
index b08e785114..b096528fbb 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-group.c
+++ b/cpukit/libfs/src/rfs/rtems-rfs-group.c
@@ -232,10 +232,24 @@ rtems_rfs_group_bitmap_alloc (rtems_rfs_file_system* fs,
return 0;
}
+ /*
+ * If we are still looking back and forth around the
+ * group_start, then alternate the direction and
+ * increment the offset on every other iteration.
+ * Otherwise we are marching through the groups, so just
+ * increment the offset.
+ */
if (updown)
+ {
direction = direction > 0 ? -1 : 1;
+ if ( direction == -1 )
+ offset++;
+ }
+ else
+ {
+ offset++;
+ }
- offset++;
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))