Skip to content

Commit 322765b

Browse files
xiaoxiang781216GUIDINGLI
authored andcommitted
fs/romfs: Align up the file size to 16 bytes
and set volume size to 96 bytes in romfs_mkfs Signed-off-by: Xiang Xiao <[email protected]>
1 parent 7814c40 commit 322765b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/romfs/fs_romfsutil.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ static int romfs_cachenode(FAR struct romfs_mountpt_s *rm,
650650
uint32_t totalsize = ROMFS_ALIGNUP(ROMFS_FHDR_NAME + nsize + 1);
651651
if (offset == origoffset)
652652
{
653-
totalsize += size;
653+
totalsize += ROMFS_ALIGNUP(size);
654654
}
655655

656656
rm->rm_volsize += totalsize;
@@ -1463,9 +1463,9 @@ int romfs_mkfs(FAR struct romfs_mountpt_s *rm)
14631463

14641464
romfs_devmemcpy(rm, ROMFS_VHDR_ROM1FS, ROMFS_VHDR_MAGIC, ROMFS_VHDR_SIZE);
14651465

1466-
/* Init the ROMFS volume to zero */
1466+
/* Init the ROMFS volume size */
14671467

1468-
romfs_devwrite32(rm, ROMFS_VHDR_SIZE, 0);
1468+
romfs_devwrite32(rm, ROMFS_VHDR_SIZE, 0x60);
14691469

14701470
/* Write the volume name */
14711471

0 commit comments

Comments
 (0)