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>
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);
#include "linux-cpu.h"
#include "linux-time.h"
#include "linux-mem.h"
-#include "portals_compat25.h"
#define LUSTRE_TRACE_SIZE (THREAD_SIZE >> 5)
#include <linux/time.h>
#include <asm/div64.h>
-#include "portals_compat25.h"
-
/*
* post 2.5 kernels.
*/
+++ /dev/null
-/*
- * 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 */
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();
#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)
#include <linux/fs_struct.h>
#include <linux/namei.h>
-#include "../../../include/linux/libcfs/linux/portals_compat25.h"
#include "lustre_patchless_compat.h"
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);
}
# define DEBUG_SUBSYSTEM S_LNET
#include "../../../include/linux/libcfs/libcfs.h"
-#include "../../../include/linux/libcfs/linux/portals_compat25.h"
#include "../tracefile.h"
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",
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",
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;
}
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;
}
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;
}
{
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
{
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
}
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);
}
}
do_gettimeofday(&start);
- rc = USERMODEHELPER(argv[0], argv, NULL);
+ rc = call_usermodehelper(argv[0], argv, NULL, 1);
do_gettimeofday(&end);
if (rc < 0) {
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);