gkostka / lwext4

ext2/ext3/ext4 filesystem library for microcontrollers
http://sourceforge.net/projects/lwext4/
Other
491 stars 128 forks source link

fix: properly gate extents use behind the configuration toggle #61

Closed cyyynthia closed 2 years ago

cyyynthia commented 2 years ago

Disabling extents via the configuration flag was causing the compilation to fail, due to the symbols still being used. This PR adds the necessary check if CONFIG_EXTENTS_ENABLE isn't 0.

huven commented 2 years ago

I think it is better to remove EXT4_FINCOM_EXTENTS from EXT4_SUPPORTED_FINCOM (ext4_types.h line 281) if CONFIG_EXTENTS_ENABLE=0

This has the added benefit that ext4_fs_check_features() will prevent filesystems with this feature set being mounted (and probably corrupted).

This will also set CONFIG_EXTENT_ENABLE to the correct value, so no changes required to ext4_fs.c.