From 1a3a2f89c292fd14d2c415d198ce07dae52348fc Mon Sep 17 00:00:00 2001 From: Akira Hayakawa Date: Tue, 20 Oct 2026 10:08:45 +0000 Subject: [PATCH 1/3] Add justfile Signed-off-by: Akira Hayakawa --- justfile | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 justfile diff --git a/justfile b/justfile new file mode 100644 index 0000000..a869c51 --- /dev/null +++ b/justfile @@ -0,0 +1,7 @@ +[working-directory("src")] +build: + make KERNEL_TREE="$HOME/linux" + +[working-directory("src")] +clean: + make clean KERNEL_TREE="$HOME/linux" From d685ad3d08d3c0141b14c7e66525aa99e4e68201 Mon Sep 17 00:00:00 2001 From: Akira Hayakawa Date: Tue, 20 Oct 2026 22:59:00 +0000 Subject: [PATCH 2/3] ci: refactor Signed-off-by: Akira Hayakawa --- .github/workflows/ci.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e19548e..1f2523e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,15 +11,21 @@ on: jobs: run_tests: name: Tests - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Kernel version run: uname -a + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install just + uses: extractions/setup-just@v4 + - name: Install dependencies uses: awalsh128/cache-apt-pkgs-action@latest with: - packages: cargo dkms cryptsetup xfsprogs dbench stress + packages: dkms cryptsetup xfsprogs dbench stress version: 1.0 - name: Check cryptsetup enabled @@ -56,12 +62,12 @@ jobs: - name: Install dm-writeboost-tools working-directory: tools - run: sudo cargo install --path . --root /usr/local + run: make install - name: Test (wb-command) - working-directory: tests/wb-command-tests - run: sudo make test + working-directory: tests + run: just wb-command-tests - name: Test (writeboost) - working-directory: tests/writeboost-tests - run: sudo make test \ No newline at end of file + working-directory: tests + run: just writeboost-tests From 427a6a560d5597b5852b7e45e2d70f8953ef6701 Mon Sep 17 00:00:00 2001 From: Akira Hayakawa Date: Tue, 20 Oct 2026 23:42:45 +0000 Subject: [PATCH 3/3] Introduce DM_IO_HAS_IOPRIO flag Signed-off-by: Akira Hayakawa --- src/Makefile | 9 +++++++++ src/dm-writeboost-target.c | 7 +------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Makefile b/src/Makefile index abc82ff..fe48cbd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,15 @@ KERNEL_SOURCE_VERSION ?= $(shell uname -r) KERNEL_TREE ?= /lib/modules/$(KERNEL_SOURCE_VERSION)/build +ifneq ($(srctree),) +wb_dm_io_header := $(srctree)/include/linux/dm-io.h + +# Linux commit 6e5f0f6383b4896c7e9b943d84b136149d0f45e9 "dm io: Support IO priority" +# added the IO priority parameter in v6.9-rc1. +# The dm-io ioprio argument is also backported to stable kernels. +ccflags-y += -DDM_IO_HAS_IOPRIO=$(if $(shell grep -w ioprio $(wb_dm_io_header)),1,0) +endif + obj-m := dm-writeboost.o dm-writeboost-objs := \ dm-writeboost-target.o \ diff --git a/src/dm-writeboost-target.c b/src/dm-writeboost-target.c index d924525..84e4328 100644 --- a/src/dm-writeboost-target.c +++ b/src/dm-writeboost-target.c @@ -26,12 +26,7 @@ #include "linux/sort.h" -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,2)) || \ - ((LINUX_VERSION_CODE >= KERNEL_VERSION(6,7,11)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6,8,0))) || \ - ((LINUX_VERSION_CODE >= KERNEL_VERSION(6,6,23)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6,7,0))) || \ - ((LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,83)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6,2,0))) -// Linux commit 6e5f0f6383b4896c7e9b943d84b136149d0f45e9 "dm io: Support IO priority" -// added the IO priority parameter in v6.9-rc1. +#if DM_IO_HAS_IOPRIO #define DM_IO(arg1, arg2, arg3, arg4) dm_io(arg1, arg2, arg3, arg4, IOPRIO_DEFAULT) #else #define DM_IO(arg1, arg2, arg3, arg4) dm_io(arg1, arg2, arg3, arg4)