All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: md: md-thin: remove duplication with time_after
@ 2015-02-05 21:58 Pierre Chevalier
  0 siblings, 0 replies; only message in thread
From: Pierre Chevalier @ 2015-02-05 21:58 UTC (permalink / raw)
  To: agk; +Cc: linux-raid, linux-kernel, Pierre Chevalier

The logic that was expressed previously was equivalent of calling
time_after.
Remove duplication.

Signed-off-by: Pierre Chevalier <pierrechevalier83@gmail.com>
---
 drivers/md/dm-thin.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 07705ee..c4d319b 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -11,6 +11,7 @@
 #include <linux/device-mapper.h>
 #include <linux/dm-io.h>
 #include <linux/dm-kcopyd.h>
+#include <linux/jiffies.h>
 #include <linux/log2.h>
 #include <linux/list.h>
 #include <linux/rculist.h>
@@ -1700,8 +1701,7 @@ static void process_cell_fail(struct thin_c *tc, struct dm_bio_prison_cell *cell
  */
 static int need_commit_due_to_time(struct pool *pool)
 {
-	return jiffies < pool->last_commit_jiffies ||
-	       jiffies > pool->last_commit_jiffies + COMMIT_PERIOD;
+	return time_after(jiffies, pool->last_commit_jiffies + COMMIT_PERIOD);
 }
 
 #define thin_pbd(node) rb_entry((node), struct dm_thin_endio_hook, rb_node)
-- 
2.2.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-05 21:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-05 21:58 [PATCH] drivers: md: md-thin: remove duplication with time_after Pierre Chevalier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.