Received: by 10.213.65.68 with SMTP id h4csp622523imn; Fri, 30 Mar 2018 12:04:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx48h4YM+Rc5RNglwjuQ5T1/UK2Kn04bGxdXdQV1EZHfmnvX1dNNqz1oKMgyupiKOD49knjsK X-Received: by 10.99.127.82 with SMTP id p18mr139142pgn.188.1522436674622; Fri, 30 Mar 2018 12:04:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522436674; cv=none; d=google.com; s=arc-20160816; b=zMmtA6l0BybV9r8g8gIvoAdav9lrysnAYJHdwujZnoi+8dNFI2zcUNxPjIT567KSPm XwqcfhZQU9pTRYDI/hNvKXLMJoXHZ9KCS/z3GpD+IP67L/gMqqgpTqtem67cPo/3+eDc WjDPxj55+JXJuOCBZS/O9jSfyTyIBXac7RYhaOu1bXoMWLfElIAJt44U0w6ahGUhPZWR HXbBFHVMHMY7BEvoy7DQS0ZZulmuCU/olPT5ednknyn+DQ3HxQhBBP5Kc4Ox0YfPgVNk 8mAsDqyeozjbprMOeJb4BtrgtI2gUYRCplTZkfXsnZ/mdQjn8/uo+aKhnmulKO1UqNMi RtvA== 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=zZdjVb4Kj7VkDT1Szs9eBUWMhwm0CX+P9JoQDGqn/oE=; b=Ec+cgsQ1jkjhzELqd8WQTegCB457CcLXqGRJx+LNVWV6WltuohKXhXWcqY8nR2+Lx/ sq5ViTKlzQI0bkNtOdyydes7D6EEvwVLedEjBGnGjnfWfFJmhelYZaESowfYlLwPGIr1 hI7X5/gPHTg3Z/DxJk4al/gv1HpDwS+A5Ymgsi0187BEsL+TMLbSLJKdUrv0cFjiVAlr cwPVUTHzsqcXL9ra1xsmr25La7xTjT9I051wvIWpxN3oQKzi+SAGGcM6DFLi5nzt92o0 jCO4DurQoIGJiUfsYRXEBGxab5OnHqMwk15dndH1LoOHH/WcOl0pLPc2pz2Cd3Azvd+Q 0jiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=N2s+CoOE; 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 b14-v6si1848580pll.116.2018.03.30.12.04.20; Fri, 30 Mar 2018 12:04:34 -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=N2s+CoOE; 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 S1752495AbeC3TDJ (ORCPT + 99 others); Fri, 30 Mar 2018 15:03:09 -0400 Received: from casper.infradead.org ([85.118.1.10]:46644 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275AbeC3TDI (ORCPT ); Fri, 30 Mar 2018 15:03:08 -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=zZdjVb4Kj7VkDT1Szs9eBUWMhwm0CX+P9JoQDGqn/oE=; b=N2s+CoOEzvhj2JnMzd7v5X438 aG0Hi99P7IkwPQdiDZ1ufZXJxIp33NXjyvJVkF6dLNtXqfK92Roa3xzEGQnHH7winytbcqd9oZI8I 50K6OunM/mRGi0w+rIKKf1Wmap7+yGkoNsQ7btB5j0+SggkgZweiQqI9BIAF3/4PC8LhnGbGG26VS HwrakCLLecrts25KQrkXGb4U3S+ODjxegUToaeHO+wkh+3/MTnnUeVL00LvNkOXw2EEFuw+AI2nAz hICIKy/Ak2aoL8wm5XmrQ2jR9lrEvj5/+MKgADqaCmfBotBZX+vjUrC01k562Ot99iMhpeJKGBDR1 FOTTsiCjg==; Received: from jsimmons (helo=localhost) by casper.infradead.org with local-esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f1zIk-0002rS-Hd; Fri, 30 Mar 2018 19:03:04 +0000 Date: Fri, 30 Mar 2018 20:03:02 +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 13/17] staging: lustre: libcfs: remove cfs_timeout_cap() In-Reply-To: <152229760874.27689.12453214678546053828.stgit@noble> Message-ID: References: <152229732768.27689.4800156943561963977.stgit@noble> <152229760874.27689.12453214678546053828.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_200302_587822_58D0A8CE X-CRM114-Status: GOOD ( 25.45 ) 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 > This wrapper is only used once, so open-code it as max(). > > This allows us to remove the libcfs_time.h include file. Reviewed-by: James Simmons > 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) > > #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)); > > >