Commit 46357c56 authored by NeilBrown's avatar NeilBrown Committed by Greg Kroah-Hartman

staging: lustre: libcfs: remove cfs_timeout_cap()

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: default avatarNeilBrown <neilb@suse.com>
Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b49946b2
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <linux/libcfs/libcfs_private.h> #include <linux/libcfs/libcfs_private.h>
#include <linux/libcfs/libcfs_cpu.h> #include <linux/libcfs/libcfs_cpu.h>
#include <linux/libcfs/libcfs_prim.h> #include <linux/libcfs/libcfs_prim.h>
#include <linux/libcfs/libcfs_time.h>
#include <linux/libcfs/libcfs_string.h> #include <linux/libcfs/libcfs_string.h>
#include <linux/libcfs/libcfs_hash.h> #include <linux/libcfs/libcfs_hash.h>
#include <linux/libcfs/libcfs_fail.h> #include <linux/libcfs/libcfs_fail.h>
......
// 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
...@@ -78,7 +78,7 @@ static inline int cfs_time_beforeq_64(u64 t1, u64 t2) ...@@ -78,7 +78,7 @@ static inline int cfs_time_beforeq_64(u64 t1, u64 t2)
/* /*
* One jiffy * One jiffy
*/ */
#define CFS_TICK (1) #define CFS_TICK (1UL)
#define CFS_DURATION_T "%ld" #define CFS_DURATION_T "%ld"
......
...@@ -1486,7 +1486,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose) ...@@ -1486,7 +1486,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose)
} }
if (ptlrpc_import_in_recovery(imp)) { if (ptlrpc_import_in_recovery(imp)) {
long timeout; unsigned long timeout;
if (AT_OFF) { if (AT_OFF) {
if (imp->imp_server_timeout) if (imp->imp_server_timeout)
...@@ -1501,7 +1501,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose) ...@@ -1501,7 +1501,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose)
if (wait_event_idle_timeout(imp->imp_recovery_waitq, if (wait_event_idle_timeout(imp->imp_recovery_waitq,
!ptlrpc_import_in_recovery(imp), !ptlrpc_import_in_recovery(imp),
cfs_timeout_cap(timeout)) == 0) max(timeout, CFS_TICK)) == 0)
l_wait_event_abortable( l_wait_event_abortable(
imp->imp_recovery_waitq, imp->imp_recovery_waitq,
!ptlrpc_import_in_recovery(imp)); !ptlrpc_import_in_recovery(imp));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment