X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fportals%2Finclude%2Flinux%2Fportals_compat25.h;h=a7cb4d155b82f1e6827df49ae5e905a3c3513b88;hb=a2a0746305449dbd925879b14dc2c0d6040bb8bf;hp=e28fbac65984b73267eb424871197afcbee3b575;hpb=5cb9bb2f66ecb51fcffc988e18af5af69cf05b55;p=fs%2Flustre-release.git diff --git a/lustre/portals/include/linux/portals_compat25.h b/lustre/portals/include/linux/portals_compat25.h index e28fbac..a7cb4d1 100644 --- a/lustre/portals/include/linux/portals_compat25.h +++ b/lustre/portals/include/linux/portals_compat25.h @@ -1,13 +1,56 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + */ +#ifndef _PORTALS_COMPAT_H +#define _PORTALS_COMPAT_H + +// XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved +#if SPINLOCK_DEBUG +# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) || defined(CONFIG_RH_2_4_20) +# define SIGNAL_MASK_ASSERT() \ + LASSERT(current->sighand->siglock.magic == SPINLOCK_MAGIC) +# else +# define SIGNAL_MASK_ASSERT() \ + LASSERT(current->sigmask_lock.magic == SPINLOCK_MAGIC) +# endif +#else +# define SIGNAL_MASK_ASSERT() +#endif +// XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) || defined(CONFIG_RH_2_4_20) -# define SIGNAL_MASK_LOCK(task, flags) \ + +# define SIGNAL_MASK_LOCK(task, flags) \ spin_lock_irqsave(&task->sighand->siglock, flags) -# define SIGNAL_MASK_UNLOCK(task, 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 RECALC_SIGPENDING recalc_sigpending() -#else -# define SIGNAL_MASK_LOCK(task, flags) \ +# define CURRENT_SECONDS get_seconds() + +#else /* 2.4.x */ + +# define SIGNAL_MASK_LOCK(task, flags) \ spin_lock_irqsave(&task->sigmask_lock, flags) -# define SIGNAL_MASK_UNLOCK(task, flags) \ +# define SIGNAL_MASK_UNLOCK(task, flags) \ spin_unlock_irqrestore(&task->sigmask_lock, flags) +# define USERMODEHELPER(path, argv, envp) \ + call_usermodehelper(path, argv, envp) # define RECALC_SIGPENDING recalc_sigpending(current) +# define CURRENT_SECONDS CURRENT_TIME + +#endif + +#if defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)) +# define THREAD_NAME(comm, fmt, a...) \ + sprintf(comm, fmt "|%d", ## a, current->thread.extern_pid) +#elif defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) +# define THREAD_NAME(comm, fmt, a...) \ + sprintf(comm, fmt "|%d", ## a, current->thread.mode.tt.extern_pid) +#else +# define THREAD_NAME(comm, fmt, a...) \ + sprintf(comm, fmt, ## a) #endif + +#endif /* _PORTALS_COMPAT_H */