fs: Set MAX_FILE_NAME appropiately with LFN and FATFS

Try to define MAX_FILE_NAME to the appropriate max length based on the
selected filesystm. Otherwise fallback to a standard filename of 12
(made up of 8.3 : <filename>.<extension>)

Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
This commit is contained in:
Roman Vaughan 2020-05-30 23:57:17 +12:00 committed by Carles Cufí
commit 42ee2e0938

View file

@ -13,9 +13,16 @@ extern "C" {
#if defined(CONFIG_FILE_SYSTEM_LITTLEFS)
#define MAX_FILE_NAME 256
#else /* FAT_FS */
#elif defined(CONFIG_FAT_FILESYSTEM_ELM)
#if defined(CONFIG_FS_FATFS_LFN)
#define MAX_FILE_NAME CONFIG_FS_FATFS_MAX_LFN
#else /* CONFIG_FS_FATFS_LFN */
#define MAX_FILE_NAME 12 /* Uses 8.3 SFN */
#endif
#endif /* CONFIG_FS_FATFS_LFN */
#else /* filesystem selection */
/* Use standard 8.3 when no filesystem is explicitly selected */
#define MAX_FILE_NAME 12
#endif /* filesystem selection */
struct fs_mount_t;