diff options
Diffstat (limited to 'drivers/md/dm-cache-target.c')
-rw-r--r-- | drivers/md/dm-cache-target.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index e1650539cc2f..7755af351867 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> |
@@ -1562,8 +1563,8 @@ static void process_bio(struct cache *cache, struct prealloc *structs, | |||
1562 | 1563 | ||
1563 | static int need_commit_due_to_time(struct cache *cache) | 1564 | static int need_commit_due_to_time(struct cache *cache) |
1564 | { | 1565 | { |
1565 | return jiffies < cache->last_commit_jiffies || | 1566 | return !time_in_range(jiffies, cache->last_commit_jiffies, |
1566 | jiffies > cache->last_commit_jiffies + COMMIT_PERIOD; | 1567 | cache->last_commit_jiffies + COMMIT_PERIOD); |
1567 | } | 1568 | } |
1568 | 1569 | ||
1569 | static int commit_if_needed(struct cache *cache) | 1570 | static int commit_if_needed(struct cache *cache) |