Received: by 10.213.65.68 with SMTP id h4csp622810imn; Fri, 30 Mar 2018 12:04:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/PdJ7BKbAKrgfTXEcuSkJt7dcB42Bqvtxe0IfFOyyfZEGUjKyebi8Z8XeuRC8t3XvXOQhx X-Received: by 10.98.15.195 with SMTP id 64mr145053pfp.63.1522436693918; Fri, 30 Mar 2018 12:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522436693; cv=none; d=google.com; s=arc-20160816; b=laNGM3XCOFVbL0bIgZRiGSvF4MXgtQfRioFdxm2u/r3cN/bOmosgae7+qUUGubVYYd 8PF98DbUvLycz61ipUIwVSIepYrzrn45fztetT7s2ml8Xdsd0yEbDME8hCjWuXbOl1Cg //tgLx0WR5HDVg0mgHeuilUEboiT6Vu9tqQiF8WoiRTPBRVoRV1eaMOF+5AteQsbW7Ea FvbADcKrF0RmztlFFPG8H0lUY5RNSsudqV2xFmfzuknq6TdiBUxfsw6MV0z77e+T0gyM PCOtbzdeYkCSIQqAumMBIibqH4iv4MvIAZtpBg8p2hd4D3bQzYaiD4NnD7LnB6aWfDGL BMig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=7YaHpksuPi9AJc3gbdRYrFP1Mn7IklLKSP4zsr/VV0M=; b=l9F8zvrwdOHYml+xTkUXVjKdgncJyobFNy9Uh8pVTiGIcsULb35M+5gD80yIE/Mw9i uauQhXG2/4WnaTr5nl8jpPHHWytwAxX/p/Z65PgZ1th5/VzmHc6tcrftFzlVh07Cs20d xc8s6Vo+yzC4ETUSIjGKEgS1LSsPLwzO7zGfK0c+W9KJkTs5yJhL3Qp1nUpUS5lx+fv+ Ev09/U2kyVBy4+6MSGwuWeGlPON1+NbfAUm+vMAGSFT66oJabYtRVrxwZDfPKkrtY9Wk ggx4IOSw+3hB6GNO+1s+6/DUQlwKApTt0p/4CdAqRBZN8QgVuvvIv9XGvsGCmUrJqpLo CDzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=opvHmR6b; 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 36-v6si8994932pla.163.2018.03.30.12.04.40; Fri, 30 Mar 2018 12:04:53 -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; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=opvHmR6b; 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 S1752681AbeC3TDa (ORCPT + 99 others); Fri, 30 Mar 2018 15:03:30 -0400 Received: from casper.infradead.org ([85.118.1.10]:46694 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752594AbeC3TD2 (ORCPT ); Fri, 30 Mar 2018 15:03:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: Message-ID:In-Reply-To:Subject:cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7YaHpksuPi9AJc3gbdRYrFP1Mn7IklLKSP4zsr/VV0M=; b=opvHmR6bShbpXyp2vxL4naEJQ GkoInjOjApZu0IUrlRlHUIPh29Ns9/1DfPBPH6RSlTbsCmOiq7C7U92MdYDAyju07uc5V6apptV37 IGX8J/uVV3D4pTaFLKJTajr56ZXs49QYH/SdnLiqc7XeNTM2L66y1zWSnwA+JqCtd1CeL10IG09Jr Gzxz3m05OXBLY5QhDpdvxdX6b0NbZnNGEP/siJcG6w8H12wyBuk2swuBv3/0VQ/a3cqmrXY0uaeuJ HrSGf5oU0tGe/M6PYnJaW3K7qmF/4TnbZqCK2lq5gN4+FY0PCKUy9ze+lDJZh+xsJwOcMElQR+bdM vfuTBGC7g==; Received: from jsimmons (helo=localhost) by casper.infradead.org with local-esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f1zJ5-000315-Li; Fri, 30 Mar 2018 19:03:25 +0000 Date: Fri, 30 Mar 2018 20:03:23 +0100 (BST) From: James Simmons To: NeilBrown cc: Oleg Drokin , Greg Kroah-Hartman , Andreas Dilger , Linux Kernel Mailing List , Lustre Development List Subject: Re: [PATCH 15/17] staging: lustre: discard cfs_time_before_64() In-Reply-To: <152229760881.27689.10658125792259115083.stgit@noble> Message-ID: References: <152229732768.27689.4800156943561963977.stgit@noble> <152229760881.27689.10658125792259115083.stgit@noble> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180330_200323_708031_7DDC02E1 X-CRM114-Status: GOOD ( 16.43 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP 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. Reviewed-by: James Simmons > 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; > } > > >