From 1f3a8e49d8f28f498b8694464623ac20aebfe62a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 25 Dec 2016 12:43:07 +0100 Subject: ktime: Get rid of ktime_equal() No point in going through loops and hoops instead of just comparing the values. Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra --- fs/dlm/lock.c | 5 ++--- fs/nfs/flexfilelayout/flexfilelayout.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'fs') diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index f631a70..6df3322 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -1395,7 +1395,6 @@ static int nodeid_warned(int nodeid, int num_nodes, int *warned) void dlm_scan_waiters(struct dlm_ls *ls) { struct dlm_lkb *lkb; - ktime_t zero = 0; s64 us; s64 debug_maxus = 0; u32 debug_scanned = 0; @@ -1409,7 +1408,7 @@ void dlm_scan_waiters(struct dlm_ls *ls) mutex_lock(&ls->ls_waiters_mutex); list_for_each_entry(lkb, &ls->ls_waiters, lkb_wait_reply) { - if (ktime_equal(lkb->lkb_wait_time, zero)) + if (!lkb->lkb_wait_time) continue; debug_scanned++; @@ -1419,7 +1418,7 @@ void dlm_scan_waiters(struct dlm_ls *ls) if (us < dlm_config.ci_waitwarn_us) continue; - lkb->lkb_wait_time = zero; + lkb->lkb_wait_time = 0; debug_expired++; if (us > debug_maxus) diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index c98f6db..0ca4af8 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -623,7 +623,7 @@ nfs4_ff_layoutstat_start_io(struct nfs4_ff_layout_mirror *mirror, struct nfs4_flexfile_layout *ffl = FF_LAYOUT_FROM_HDR(mirror->layout); nfs4_ff_start_busy_timer(&layoutstat->busy_timer, now); - if (ktime_equal(mirror->start_time, 0)) + if (!mirror->start_time) mirror->start_time = now; if (mirror->report_interval != 0) report_interval = (s64)mirror->report_interval * 1000LL; -- cgit v1.1