From af218c398d1f18877a3c54a2c255d8fb5b867df0 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Tue, 6 Nov 2018 13:37:25 -0200 Subject: [PATCH 1/4] Fix building for linux 4.19. linux 4.19 has introduced STAT_WRITE and STAT_READ for partition stat entries. This conflicts with dm-writeboost own STAT_WRITE, which was renamed as WB_STAT_WRITE. The same pattern renaming was applied to other values. Signed-off-by: Thadeu Lima de Souza Cascardo --- src/dm-writeboost-target.c | 8 ++++---- src/dm-writeboost.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/dm-writeboost-target.c b/src/dm-writeboost-target.c index a0b10478..9846bf65 100644 --- a/src/dm-writeboost-target.c +++ b/src/dm-writeboost-target.c @@ -424,13 +424,13 @@ static void inc_stat(struct wb_device *wb, int i = 0; if (rw) - i |= (1 << STAT_WRITE); + i |= (1 << WB_STAT_WRITE); if (found) - i |= (1 << STAT_HIT); + i |= (1 << WB_STAT_HIT); if (on_buffer) - i |= (1 << STAT_ON_BUFFER); + i |= (1 << WB_STAT_ON_BUFFER); if (fullsize) - i |= (1 << STAT_FULLSIZE); + i |= (1 << WB_STAT_FULLSIZE); v = &wb->stat[i]; atomic64_inc(v); diff --git a/src/dm-writeboost.h b/src/dm-writeboost.h index f771dde3..da6dd1b6 100644 --- a/src/dm-writeboost.h +++ b/src/dm-writeboost.h @@ -232,10 +232,10 @@ struct read_cache_cells { /*----------------------------------------------------------------------------*/ enum STATFLAG { - STAT_WRITE = 3, /* Write or read */ - STAT_HIT = 2, /* Hit or miss */ - STAT_ON_BUFFER = 1, /* Found on buffer or on the cache device */ - STAT_FULLSIZE = 0, /* Bio is fullsize or partial */ + WB_STAT_WRITE = 3, /* Write or read */ + WB_STAT_HIT = 2, /* Hit or miss */ + WB_STAT_ON_BUFFER = 1, /* Found on buffer or on the cache device */ + WB_STAT_FULLSIZE = 0, /* Bio is fullsize or partial */ }; #define STATLEN (1 << 4) From f81f0f9df7629099fda7adbfaaa991b3aa71af1a Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Tue, 6 Nov 2018 13:52:07 -0200 Subject: [PATCH 2/4] Fix calling dm_kcopyd_zero on linux 4.19. On linux 4.19, dm_kcopyd_zero was changed to return void instead of int, because dm_kcopyd_copy always returned 0. As that has been since the introduction of kcopyd, there should be no problem ignoring its return value even on versions where it would still return an int. Signed-off-by: Thadeu Lima de Souza Cascardo --- src/dm-writeboost-metadata.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/dm-writeboost-metadata.c b/src/dm-writeboost-metadata.c index ea922716..456ab7ee 100644 --- a/src/dm-writeboost-metadata.c +++ b/src/dm-writeboost-metadata.c @@ -438,13 +438,10 @@ static void zeroing_complete(int read_err, unsigned long write_err, void *contex */ static int do_zeroing_region(struct wb_device *wb, struct dm_io_region *region) { - int err; struct zeroing_context zc; zc.error = 0; init_completion(&zc.complete); - err = dm_kcopyd_zero(wb->copier, 1, region, 0, zeroing_complete, &zc); - if (err) - return err; + dm_kcopyd_zero(wb->copier, 1, region, 0, zeroing_complete, &zc); wait_for_completion(&zc.complete); return zc.error; } From 0347de2380acea22a4a6b9e780935e8ddc5fd92b Mon Sep 17 00:00:00 2001 From: Akira Hayakawa Date: Thu, 8 Nov 2018 11:14:45 +0900 Subject: [PATCH 3/4] bump version to 2.2.10 Signed-off-by: Akira Hayakawa --- Makefile | 2 +- src/dkms.conf | 2 +- src/dm-writeboost-target.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index fad30056..4e9c21cb 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -MODULE_VERSION ?= 2.2.9 +MODULE_VERSION ?= 2.2.10 DKMS_DIR := /usr/src/dm-writeboost-$(MODULE_VERSION) DKMS_KEY := -m dm-writeboost -v $(MODULE_VERSION) diff --git a/src/dkms.conf b/src/dkms.conf index 80d599f1..5d6bbdf2 100644 --- a/src/dkms.conf +++ b/src/dkms.conf @@ -1,5 +1,5 @@ PACKAGE_NAME="dm-writeboost" -PACKAGE_VERSION="2.2.9" +PACKAGE_VERSION="2.2.10" BUILT_MODULE_NAME="dm-writeboost" DEST_MODULE_LOCATION="/kernel/drivers/md" MAKE="make all KERNEL_TREE=$kernel_source_dir" diff --git a/src/dm-writeboost-target.c b/src/dm-writeboost-target.c index 9846bf65..7c354fae 100644 --- a/src/dm-writeboost-target.c +++ b/src/dm-writeboost-target.c @@ -1947,7 +1947,7 @@ static void writeboost_status(struct dm_target *ti, status_type_t type, static struct target_type writeboost_target = { .name = "writeboost", - .version = {2, 2, 9}, + .version = {2, 2, 10}, .module = THIS_MODULE, .map = writeboost_map, .end_io = writeboost_end_io, From b81784f77a080760c8fbf96d73b5767129f8f27e Mon Sep 17 00:00:00 2001 From: Akira Hayakawa Date: Thu, 8 Nov 2018 12:59:33 +0900 Subject: [PATCH 4/4] close #199 update ChangeLog for v2.2.10 Signed-off-by: Akira Hayakawa --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1e37ad22..82f76af7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2018-11-08 Akira Hayakawa + + * v2.2.10 + * Fix build error with 4.19 kernel + 2018-06-09 Akira Hayakawa * v2.2.9