fs/cromfs: Block length only needs to be uint16_t, not uint32_t. Add pading to node structure to assue that alignment is the same on all platforms. tools/gencromfs.c: Fix the target offset of the '.' hard link.

This commit is contained in:
Gregory Nutt
2018-03-24 14:44:38 -06:00
parent 853c1234ac
commit 67e0603b5a
4 changed files with 15 additions and 8 deletions
+2
View File
@@ -249,6 +249,8 @@ configuration:
Or the apps/examples/elf example if you like:
CONFIG_ELF=y
# CONFIG_BINFMT_DISABLE is not set
CONFIG_EXAMPLES_ELF=y
CONFIG_EXAMPLES_ELF_CROMFS=y
+1
View File
@@ -120,6 +120,7 @@ struct cromfs_volume_s
struct cromfs_node_s
{
uint16_t cn_mode; /* File type, attributes, and access mode bits */
uint16_t cn_pad; /* Not used */
uint32_t cn_name; /* Offset from the beginning of the volume header to the
* node name string. NUL-terminated. */
uint32_t cn_size; /* Size of the uncompressed data (in bytes) */
+3 -3
View File
@@ -71,9 +71,9 @@
struct cromfs_file_s
{
FAR const struct cromfs_node_s *ff_node; /* The open file node */
uint32_t ff_offset; /* Cached offset (zero means none) */
uint32_t ff_ulen; /* Length of uncompressed data in cache */
FAR uint8_t *ff_buffer; /* Decompression buffer */
uint32_t ff_offset; /* Cached block offset (zero means none) */
uint16_t ff_ulen; /* Length of decompressed data in cache */
FAR uint8_t *ff_buffer; /* Cached, decompressed data */
};
/* This is the form of the callback from cromfs_foreach_node(): */