summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-log-userspace-base.c
diff options
context:
space:
mode:
authorManuel Schölling <manuel.schoelling@gmx.de>2014-05-22 22:42:37 +0200
committerMike Snitzer <snitzer@redhat.com>2015-02-09 13:06:48 -0500
commit0f30af98cbb111cebd99f09cb7b8cc8c9351c0b3 (patch)
tree1fa005c7f05e77550f0ef6cd0a3752a0422786df /drivers/md/dm-log-userspace-base.c
parent3ca5a21a9c02bdebe2d95268482031f002efcf23 (diff)
downloadtalos-obmc-linux-0f30af98cbb111cebd99f09cb7b8cc8c9351c0b3.tar.gz
talos-obmc-linux-0f30af98cbb111cebd99f09cb7b8cc8c9351c0b3.zip
dm: use time_in_range() and time_after()
To be future-proof and for better readability the time comparisons are modified to use time_in_range() and time_after() instead of plain, error-prone math. Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-log-userspace-base.c')
-rw-r--r--drivers/md/dm-log-userspace-base.c5
1 files changed, 3 insertions, 2 deletions
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 @@
#include <linux/bio.h>
#include <linux/slab.h>
+#include <linux/jiffies.h>
#include <linux/dm-dirty-log.h>
#include <linux/device-mapper.h>
#include <linux/dm-log-userspace.h>
@@ -829,7 +830,7 @@ static int userspace_is_remote_recovering(struct dm_dirty_log *log,
int r;
uint64_t region64 = region;
struct log_c *lc = log->context;
- static unsigned long long limit;
+ static unsigned long limit;
struct {
int64_t is_recovering;
uint64_t in_sync_hint;
@@ -845,7 +846,7 @@ static int userspace_is_remote_recovering(struct dm_dirty_log *log,
*/
if (region < lc->in_sync_hint)
return 0;
- else if (jiffies < limit)
+ else if (time_after(limit, jiffies))
return 1;
limit = jiffies + (HZ / 4);
OpenPOWER on IntegriCloud