Received: by 10.213.65.68 with SMTP id h4csp1126698imn; Wed, 28 Mar 2018 21:30:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/4s+ArAdqkYdRcxhsBad01shNyroVy0cBtz9FrbaMeAUumsu0KAz4GeNMNv0tXIu/U4Izo X-Received: by 10.98.19.132 with SMTP id 4mr5030799pft.87.1522297829069; Wed, 28 Mar 2018 21:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522297829; cv=none; d=google.com; s=arc-20160816; b=NV13c+poBVuFTyKk3b7s73AoO+AZSBqsdsSWCALxQrtL6FKUsfqQOnAdAIXJR4Q0Fr KOLAijvbbahg1YJzUkrK7FWgPESGLQrQBd+E53mKoQF6kMCbIxbaxAcabo1kETqavsP3 tAbDn0i/ftMTucONzzUgmsDGny1ftVPOUt0YkuWWxoy6GM+bmYBV5qKE6S4ZrsVX6mIY Jd6LQO+zSHG4jWOkjqiQ/2NmJqOGLwwfMxe0VFvMAj86yvOSpH6ijKHkA+K0MUCdD6DX IiB40hb8YRRZQ9np549ZdX9/sTopm3MzB1q4XY3KTI6TlwP8FdDNdks6jn7rWpwhA3u+ P/WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:cc:subject:date:to :from:arc-authentication-results; bh=tDY+knztfAjWtFvDYOSVwIWo1v1sU+JXVEh5Zh5nTOo=; b=lBUHhhUPst9i6/WqYHDMoIwUE3yNNXsuecT7tVCYQYhbbQhmBPDvm8Itb8uPQ265mP ys6sYhRF5ZvRzUpUwLn0N82HaNRXN8tMx9MJjUwNrhaRxlGOh53FxjNoatOunXWBGwuC BlEiYK1Ca4wqusx0nlZPSmo7IL8WUdzj+K03fCTyxoLG8U5mubJHCncxwtKi4St+N7C4 GfD+Ap4MpWTMViVciAaSjLREIsb5q4YAdD9ngxgds3yz+kNYDzaO/K9FunIL4HkwZ9qr gTTnxbktHTgIBFfBaB+McFG6xDYzjwCCTe1OcnA9MPjJeHeRLtimkVPmjEPZVqjI8sgR vEEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12si3432814pgv.384.2018.03.28.21.30.15; Wed, 28 Mar 2018 21:30:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752654AbeC2E3A (ORCPT + 99 others); Thu, 29 Mar 2018 00:29:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:35021 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750707AbeC2E26 (ORCPT ); Thu, 29 Mar 2018 00:28:58 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 326DAAE46; Thu, 29 Mar 2018 04:28:57 +0000 (UTC) From: NeilBrown To: Oleg Drokin , Greg Kroah-Hartman , James Simmons , Andreas Dilger Date: Thu, 29 Mar 2018 15:26:48 +1100 Subject: [PATCH 15/17] staging: lustre: discard cfs_time_before_64() Cc: Linux Kernel Mailing List , Lustre Development List Message-ID: <152229760881.27689.10658125792259115083.stgit@noble> In-Reply-To: <152229732768.27689.4800156943561963977.stgit@noble> References: <152229732768.27689.4800156943561963977.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cfs_time_before_64 is the same as time_before64() similarly cfs_time_beforeq_64() matsches time_before_eq64() So just use the standard interfaces. Signed-off-by: NeilBrown --- .../lustre/include/linux/libcfs/linux/linux-time.h | 14 -------------- drivers/staging/lustre/lustre/include/obd_class.h | 4 ++-- drivers/staging/lustre/lustre/ptlrpc/import.c | 4 ++-- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h index 9a353c6cb85a..ecdebccf2b44 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h @@ -56,20 +56,6 @@ #include -/* - * Generic kernel stuff - */ - -static inline int cfs_time_before_64(u64 t1, u64 t2) -{ - return (__s64)t2 - (__s64)t1 > 0; -} - -static inline int cfs_time_beforeq_64(u64 t1, u64 t2) -{ - return (__s64)t2 - (__s64)t1 >= 0; -} - /* * One jiffy */ diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 7cfc3c8d100c..176b63e2c9a7 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -932,7 +932,7 @@ static inline int obd_statfs_async(struct obd_export *exp, CDEBUG(D_SUPER, "%s: osfs %p age %llu, max_age %llu\n", obd->obd_name, &obd->obd_osfs, obd->obd_osfs_age, max_age); - if (cfs_time_before_64(obd->obd_osfs_age, max_age)) { + if (time_before64(obd->obd_osfs_age, max_age)) { rc = OBP(obd, statfs_async)(exp, oinfo, max_age, rqset); } else { CDEBUG(D_SUPER, @@ -992,7 +992,7 @@ static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp, CDEBUG(D_SUPER, "osfs %llu, max_age %llu\n", obd->obd_osfs_age, max_age); - if (cfs_time_before_64(obd->obd_osfs_age, max_age)) { + if (time_before64(obd->obd_osfs_age, max_age)) { rc = OBP(obd, statfs)(env, exp, osfs, max_age, flags); if (rc == 0) { spin_lock(&obd->obd_osfs_lock); diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c index dd4fd54128dd..537a9e2ed467 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/import.c +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c @@ -463,7 +463,7 @@ static int import_select_connection(struct obd_import *imp) * the last successful attempt, go with this one */ if ((conn->oic_last_attempt == 0) || - cfs_time_beforeq_64(conn->oic_last_attempt, + time_before_eq64(conn->oic_last_attempt, imp->imp_last_success_conn)) { imp_conn = conn; tried_all = 0; @@ -476,7 +476,7 @@ static int import_select_connection(struct obd_import *imp) */ if (!imp_conn) imp_conn = conn; - else if (cfs_time_before_64(conn->oic_last_attempt, + else if (time_before64(conn->oic_last_attempt, imp_conn->oic_last_attempt)) imp_conn = conn; }