staging/lustre: remove portals_compat25.h
Remove include/linux/libcfs/linux/portals_compat25.h. . remove some unused/unnecessary macros such as smp_num_cpus / SIGNAL_MASK_ASSERT etc. . replace some macros with direct kernel API calls such as RECALC_SIGPENDING/CLEAR_SIGPENDING/CURRENT_SECONDS, cfs_wait_event_interruptible/_exclusive etc. Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: James Simmons <uja.ornl@gmail.com> Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-on: http://review.whamcloud.com/4778 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Keith Mannthey <keith.mannthey@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
16e0631db7
commit
46ffc93438
@ -156,8 +156,8 @@ static inline void cfs_race(__u32 id)
|
||||
|
||||
cfs_race_state = 0;
|
||||
CERROR("cfs_race id %x sleeping\n", id);
|
||||
cfs_wait_event_interruptible(cfs_race_waitq,
|
||||
cfs_race_state != 0, rc);
|
||||
rc = wait_event_interruptible(cfs_race_waitq,
|
||||
cfs_race_state != 0);
|
||||
CERROR("cfs_fail_race id %x awake, rc=%d\n", id, rc);
|
||||
} else {
|
||||
CERROR("cfs_fail_race id %x waking\n", id);
|
||||
|
@ -86,7 +86,6 @@
|
||||
#include "linux-cpu.h"
|
||||
#include "linux-time.h"
|
||||
#include "linux-mem.h"
|
||||
#include "portals_compat25.h"
|
||||
|
||||
|
||||
#define LUSTRE_TRACE_SIZE (THREAD_SIZE >> 5)
|
||||
|
@ -53,8 +53,6 @@
|
||||
#include <linux/time.h>
|
||||
#include <asm/div64.h>
|
||||
|
||||
#include "portals_compat25.h"
|
||||
|
||||
/*
|
||||
* post 2.5 kernels.
|
||||
*/
|
||||
|
@ -1,81 +0,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.sun.com/software/products/lustre/docs/GPLv2.pdf
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*
|
||||
* GPL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* Copyright (c) 2012, Intel Corporation.
|
||||
*/
|
||||
/*
|
||||
* This file is part of Lustre, http://www.lustre.org/
|
||||
* Lustre is a trademark of Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#ifndef __LIBCFS_LINUX_PORTALS_COMPAT_H__
|
||||
#define __LIBCFS_LINUX_PORTALS_COMPAT_H__
|
||||
|
||||
/* XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved */
|
||||
#if defined(SPINLOCK_DEBUG) && SPINLOCK_DEBUG
|
||||
# define SIGNAL_MASK_ASSERT() \
|
||||
LASSERT(current->sighand->siglock.magic == SPINLOCK_MAGIC)
|
||||
#else
|
||||
# define SIGNAL_MASK_ASSERT()
|
||||
#endif
|
||||
/* XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved */
|
||||
|
||||
#define SIGNAL_MASK_LOCK(task, flags) \
|
||||
spin_lock_irqsave(&task->sighand->siglock, flags)
|
||||
#define SIGNAL_MASK_UNLOCK(task, flags) \
|
||||
spin_unlock_irqrestore(&task->sighand->siglock, flags)
|
||||
#define USERMODEHELPER(path, argv, envp) \
|
||||
call_usermodehelper(path, argv, envp, 1)
|
||||
#define clear_tsk_thread_flag(current, TIF_SIGPENDING) clear_tsk_thread_flag(current, \
|
||||
TIF_SIGPENDING)
|
||||
# define smp_num_cpus num_online_cpus()
|
||||
|
||||
#define cfs_wait_event_interruptible(wq, condition, ret) \
|
||||
ret = wait_event_interruptible(wq, condition)
|
||||
#define cfs_wait_event_interruptible_exclusive(wq, condition, ret) \
|
||||
ret = wait_event_interruptible_exclusive(wq, condition)
|
||||
|
||||
#define THREAD_NAME(comm, len, fmt, a...) \
|
||||
snprintf(comm, len, fmt, ## a)
|
||||
|
||||
/* 2.6 alloc_page users can use page->lru */
|
||||
#define PAGE_LIST_ENTRY lru
|
||||
#define PAGE_LIST(page) ((page)->lru)
|
||||
|
||||
#ifndef __user
|
||||
#define __user
|
||||
#endif
|
||||
|
||||
#ifndef __fls
|
||||
#define __cfs_fls fls
|
||||
#else
|
||||
#define __cfs_fls __fls
|
||||
#endif
|
||||
|
||||
#endif /* _PORTALS_COMPAT_H */
|
@ -1537,9 +1537,9 @@ int ksocknal_scheduler(void *arg)
|
||||
nloops = 0;
|
||||
|
||||
if (!did_something) { /* wait for something to do */
|
||||
cfs_wait_event_interruptible_exclusive(
|
||||
rc = wait_event_interruptible_exclusive(
|
||||
sched->kss_waitq,
|
||||
!ksocknal_sched_cansleep(sched), rc);
|
||||
!ksocknal_sched_cansleep(sched));
|
||||
LASSERT (rc == 0);
|
||||
} else {
|
||||
cond_resched();
|
||||
|
@ -63,7 +63,6 @@
|
||||
#include <linux/syscalls.h>
|
||||
|
||||
#include "../../../include/linux/libcfs/libcfs.h"
|
||||
#include "../../../include/linux/libcfs/linux/portals_compat25.h"
|
||||
|
||||
#include <linux/crc32.h>
|
||||
static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len)
|
||||
|
@ -39,7 +39,6 @@
|
||||
|
||||
#include <linux/fs_struct.h>
|
||||
#include <linux/namei.h>
|
||||
#include "../../../include/linux/libcfs/linux/portals_compat25.h"
|
||||
|
||||
#include "lustre_patchless_compat.h"
|
||||
|
||||
|
@ -2092,8 +2092,7 @@ int cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m)
|
||||
maxdepb = ffz(~maxdep);
|
||||
}
|
||||
total += bd.bd_bucket->hsb_count;
|
||||
dist[min(__cfs_fls(bd.bd_bucket->hsb_count/max(theta,
|
||||
1)), 7)]++;
|
||||
dist[min(fls(bd.bd_bucket->hsb_count / max(theta, 1)), 7)]++;
|
||||
cfs_hash_bd_unlock(hs, &bd, 0);
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,6 @@
|
||||
# define DEBUG_SUBSYSTEM S_LNET
|
||||
|
||||
#include "../../../include/linux/libcfs/libcfs.h"
|
||||
#include "../../../include/linux/libcfs/linux/portals_compat25.h"
|
||||
|
||||
#include "../tracefile.h"
|
||||
|
||||
@ -86,7 +85,7 @@ void libcfs_run_debug_log_upcall(char *file)
|
||||
|
||||
argv[2] = NULL;
|
||||
|
||||
rc = USERMODEHELPER(argv[0], argv, envp);
|
||||
rc = call_usermodehelper(argv[0], argv, envp, 1);
|
||||
if (rc < 0 && rc != -ENOENT) {
|
||||
CERROR("Error %d invoking LNET debug log upcall %s %s; "
|
||||
"check /proc/sys/lnet/debug_log_upcall\n",
|
||||
@ -113,7 +112,7 @@ void libcfs_run_upcall(char **argv)
|
||||
|
||||
LASSERT(argc >= 2);
|
||||
|
||||
rc = USERMODEHELPER(argv[0], argv, envp);
|
||||
rc = call_usermodehelper(argv[0], argv, envp, 1);
|
||||
if (rc < 0 && rc != -ENOENT) {
|
||||
CERROR("Error %d invoking LNET upcall %s %s%s%s%s%s%s%s%s; "
|
||||
"check /proc/sys/lnet/upcall\n",
|
||||
|
@ -130,11 +130,11 @@ cfs_block_allsigs(void)
|
||||
unsigned long flags;
|
||||
sigset_t old;
|
||||
|
||||
SIGNAL_MASK_LOCK(current, flags);
|
||||
spin_lock_irqsave(¤t->sighand->siglock, flags);
|
||||
old = current->blocked;
|
||||
sigfillset(¤t->blocked);
|
||||
recalc_sigpending();
|
||||
SIGNAL_MASK_UNLOCK(current, flags);
|
||||
spin_unlock_irqrestore(¤t->sighand->siglock, flags);
|
||||
|
||||
return old;
|
||||
}
|
||||
@ -144,11 +144,11 @@ sigset_t cfs_block_sigs(unsigned long sigs)
|
||||
unsigned long flags;
|
||||
sigset_t old;
|
||||
|
||||
SIGNAL_MASK_LOCK(current, flags);
|
||||
spin_lock_irqsave(¤t->sighand->siglock, flags);
|
||||
old = current->blocked;
|
||||
sigaddsetmask(¤t->blocked, sigs);
|
||||
recalc_sigpending();
|
||||
SIGNAL_MASK_UNLOCK(current, flags);
|
||||
spin_unlock_irqrestore(¤t->sighand->siglock, flags);
|
||||
return old;
|
||||
}
|
||||
|
||||
@ -158,11 +158,11 @@ sigset_t cfs_block_sigsinv(unsigned long sigs)
|
||||
unsigned long flags;
|
||||
sigset_t old;
|
||||
|
||||
SIGNAL_MASK_LOCK(current, flags);
|
||||
spin_lock_irqsave(¤t->sighand->siglock, flags);
|
||||
old = current->blocked;
|
||||
sigaddsetmask(¤t->blocked, ~sigs);
|
||||
recalc_sigpending();
|
||||
SIGNAL_MASK_UNLOCK(current, flags);
|
||||
spin_unlock_irqrestore(¤t->sighand->siglock, flags);
|
||||
|
||||
return old;
|
||||
}
|
||||
@ -172,10 +172,10 @@ cfs_restore_sigs (sigset_t old)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
SIGNAL_MASK_LOCK(current, flags);
|
||||
spin_lock_irqsave(¤t->sighand->siglock, flags);
|
||||
current->blocked = old;
|
||||
recalc_sigpending();
|
||||
SIGNAL_MASK_UNLOCK(current, flags);
|
||||
spin_unlock_irqrestore(¤t->sighand->siglock, flags);
|
||||
}
|
||||
|
||||
int
|
||||
@ -189,9 +189,9 @@ cfs_clear_sigpending(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
SIGNAL_MASK_LOCK(current, flags);
|
||||
spin_lock_irqsave(¤t->sighand->siglock, flags);
|
||||
clear_tsk_thread_flag(current, TIF_SIGPENDING);
|
||||
SIGNAL_MASK_UNLOCK(current, flags);
|
||||
spin_unlock_irqrestore(¤t->sighand->siglock, flags);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -288,8 +288,8 @@ cfs_wi_scheduler (void *arg)
|
||||
}
|
||||
|
||||
cfs_wi_sched_unlock(sched);
|
||||
cfs_wait_event_interruptible_exclusive(sched->ws_waitq,
|
||||
!cfs_wi_sched_cansleep(sched), rc);
|
||||
rc = wait_event_interruptible_exclusive(sched->ws_waitq,
|
||||
!cfs_wi_sched_cansleep(sched));
|
||||
cfs_wi_sched_lock(sched);
|
||||
}
|
||||
|
||||
|
@ -1067,7 +1067,7 @@ static int process_param2_config(struct lustre_cfg *lcfg)
|
||||
}
|
||||
|
||||
do_gettimeofday(&start);
|
||||
rc = USERMODEHELPER(argv[0], argv, NULL);
|
||||
rc = call_usermodehelper(argv[0], argv, NULL, 1);
|
||||
do_gettimeofday(&end);
|
||||
|
||||
if (rc < 0) {
|
||||
|
@ -2041,8 +2041,6 @@ int ptlrpc_set_next_timeout(struct ptlrpc_request_set *set)
|
||||
struct ptlrpc_request *req;
|
||||
int deadline;
|
||||
|
||||
SIGNAL_MASK_ASSERT(); /* XXX BUG 1511 */
|
||||
|
||||
list_for_each(tmp, &set->set_requests) {
|
||||
req = list_entry(tmp, struct ptlrpc_request, rq_set_chain);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user