Received: by 10.213.65.68 with SMTP id h4csp1126371imn; Wed, 28 Mar 2018 21:30:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx48hKshedimWKw0Br1n6EQsMSUbn8pmeFd394vopbUPvRkYe1JF4GXf33ZKi7Gf8exxe+3Y6 X-Received: by 10.98.174.6 with SMTP id q6mr5096981pff.140.1522297802153; Wed, 28 Mar 2018 21:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522297802; cv=none; d=google.com; s=arc-20160816; b=KJAnZM2RGO6CMvHQ/PwJqWQHejxXX3tlBTO85IGiZJX5gy/f3/JkYPO4cZNN/dCKxn Qv4JGyL3D5Qnx0Z2LoOEvRT2cFwzpUpRakIVGTHkGidbTEyWRZ0NtuhzPic47FsseHsC lrerBolGv9q2XfwNv4hpSae6rt9Le20/QfWrb3WZZeOu+gkm+3p22xc9caB2OXvrN5/E 09eH2v4aAMQOMOUqfZYtfuVYjPEyAsnvoILCBsSfOhuRxBb9AVY5m3EB6PkLGZwLSCmL wu2URmc9MSbpbybj7FXYky7jjdxhPZqR7mrjfB6st/GRL2XFk/f9ebPBfZDg3RLzAaN/ XgzQ== 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=B18q4yj/P8PE7DPhw6uZlRavk0GiMWc+76XaWht/kec=; b=QnBAQKb0fYay760r4HBhk8caWkyANG24klFwWow0E7uB6te38yOHmVUgqveKlTXEp8 frHnY1BfH4MxHK6hJzMyIsM+oObfhn6hJMQtH6aXJ66+vp9bpb+US+Jc2DULDUvg0I58 B8AF9JJ9koIbb3fJqqCX3UhUriBBGnRRyPzH4xsWzLEhxefhzZbKFpr3dcB2/CQcCk1W 2sLs5mEkr1GeoYgUTIQJZSRH0n3LF/KeF2IvR3AI13klNaxKNN6VfKJDx3ZG2yY0gadY zK1cEdzCAPCBTgYSv0zE52UTMKn1OqgVseFyFAncU9Dn3SM5OgnhsbMKqXvC8EUOYY2q sG2A== 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 a33-v6si5186389pld.125.2018.03.28.21.29.48; Wed, 28 Mar 2018 21:30:02 -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 S1752629AbeC2E2r (ORCPT + 99 others); Thu, 29 Mar 2018 00:28:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:34980 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752080AbeC2E2o (ORCPT ); Thu, 29 Mar 2018 00:28:44 -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 17DE6AE46; Thu, 29 Mar 2018 04:28:43 +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 13/17] staging: lustre: libcfs: remove cfs_timeout_cap() Cc: Linux Kernel Mailing List , Lustre Development List Message-ID: <152229760874.27689.12453214678546053828.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 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) #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));