mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 06:18:40 +08:00
fs/littlefs: add LFS_MULTIVERSION support
This commit is contained in:
parent
abd769dcb0
commit
610c72ccd0
4 changed files with 26 additions and 1 deletions
|
@ -59,7 +59,8 @@ if(CONFIG_FS_LITTLEFS)
|
|||
-DLFS_CONFIG=${CMAKE_CURRENT_LIST_DIR}/lfs_vfs.h
|
||||
-DLFS_NAME_MAX=${CONFIG_FS_LITTLEFS_NAME_MAX}
|
||||
-DLFS_FILE_MAX=${CONFIG_FS_LITTLEFS_FILE_MAX}
|
||||
-DLFS_ATTR_MAX=${CONFIG_FS_LITTLEFS_ATTR_MAX})
|
||||
-DLFS_ATTR_MAX=${CONFIG_FS_LITTLEFS_ATTR_MAX}
|
||||
$<$<BOOL:${CONFIG_FS_LITTLEFS_MULTI_VERSION}>:-DLFS_MULTIVERSION>)
|
||||
|
||||
# Note: the littlefs upstream doesn't seems to care -Wshadow cf.
|
||||
# https://github.com/littlefs-project/littlefs/pull/873
|
||||
|
|
|
@ -158,4 +158,21 @@ config FS_LITTLEFS_VERSION
|
|||
---help---
|
||||
The LITTLEFS version to use.
|
||||
|
||||
config FS_LITTLEFS_MULTI_VERSION
|
||||
bool "Support multiple on-disk versions"
|
||||
default n
|
||||
---help---
|
||||
Enable LFS_MULTIVERSION for LITTLEFS file system
|
||||
|
||||
config FS_LITTLEFS_DISK_VERSION
|
||||
hex "LITTLEFS on-disk version"
|
||||
default 0x0
|
||||
depends on FS_LITTLEFS_MULTI_VERSION
|
||||
---help---
|
||||
The LITTLEFS disk version to use.
|
||||
|
||||
0 means to leave it to the default from the LITTLEFS.
|
||||
0x00020000 means 2.0.
|
||||
0x00020001 means 2.1.
|
||||
|
||||
endif
|
||||
|
|
|
@ -50,6 +50,9 @@ CFLAGS += -DLFS_CONFIG=../lfs_vfs.h
|
|||
CFLAGS += -DLFS_NAME_MAX=$(CONFIG_FS_LITTLEFS_NAME_MAX)
|
||||
CFLAGS += -DLFS_FILE_MAX=$(CONFIG_FS_LITTLEFS_FILE_MAX)
|
||||
CFLAGS += -DLFS_ATTR_MAX=$(CONFIG_FS_LITTLEFS_ATTR_MAX)
|
||||
ifeq ($(CONFIG_FS_LITTLEFS_MULTI_VERSION),y)
|
||||
CFLAGS += -DLFS_MULTIVERSION
|
||||
endif
|
||||
|
||||
LITTLEFS_TARBALL = $(CONFIG_FS_LITTLEFS_VERSION).tar.gz
|
||||
|
||||
|
|
|
@ -1323,6 +1323,10 @@ static int littlefs_bind(FAR struct inode *driver, FAR const void *data,
|
|||
fs->cfg.lookahead_size = CONFIG_FS_LITTLEFS_LOOKAHEAD_SIZE;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FS_LITTLEFS_MULTI_VERSION
|
||||
fs->cfg.disk_version = CONFIG_FS_LITTLEFS_DISK_VERSION;
|
||||
#endif
|
||||
|
||||
/* Then get information about the littlefs filesystem on the devices
|
||||
* managed by this driver.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue