mirror of
https://github.com/apache/nuttx.git
synced 2026-09-02 23:23:02 +00:00
SmartFS: Implements wear-leveling in the SmartFS. From Ken Pettit
This commit is contained in:
parent
69cb752813
commit
cdc8fc52d1
12 changed files with 4382 additions and 518 deletions
|
|
@ -200,6 +200,12 @@
|
|||
* ProcFS data.
|
||||
* OUT: None (ioctl return value provides
|
||||
* success/failure indication). */
|
||||
#define BIOC_DEBUGCMD _BIOC(0x000B) /* Send driver specific debug command /
|
||||
* data to the block device.
|
||||
* IN: Pointer to a struct defined for
|
||||
* the block with specific debug
|
||||
* command and data.
|
||||
* OUT: None. */
|
||||
|
||||
/* NuttX MTD driver ioctl definitions ***************************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -89,6 +89,20 @@ struct smart_read_write_s
|
|||
const uint8_t *buffer; /* Pointer to the data to write */
|
||||
};
|
||||
|
||||
/* The following defines the procfs data exchange interface between the
|
||||
* SMART MTD and FS layers.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_SMARTFS)
|
||||
struct smart_procfs_data_s
|
||||
{
|
||||
#ifdef CONFIG_MTD_SMART_ERASE_DEBUG
|
||||
const uint16_t *erasecounts; /* Pointer to the erase counts array */
|
||||
uint16_t erasesize; /* Number of entries in the erase counts array */
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@
|
|||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define SMART_DEBUG_CMD_SET_DEBUG_LEVEL 1
|
||||
#define SMART_DEBUG_CMD_SHOW_LOGMAP 2
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
|
@ -91,6 +94,19 @@ struct mtd_smart_procfs_data_s
|
|||
FAR const struct smart_alloc_s *allocs; /* Array of allocations */
|
||||
uint16_t alloccount; /* Number of items in the array */
|
||||
#endif
|
||||
#ifdef CONFIG_MTD_SMART_WEAR_LEVEL
|
||||
uint32_t uneven_wearcount; /* Number of uneven block erases */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* The following defines debug command data passed from the procfs layer to
|
||||
the SMART MTD layer for debug purposes.
|
||||
*/
|
||||
|
||||
struct mtd_smart_debug_data_s
|
||||
{
|
||||
uint8_t debugcmd; /* Debug command */
|
||||
uint32_t debugdata; /* Debug data */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue