Changeset 9f808d1f in rtems for cpukit/libblock


Ignore:
Timestamp:
Mar 14, 2012, 9:45:36 AM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
23ed785
Parents:
a757d0f
git-author:
Sebastian Huber <sebastian.huber@…> (03/14/12 09:45:36)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/14/12 09:49:49)
Message:

PR2040: libblock: Flash disk starvations statistic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/src/flashdisk.c

    ra757d0f r9f808d1f  
    197197
    198198  uint32_t info_level;                     /**< The info trace level. */
     199
     200  uint32_t starvations;                    /**< Erased blocks starvations counter. */
    199201} rtems_flashdisk;
    200202
     
    277279
    278280static bool
    279 rtems_fdisk_is_erased_blocks_starvation (const rtems_flashdisk* fd)
    280 {
    281   return fd->erased_blocks < fd->unavail_blocks;
     281rtems_fdisk_is_erased_blocks_starvation (rtems_flashdisk* fd)
     282{
     283  bool starvation = fd->erased_blocks < fd->unavail_blocks;
     284
     285  if (starvation)
     286    fd->starvations++;
     287
     288  return starvation;
    282289}
    283290
     
    22192226  rtems_fdisk_printf (fd, "Block count\t%d", fd->block_count);
    22202227  rtems_fdisk_printf (fd, "Unavail blocks\t%d", fd->unavail_blocks);
     2228  rtems_fdisk_printf (fd, "Starvations\t%d", fd->starvations);
    22212229  count = rtems_fdisk_segment_count_queue (&fd->available);
    22222230  total = count;
Note: See TracChangeset for help on using the changeset viewer.