1
0
mirror of https://github.com/Zygo/bees.git synced 2025-10-13 22:03:37 +02:00

2 Commits

Author SHA1 Message Date
Zygo Blaxell
00efedfe75 Makefile: armv6l does not have builtin atomics, needs -latomic
Mad props for running bees on an architecture so ancient that it doesn't
even have floating point.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
2025-09-13 04:43:52 -04:00
Zygo Blaxell
5a36a2ce9c readahead: size_t is 32 bits on ILP32 platforms
Cast size_t so it matches uint64_t for the std::min template.

Fixes: https://github.com/Zygo/bees/issues/323
Signed-off-by: Zygo Blaxell <bees@furryterror.org>
2025-09-12 03:12:06 -04:00
3 changed files with 4 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ all: $(BEES)
include ../makeflags
-include ../localconf
LIBS = -lcrucible -lpthread
LIBS = -lcrucible -lpthread -latomic
BEES_LDFLAGS = -L../lib $(LDFLAGS)
BEES_OBJS = \

View File

@@ -255,12 +255,12 @@ bees_readahead_nolock(int const fd, const off_t offset, const size_t size)
// The btrfs kernel code does readahead with lower ioprio
// and might discard the readahead request entirely.
BEESNOTE("emulating readahead " << name_fd(fd) << " offset " << to_hex(offset) << " len " << pretty(size));
auto working_size = min(size, uint64_t(128 * 1024 * 1024));
auto working_size = min(uint64_t(size), uint64_t(128 * 1024 * 1024));
auto working_offset = offset;
while (working_size) {
// don't care about multithreaded writes to this buffer--it is garbage anyway
static uint8_t dummy[BEES_READAHEAD_SIZE];
const size_t this_read_size = min(working_size, sizeof(dummy));
const size_t this_read_size = min(working_size, uint64_t(sizeof(dummy)));
// Ignore errors and short reads. It turns out our size
// parameter isn't all that accurate, so we can't use
// the pread_or_die template.

View File

@@ -19,7 +19,7 @@ FORCE:
include ../makeflags
-include ../localconf
LIBS = -lcrucible -lpthread
LIBS = -lcrucible -lpthread -latomic
BEES_LDFLAGS = -L../lib $(LDFLAGS)
%.dep: %.cc tests.h Makefile