diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-cache-target.c | 5 | ||||
-rw-r--r-- | drivers/md/dm-log-userspace-base.c | 5 | ||||
-rw-r--r-- | drivers/md/dm-thin.c | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 1e96d7889f51..2eca128a9d6a 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/dm-io.h> | 12 | #include <linux/dm-io.h> |
13 | #include <linux/dm-kcopyd.h> | 13 | #include <linux/dm-kcopyd.h> |
14 | #include <linux/jiffies.h> | ||
14 | #include <linux/init.h> | 15 | #include <linux/init.h> |
15 | #include <linux/mempool.h> | 16 | #include <linux/mempool.h> |
16 | #include <linux/module.h> | 17 | #include <linux/module.h> |
@@ -1547,8 +1548,8 @@ static void process_bio(struct cache *cache, struct prealloc *structs, | |||
1547 | 1548 | ||
1548 | static int need_commit_due_to_time(struct cache *cache) | 1549 | static int need_commit_due_to_time(struct cache *cache) |
1549 | { | 1550 | { |
1550 | return jiffies < cache->last_commit_jiffies || | 1551 | return !time_in_range(jiffies, cache->last_commit_jiffies, |
1551 | jiffies > cache->last_commit_jiffies + COMMIT_PERIOD; | 1552 | cache->last_commit_jiffies + COMMIT_PERIOD); |
1552 | } | 1553 | } |
1553 | 1554 | ||
1554 | static int commit_if_needed(struct cache *cache) | 1555 | static int commit_if_needed(struct cache *cache) |
diff --git a/drivers/md/dm-log-userspace-base.c b/drivers/md/dm-log-userspace-base.c index b953db6cc229..03177ca0b009 100644 --- a/drivers/md/dm-log-userspace-base.c +++ b/drivers/md/dm-log-userspace-base.c | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | #include <linux/bio.h> | 7 | #include <linux/bio.h> |
8 | #include <linux/slab.h> | 8 | #include <linux/slab.h> |
9 | #include <linux/jiffies.h> | ||
9 | #include <linux/dm-dirty-log.h> | 10 | #include <linux/dm-dirty-log.h> |
10 | #include <linux/device-mapper.h> | 11 | #include <linux/device-mapper.h> |
11 | #include <linux/dm-log-userspace.h> | 12 | #include <linux/dm-log-userspace.h> |
@@ -829,7 +830,7 @@ static int userspace_is_remote_recovering(struct dm_dirty_log *log, | |||
829 | int r; | 830 | int r; |
830 | uint64_t region64 = region; | 831 | uint64_t region64 = region; |
831 | struct log_c *lc = log->context; | 832 | struct log_c *lc = log->context; |
832 | static unsigned long long limit; | 833 | static unsigned long limit; |
833 | struct { | 834 | struct { |
834 | int64_t is_recovering; | 835 | int64_t is_recovering; |
835 | uint64_t in_sync_hint; | 836 | uint64_t in_sync_hint; |
@@ -845,7 +846,7 @@ static int userspace_is_remote_recovering(struct dm_dirty_log *log, | |||
845 | */ | 846 | */ |
846 | if (region < lc->in_sync_hint) | 847 | if (region < lc->in_sync_hint) |
847 | return 0; | 848 | return 0; |
848 | else if (jiffies < limit) | 849 | else if (time_after(limit, jiffies)) |
849 | return 1; | 850 | return 1; |
850 | 851 | ||
851 | limit = jiffies + (HZ / 4); | 852 | limit = jiffies + (HZ / 4); |
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 493478989dbd..0f781451ea3f 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/device-mapper.h> | 11 | #include <linux/device-mapper.h> |
12 | #include <linux/dm-io.h> | 12 | #include <linux/dm-io.h> |
13 | #include <linux/dm-kcopyd.h> | 13 | #include <linux/dm-kcopyd.h> |
14 | #include <linux/jiffies.h> | ||
14 | #include <linux/log2.h> | 15 | #include <linux/log2.h> |
15 | #include <linux/list.h> | 16 | #include <linux/list.h> |
16 | #include <linux/rculist.h> | 17 | #include <linux/rculist.h> |
@@ -1700,8 +1701,8 @@ static void process_cell_fail(struct thin_c *tc, struct dm_bio_prison_cell *cell | |||
1700 | */ | 1701 | */ |
1701 | static int need_commit_due_to_time(struct pool *pool) | 1702 | static int need_commit_due_to_time(struct pool *pool) |
1702 | { | 1703 | { |
1703 | return jiffies < pool->last_commit_jiffies || | 1704 | return !time_in_range(jiffies, pool->last_commit_jiffies, |
1704 | jiffies > pool->last_commit_jiffies + COMMIT_PERIOD; | 1705 | pool->last_commit_jiffies + COMMIT_PERIOD); |
1705 | } | 1706 | } |
1706 | 1707 | ||
1707 | #define thin_pbd(node) rb_entry((node), struct dm_thin_endio_hook, rb_node) | 1708 | #define thin_pbd(node) rb_entry((node), struct dm_thin_endio_hook, rb_node) |