diff --git a/lfs3.c b/lfs3.c index 16ee7691..ece679d2 100644 --- a/lfs3.c +++ b/lfs3.c @@ -5202,6 +5202,7 @@ static inline bool lfs3_o_isbshrub(uint32_t flags); // claim all btrees known to the system // // note this doesn't, and can't, include any stack allocated btrees +#ifndef LFS3_RDONLY static void lfs3_fs_claimbtree(lfs3_t *lfs3, lfs3_btree_t *btree) { // claim the mtree if (&lfs3->mtree != btree @@ -5231,6 +5232,7 @@ static void lfs3_fs_claimbtree(lfs3_t *lfs3, lfs3_btree_t *btree) { } } } +#endif // branch on-disk encoding @@ -10807,7 +10809,7 @@ eot:; /// Optional on-disk block map /// -#if !defined(LFS3_RDONLY) && !defined(LFS3_2BONLY) && defined(LFS3_GBMAP) +#if !defined(LFS3_2BONLY) && defined(LFS3_GBMAP) static void lfs3_gbmap_init(lfs3_gbmap_t *gbmap) { gbmap->window = 0; gbmap->known = 0; @@ -17265,7 +17267,7 @@ failed:; #endif // enable the global on-disk block-map -#if !defined(LFs3_RDONLY) && defined(LFS3_GBMAP) && !defined(LFS3_YES_GBMAP) +#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP) && !defined(LFS3_YES_GBMAP) int lfs3_fs_mkgbmap(lfs3_t *lfs3) { // do nothing if we already have a gbmap if (lfs3_f_isgbmap(lfs3->flags)) { @@ -17324,7 +17326,7 @@ failed:; #endif // disable the global on-disk block-map -#if !defined(LFs3_RDONLY) && defined(LFS3_GBMAP) && !defined(LFS3_YES_GBMAP) +#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP) && !defined(LFS3_YES_GBMAP) int lfs3_fs_rmgbmap(lfs3_t *lfs3) { // do nothing if we already don't have a gbmap if (!lfs3_f_isgbmap(lfs3->flags)) { diff --git a/lfs3.h b/lfs3.h index 0a663386..8adea5a2 100644 --- a/lfs3.h +++ b/lfs3.h @@ -192,11 +192,11 @@ enum lfs3_type { #define LFS3_F_CKMETA 0x00001000 // Check metadata checksums #define LFS3_F_CKDATA 0x00002000 // Check metadata + data checksums +#endif #ifdef LFS3_GBMAP #define LFS3_F_GBMAP 0x01000000 // Use the global on-disk block-map #endif -#endif // Filesystem mount flags #define LFS3_M_MODE 1 // Mount's access mode @@ -1488,7 +1488,7 @@ int lfs3_fs_grow(lfs3_t *lfs3, lfs3_size_t block_count); // // Returns a negative error code on failure. Does nothing if a gbmap // already exists. -#if !defined(LFs3_RDONLY) && defined(LFS3_GBMAP) && !defined(LFS3_YES_GBMAP) +#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP) && !defined(LFS3_YES_GBMAP) int lfs3_fs_mkgbmap(lfs3_t *lfs3); #endif @@ -1496,7 +1496,7 @@ int lfs3_fs_mkgbmap(lfs3_t *lfs3); // // Returns a negative error code on failure. Does nothing if no gbmap // is found. -#if !defined(LFs3_RDONLY) && defined(LFS3_GBMAP) && !defined(LFS3_YES_GBMAP) +#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP) && !defined(LFS3_YES_GBMAP) int lfs3_fs_rmgbmap(lfs3_t *lfs3); #endif