fs: allow setting max file name explicitly

Zephyr allows an application to register additional file systems,
which may have maximum filename lengths different from the in-tree
FatFs and littlefs options.  Provide a Kconfig variable that allows
the default inference to be overridden.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
Peter A. Bigot 2020-08-14 10:41:01 -05:00 committed by Carles Cufí
commit ad782596ea
2 changed files with 17 additions and 0 deletions

View file

@ -13,6 +13,10 @@
extern "C" {
#endif
#if (CONFIG_FILE_SYSTEM_MAX_FILE_NAME - 0) > 0
#define MAX_FILE_NAME CONFIG_FILE_SYSTEM_MAX_FILE_NAME
#else /* CONFIG_FILE_SYSTEM_MAX_FILE_NAME */
/* Select from enabled file systems */
#if defined(CONFIG_FILE_SYSTEM_LITTLEFS)
#define MAX_FILE_NAME 256
#elif defined(CONFIG_FAT_FILESYSTEM_ELM)
@ -25,6 +29,7 @@ extern "C" {
/* Use standard 8.3 when no filesystem is explicitly selected */
#define MAX_FILE_NAME 12
#endif /* filesystem selection */
#endif /* CONFIG_FILE_SYSTEM_MAX_FILE_NAME */
/* Type for fs_open flags */
typedef uint8_t fs_mode_t;