From 5a664a4100c9e95e9eaf7c4ef8ab93c19263a1d3 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 21 May 2026 15:12:57 +0200 Subject: [PATCH] Avoid the limitation of 255 disks for the IO subsystem --- cmdline/io.c | 8 ++++---- cmdline/io.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmdline/io.c b/cmdline/io.c index 934f4c09..a5e92d93 100644 --- a/cmdline/io.c +++ b/cmdline/io.c @@ -570,7 +570,7 @@ static struct snapraid_task* io_task_read_thread(struct snapraid_io* io, unsigne thread_mutex_lock(&io->io_mutex); while (1) { - unsigned char* let; + unsigned* let; unsigned busy_index; /* get the index the IO is using */ @@ -658,7 +658,7 @@ static void io_parity_write_thread(struct snapraid_io* io, unsigned* pos, unsign thread_mutex_lock(&io->io_mutex); while (1) { - unsigned char* let; + unsigned* let; unsigned busy_index; /* get the next index the IO is going to use */ @@ -952,9 +952,9 @@ void io_init(struct snapraid_io* io, struct snapraid_state* state, } io->reader_map = malloc_nofail(sizeof(struct snapraid_worker) * io->reader_max); - io->reader_list = malloc_nofail(io->reader_max + 1); + io->reader_list = malloc_nofail(sizeof(unsigned) * (io->reader_max + 1)); io->writer_map = malloc_nofail(sizeof(struct snapraid_worker) * io->writer_max); - io->writer_list = malloc_nofail(io->writer_max + 1); + io->writer_list = malloc_nofail(sizeof(unsigned) * (io->writer_max + 1)); io->data_base = 0; io->data_count = handle_max; diff --git a/cmdline/io.h b/cmdline/io.h index 72acf265..b22904c2 100644 --- a/cmdline/io.h +++ b/cmdline/io.h @@ -294,8 +294,8 @@ struct snapraid_io { * To get the next element to process we use i = list[i + 1]. * The end is when i == reader_max. */ - unsigned char* reader_list; - unsigned char* writer_list; + unsigned* reader_list; + unsigned* writer_list; /** * Exit condition for all threads.