From e3987f158ffee263b85ff67a46707abc7e789048 Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 3 Jun 2003 07:38:09 +0000 Subject: [PATCH] Add THREAD_NAME compat macro, to remove duplication of UML thread-name stuff. Make list_move() available if not defined (based on presence of list_for_each_entry(), which is also defined in 2.5). --- lnet/include/linux/portals_compat25.h | 18 ++++++++++++++---- lustre/portals/include/linux/portals_compat25.h | 18 ++++++++++++++---- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/lnet/include/linux/portals_compat25.h b/lnet/include/linux/portals_compat25.h index e28fbac..a6c13a8 100644 --- a/lnet/include/linux/portals_compat25.h +++ b/lnet/include/linux/portals_compat25.h @@ -1,13 +1,23 @@ #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 RECALC_SIGPENDING recalc_sigpending() #else -# define SIGNAL_MASK_LOCK(task, flags) \ +# 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 RECALC_SIGPENDING recalc_sigpending(current) #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...) strcpy(comm, base, ## a) +#endif diff --git a/lustre/portals/include/linux/portals_compat25.h b/lustre/portals/include/linux/portals_compat25.h index e28fbac..a6c13a8 100644 --- a/lustre/portals/include/linux/portals_compat25.h +++ b/lustre/portals/include/linux/portals_compat25.h @@ -1,13 +1,23 @@ #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 RECALC_SIGPENDING recalc_sigpending() #else -# define SIGNAL_MASK_LOCK(task, flags) \ +# 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 RECALC_SIGPENDING recalc_sigpending(current) #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...) strcpy(comm, base, ## a) +#endif -- 1.8.3.1