Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46ffc934 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman
Browse files

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: default avatarLiu Xuezhao <xuezhao.liu@emc.com>
Signed-off-by: default avatarPeng Tao <tao.peng@emc.com>
Signed-off-by: default avatarJames Simmons <uja.ornl@gmail.com>
Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-on: http://review.whamcloud.com/4778


Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarKeith Mannthey <keith.mannthey@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 16e0631d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
+0 −1
Original line number Diff line number Diff line
@@ -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)
+0 −2
Original line number Diff line number Diff line
@@ -53,8 +53,6 @@
#include <linux/time.h>
#include <asm/div64.h>

#include "portals_compat25.h"

/*
 * post 2.5 kernels.
 */
+0 −81
Original line number Diff line number Diff line
/*
 * 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 */
+2 −2
Original line number Diff line number Diff line
@@ -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();
Loading