Skip to content

Conversation

justinbrewer
Copy link

@justinbrewer justinbrewer commented Nov 25, 2024

New versions of btrfs-progs dropped radix_tree and made incompatible changes to kerncompat.h. radix_tree was overkill, since it was only used to track if a page had been seen before.

Replace radix_tree with a simple bitmap, and drop the broken imported source files.

Fixes #52

New versions of btrfs-progs dropped radix_tree and made incompatible
changes to kerncompat.h. radix_tree was overkill, since it was only
used to track if a page had been seen before.

Replace radix_tree with a simple bitmap, and drop the broken imported
source files.

Signed-off-by: Justin Brewer <[email protected]>
@jorti
Copy link

jorti commented Jan 23, 2025

I'm testing your patch but fails to build in Fedora 42:

+ /usr/bin/make -O -j24 V=1 VERBOSE=1
gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer   -c -o bitmap.o bitmap.c
bitmap.c: In function ‘resize’:
bitmap.c:22:25: error: implicit declaration of function ‘mremap’; did you mean ‘munmap’? [-Wimplicit-function-declaration]
   22 |         void *new_map = mremap(b->map, MAP_SIZE(b->size), MAP_SIZE(new_size),
      |                         ^~~~~~
      |                         munmap
bitmap.c:23:25: error: ‘MREMAP_MAYMOVE’ undeclared (first use in this function)
   23 |                         MREMAP_MAYMOVE);
      |                         ^~~~~~~~~~~~~~
bitmap.c:23:25: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Makefile:19: bitmap.o] Error 1

@justinbrewer
Copy link
Author

mremap/MREMAP_MAYMOVE are _GNU_SOURCE symbols. That was being set in CFLAGS in the Makefile, but looks like your package script overrides that. Pushed a patch to move that definition into the file that needs it, so package builds can work as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

btrfs-progs 6.10.1 breaks compilation of compsize
2 participants