summaryrefslogtreecommitdiff
path: root/include/fat.h
diff options
context:
space:
mode:
authorTien Fong Chee <tfchee@altera.com>2016-07-28 06:08:56 (GMT)
committerTom Rini <trini@konsulko.com>2016-11-29 01:09:45 (GMT)
commit7aa1a6b71c9af4651f6b3a164c84096a84d24285 (patch)
treeb47cc2339c644563f59ffb2474c6b6105af76cbe /include/fat.h
parente94793c844a40606252f2e3f6428063e057b3fd2 (diff)
downloadu-boot-fsl-qoriq-7aa1a6b71c9af4651f6b3a164c84096a84d24285.tar.xz
fs/fat/fatwrite: Local variable as buffer to store dir_slot entries
fill_dir_slot use get_contents_vfatname_block as a temporary buffer for constructing a list of dir_slot entries. To save the memory and providing correct type of memory for above usage, a local buffer with accurate size declaration is introduced. The local array size 640 is used because for long file name entry, each entry use 32 bytes, one entry can store up to 13 characters. The maximum number of entry possible is 20. So, total size is 32*20=640bytes. Signed-off-by: Genevieve Chan <ccheauya@altera.com> Signed-off-by: Tien Fong Chee <tfchee@altera.com>
Diffstat (limited to 'include/fat.h')
-rw-r--r--include/fat.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/fat.h b/include/fat.h
index 8ec91cd..e38f380 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -33,6 +33,8 @@
#define FAT16BUFSIZE (FATBUFSIZE/2)
#define FAT32BUFSIZE (FATBUFSIZE/4)
+/* Maximum number of entry for long file name according to spec */
+#define MAX_LFN_SLOT 20
/* Filesystem identifiers */
#define FAT12_SIGN "FAT12 "