Received: by 10.213.65.68 with SMTP id h4csp2725106imn; Mon, 2 Apr 2018 12:49:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx49GLYHBDPvI76txdg3Ro24Uryx4NUFeEZrlM4m6e2hC18mkg91ZFR6/6+iwm3WLWnfIjHaN X-Received: by 10.101.93.136 with SMTP id f8mr2407585pgt.265.1522698562976; Mon, 02 Apr 2018 12:49:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522698562; cv=none; d=google.com; s=arc-20160816; b=NVk/A1gq1PPZ9skqcCe2iXqt4tW2g4ZAx95rvO00eRYy/5evlSTcfwIaKlSfTZCCWv GRpUvY8U5gbK5HiLeyivL8vUjVU40V472UVBH7oIluJnpTAjhfKwxR1Fj33ZREfFzDM1 LmDmVPusBY1f6q8em+fnFt9Bv7/x515Rx4OCudW8767qkWhVyg+20bcjWATdARKiSMWk 31SsbzyZOXua4HInCzJ4O9MDESbp27cax4k2Sn/vTSS8HLLz/B3XOwhaFODVdzSp1G4D LTuf4AYPU36hFVYqJe8VACxgdJU3mRvJXI96wttNuYnDGdd5lShqGN/vGAz1zexIIk8R NCSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=5dSb6hUShfsCmQ/R6sQ8Hv2ZjMzT5S4MbHvhe7EvEVU=; b=b1v7ONaj6UIBBbjJXEtR7zr0RsumGR80PheAmonWGJr/m9FbAxPxYpcWO80CxDMMQP aRtbG8jYMfm5CLRUy3uhTevmlm/ayEmeFsTiATz34ReIdNJwMd4U3+RJxSUUly1VT3PI +RBHpDsINbESQIIvKvP+s5Ust3mQrp6y/j45AbSEE00LvhnsPkMn4hsrqUa3JwPADUwk /55yNGxXwpiMH/095JzD9xAY6xEWl2q8ArYMEQYW4U6foTmewiXGlAn/xVqWGz1JTP+n LlnQygzoI4Sqwn0yG9OeyDgesUfYEv0q6FLYXgXevBaJbqK58obd5d9EN3S6vxs/xtHd hy2Q== 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 k9si652895pgc.327.2018.04.02.12.49.09; Mon, 02 Apr 2018 12:49:22 -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 S1756872AbeDBTjM convert rfc822-to-8bit (ORCPT + 99 others); Mon, 2 Apr 2018 15:39:12 -0400 Received: from mga03.intel.com ([134.134.136.65]:28013 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756732AbeDBTjK (ORCPT ); Mon, 2 Apr 2018 15:39:10 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Apr 2018 12:39:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,397,1517904000"; d="scan'208";a="188070093" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga004.jf.intel.com with ESMTP; 02 Apr 2018 12:38:58 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 2 Apr 2018 12:38:58 -0700 Received: from FMSMSX109.amr.corp.intel.com ([169.254.15.178]) by fmsmsx158.amr.corp.intel.com ([169.254.15.250]) with mapi id 14.03.0319.002; Mon, 2 Apr 2018 12:38:58 -0700 From: "Dilger, Andreas" To: NeilBrown CC: "Drokin, Oleg" , Greg Kroah-Hartman , James Simmons , "Linux Kernel Mailing List" , Lustre Development List Subject: Re: [PATCH 13/17] staging: lustre: libcfs: remove cfs_timeout_cap() Thread-Topic: [PATCH 13/17] staging: lustre: libcfs: remove cfs_timeout_cap() Thread-Index: AQHTxxZurM6PLLoxp0Wg6oRQsTEAe6PuW6MA Date: Mon, 2 Apr 2018 19:38:57 +0000 Message-ID: <346B8E2C-5842-4771-86D8-CBB5CEF2DC35@intel.com> References: <152229732768.27689.4800156943561963977.stgit@noble> <152229760874.27689.12453214678546053828.stgit@noble> In-Reply-To: <152229760874.27689.12453214678546053828.stgit@noble> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.110.185] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mar 28, 2018, at 22:26, NeilBrown wrote: > > This wrapper is only used once, so open-code it as max(). > > This allows us to remove the libcfs_time.h include file. > > Signed-off-by: NeilBrown > --- > .../staging/lustre/include/linux/libcfs/libcfs.h | 1 > .../lustre/include/linux/libcfs/libcfs_time.h | 50 -------------------- > .../lustre/include/linux/libcfs/linux/linux-time.h | 2 - > drivers/staging/lustre/lustre/ptlrpc/import.c | 4 +- > 4 files changed, 3 insertions(+), 54 deletions(-) > delete mode 100644 drivers/staging/lustre/include/linux/libcfs/libcfs_time.h > > diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h > index 3b751c436b3d..3d3fa52858e5 100644 > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h > +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h > @@ -43,7 +43,6 @@ > #include > #include > #include > -#include > #include > #include > #include > diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h > deleted file mode 100644 > index 172a8872e3f3..000000000000 > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h > +++ /dev/null > @@ -1,50 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0 > -/* > - * GPL HEADER START > - * > - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License version 2 only, > - * as published by the Free Software Foundation. > - * > - * This program is distributed in the hope that it will be useful, but > - * WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > - * General Public License version 2 for more details (a copy is included > - * in the LICENSE file that accompanied this code). > - * > - * You should have received a copy of the GNU General Public License > - * version 2 along with this program; If not, see > - * http://www.gnu.org/licenses/gpl-2.0.html > - * > - * GPL HEADER END > - */ > -/* > - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. > - * Use is subject to license terms. > - */ > -/* > - * This file is part of Lustre, http://www.lustre.org/ > - * Lustre is a trademark of Sun Microsystems, Inc. > - * > - * libcfs/include/libcfs/libcfs_time.h > - * > - * Time functions. > - * > - */ > - > -#ifndef __LIBCFS_TIME_H__ > -#define __LIBCFS_TIME_H__ > -/* > - * return valid time-out based on user supplied one. Currently we only check > - * that time-out is not shorted than allowed. > - */ > -static inline long cfs_timeout_cap(long timeout) > -{ > - if (timeout < CFS_TICK) > - timeout = CFS_TICK; > - return timeout; > -} > - > -#endif > 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 ff3aae2f1231..ecb2126a9e6f 100644 > --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h > +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h > @@ -78,7 +78,7 @@ static inline int cfs_time_beforeq_64(u64 t1, u64 t2) > /* > * One jiffy > */ > -#define CFS_TICK (1) > +#define CFS_TICK (1UL) It seems like CFS_TICK is mostly useless as well and could just be dropped? > #define CFS_DURATION_T "%ld" > > diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c > index 4a9d1f189d01..dd4fd54128dd 100644 > --- a/drivers/staging/lustre/lustre/ptlrpc/import.c > +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c > @@ -1486,7 +1486,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose) > } > > if (ptlrpc_import_in_recovery(imp)) { > - long timeout; > + unsigned long timeout; > > if (AT_OFF) { > if (imp->imp_server_timeout) > @@ -1501,7 +1501,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose) > > if (wait_event_idle_timeout(imp->imp_recovery_waitq, > !ptlrpc_import_in_recovery(imp), > - cfs_timeout_cap(timeout)) == 0) > + max(timeout, CFS_TICK)) == 0) > l_wait_event_abortable( > imp->imp_recovery_waitq, > !ptlrpc_import_in_recovery(imp)); > > Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation