From a5de1ef5fc5b06d300e08dae2425d1bb88985645 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Sat, 5 Jan 2008 06:57:17 +0000 Subject: 2008-01-05 Chris Johns * configure.ac: Fix typo in the strict order mutex CPU OPTs test. * libmisc/shell/shell.c: Handle '#' comment characters correctly. * libblock/include/rtems/flashdisk.h: Add docmentation about the control fields. Add more control fields to handle the flash when full. * libblock/src/flashdisk.c: Fix the descriptor erase test so it detects a descriptor is erased. Add support for unavailable blocks the user can configure. Print the used list as a diag. Fix the bug when a page is detected as failed and present on more than one queue. Add a count to the queues so queue length can be used to manage compaction. --- cpukit/libblock/include/rtems/flashdisk.h | 47 +++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 8 deletions(-) (limited to 'cpukit/libblock/include/rtems/flashdisk.h') diff --git a/cpukit/libblock/include/rtems/flashdisk.h b/cpukit/libblock/include/rtems/flashdisk.h index de63e06bbc..997dd1805c 100644 --- a/cpukit/libblock/include/rtems/flashdisk.h +++ b/cpukit/libblock/include/rtems/flashdisk.h @@ -57,6 +57,7 @@ typedef struct rtems_fdisk_monitor_data { uint32_t block_size; uint32_t block_count; + uint32_t unavail_blocks; uint32_t device_count; uint32_t segment_count; uint32_t page_count; @@ -264,17 +265,47 @@ typedef struct rtems_fdisk_device_desc /** * RTEMS Flash Disk configuration table used to initialise the * driver. + * + * The unavailable blocks count is the number of blocks less than the + * available number of blocks the file system is given. This means there + * will always be that number of blocks available when the file system + * thinks the disk is full. The compaction code needs blocks to compact + * with so you will never be able to have all the blocks allocated to the + * file system and be able to full the disk. + * + * The compacting segment count is the number of segments that are + * moved into a new segment. A high number will mean more segments with + * low active page counts and high used page counts will be moved into + * avaliable pages how-ever this extends the compaction time due to + * time it takes the erase the pages. There is no pont making this number + * greater than the maximum number of pages in a segment. + * + * The available compacting segment count is the level when compaction occurs + * when writing. If you set this to 0 then compaction will fail because + * there will be no segments to compact into. + * + * The info level can be 0 for off with error, and abort messages allowed. + * Level 1 is warning messages, level 1 is informational messages, and level 3 + * is debugging type prints. The info level can be turned off with a compile + * time directive on the command line to the compiler of: + * + * -DRTEMS_FDISK_TRACE=0 */ typedef struct rtems_flashdisk_config { - uint32_t block_size; /**< The block size. */ - uint32_t device_count; /**< The number of devices. */ - const rtems_fdisk_device_desc* devices; /**< The device descriptions. */ - uint32_t flags; /**< Set of flags to control - driver. */ - uint32_t compact_segs; /**< Max number of segs to - compact in one pass. */ - uint32_t info_level; /**< Default info level. */ + uint32_t block_size; /**< The block size. */ + uint32_t device_count; /**< The number of devices. */ + const rtems_fdisk_device_desc* devices; /**< The device descriptions. */ + uint32_t flags; /**< Set of flags to control + driver. */ + uint32_t unavail_blocks; /**< Number of blocks not + available to the file sys. */ + uint32_t compact_segs; /**< Max number of segs to + compact in one pass. */ + uint32_t avail_compact_segs; /**< The number of segments + when compaction occurs + when writing. */ + uint32_t info_level; /**< Default info level. */ } rtems_flashdisk_config; /* -- cgit v1.2.3