Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
working-directory: tests
run: just writeboost-tests
7 changes: 7 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[working-directory("src")]
build:
make KERNEL_TREE="$HOME/linux"

[working-directory("src")]
clean:
make clean KERNEL_TREE="$HOME/linux"
9 changes: 9 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
7 changes: 1 addition & 6 deletions src/dm-writeboost-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading