Skip to content

Commit

Permalink
Merge pull request #195 from akiradeveloper/for-2.2.9
Browse files Browse the repository at this point in the history
For 2.2.9
  • Loading branch information
akiradeveloper committed Jun 9, 2018
2 parents 23ce6b8 + b6a84d9 commit c23fed3
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 19 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2018-06-09 Akira Hayakawa <ruby.wktk@gmail.com>

* v2.2.9
* Fix build error with 4.15 kernel
* Fix build error with 4.17 kernel

2017-10-15 Akira Hayakawa <ruby.wktk@gmail.com>

* v2.2.8
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MODULE_VERSION ?= 2.2.8
MODULE_VERSION ?= 2.2.9
DKMS_DIR := /usr/src/dm-writeboost-$(MODULE_VERSION)
DKMS_KEY := -m dm-writeboost -v $(MODULE_VERSION)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Awarded by Japanese OSS Encouragement Award. Thanks!

## License
```
Copyright (C) 2012-2017 Akira Hayakawa <ruby.wktk@gmail.com>
Copyright (C) 2012-2018 Akira Hayakawa <ruby.wktk@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/dkms.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME="dm-writeboost"
PACKAGE_VERSION="2.2.8"
PACKAGE_VERSION="2.2.9"
BUILT_MODULE_NAME="dm-writeboost"
DEST_MODULE_LOCATION="/kernel/drivers/md"
MAKE="make all KERNEL_TREE=$kernel_source_dir"
Expand Down
16 changes: 8 additions & 8 deletions src/dm-writeboost-daemon.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of dm-writeboost
* Copyright (C) 2012-2017 Akira Hayakawa <ruby.wktk@gmail.com>
* Copyright (C) 2012-2018 Akira Hayakawa <ruby.wktk@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -395,7 +395,7 @@ static u32 calc_nr_writeback(struct wb_device *wb)
atomic64_read(&wb->last_flushed_segment_id)
- atomic64_read(&wb->last_writeback_segment_id);

u32 nr_max_batch = ACCESS_ONCE(wb->nr_max_batched_writeback);
u32 nr_max_batch = read_once(wb->nr_max_batched_writeback);
if (wb->nr_writeback_segs != nr_max_batch)
try_alloc_writeback_ios(wb, nr_max_batch, GFP_NOIO | __GFP_NOWARN);

Expand All @@ -404,9 +404,9 @@ static u32 calc_nr_writeback(struct wb_device *wb)

static bool should_writeback(struct wb_device *wb)
{
return ACCESS_ONCE(wb->allow_writeback) ||
ACCESS_ONCE(wb->urge_writeback) ||
ACCESS_ONCE(wb->force_drop);
return read_once(wb->allow_writeback) ||
read_once(wb->urge_writeback) ||
read_once(wb->force_drop);
}

static void do_writeback_proc(struct wb_device *wb)
Expand Down Expand Up @@ -487,7 +487,7 @@ int writeback_modulator_proc(void *data)

util = div_u64(100 * (new - old), 1000);

if (util < ACCESS_ONCE(wb->writeback_threshold))
if (util < read_once(wb->writeback_threshold))
wb->allow_writeback = true;
else
wb->allow_writeback = false;
Expand Down Expand Up @@ -545,7 +545,7 @@ int sb_record_updater_proc(void *data)

while (!kthread_should_stop()) {
/* sec -> ms */
intvl = ACCESS_ONCE(wb->update_sb_record_interval) * 1000;
intvl = read_once(wb->update_sb_record_interval) * 1000;

if (!intvl) {
schedule_timeout_interruptible(msecs_to_jiffies(1000));
Expand All @@ -567,7 +567,7 @@ int data_synchronizer_proc(void *data)

while (!kthread_should_stop()) {
/* sec -> ms */
intvl = ACCESS_ONCE(wb->sync_data_interval) * 1000;
intvl = read_once(wb->sync_data_interval) * 1000;

if (!intvl) {
schedule_timeout_interruptible(msecs_to_jiffies(1000));
Expand Down
2 changes: 1 addition & 1 deletion src/dm-writeboost-daemon.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of dm-writeboost
* Copyright (C) 2012-2017 Akira Hayakawa <ruby.wktk@gmail.com>
* Copyright (C) 2012-2018 Akira Hayakawa <ruby.wktk@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/dm-writeboost-metadata.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of dm-writeboost
* Copyright (C) 2012-2017 Akira Hayakawa <ruby.wktk@gmail.com>
* Copyright (C) 2012-2018 Akira Hayakawa <ruby.wktk@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/dm-writeboost-metadata.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of dm-writeboost
* Copyright (C) 2012-2017 Akira Hayakawa <ruby.wktk@gmail.com>
* Copyright (C) 2012-2018 Akira Hayakawa <ruby.wktk@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
13 changes: 9 additions & 4 deletions src/dm-writeboost-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Log-structured Caching for Linux
*
* This file is part of dm-writeboost
* Copyright (C) 2012-2017 Akira Hayakawa <ruby.wktk@gmail.com>
* Copyright (C) 2012-2018 Akira Hayakawa <ruby.wktk@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -782,7 +782,7 @@ static bool reserve_read_cache_cell(struct wb_device *wb, struct bio *bio)

ASSERT(cells->threshold > 0);

if (!ACCESS_ONCE(wb->read_cache_threshold))
if (!read_once(wb->read_cache_threshold))
return false;

if (!cells->cursor)
Expand Down Expand Up @@ -973,7 +973,7 @@ static void reinit_read_cache_cells(struct wb_device *wb)
struct read_cache_cell *cell = cells->array + i;
cell->cancelled = false;
}
cur_threshold = ACCESS_ONCE(wb->read_cache_threshold);
cur_threshold = read_once(wb->read_cache_threshold);
if (cur_threshold && (cur_threshold != cells->threshold)) {
cells->threshold = cur_threshold;
cells->over_threshold = false;
Expand Down Expand Up @@ -1840,7 +1840,12 @@ static void writeboost_postsuspend(struct dm_target *ti)
blkdev_issue_flush(wb->cache_dev->bdev, GFP_NOIO, NULL);
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)
static int writeboost_message(struct dm_target *ti, unsigned argc, char **argv,
char *result, unsigned maxlen)
#else
static int writeboost_message(struct dm_target *ti, unsigned argc, char **argv)
#endif
{
struct wb_device *wb = ti->private;

Expand Down Expand Up @@ -1942,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, 8},
.version = {2, 2, 9},
.module = THIS_MODULE,
.map = writeboost_map,
.end_io = writeboost_end_io,
Expand Down
10 changes: 9 additions & 1 deletion src/dm-writeboost.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of dm-writeboost
* Copyright (C) 2012-2017 Akira Hayakawa <ruby.wktk@gmail.com>
* Copyright (C) 2012-2018 Akira Hayakawa <ruby.wktk@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -520,4 +520,12 @@ sector_t dm_devsize(struct dm_dev *);

/*----------------------------------------------------------------------------*/

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
#define read_once(x) READ_ONCE(x)
#else
#define read_once(x) ACCESS_ONCE(x)
#endif

/*----------------------------------------------------------------------------*/

#endif

0 comments on commit c23fed3

Please sign in to comment.