mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 07:20:11 +00:00
linux-rxk-listener-shutdown-cleanup-20030323
get rid of need for sys_kill
This commit is contained in:
parent
45dd8988f2
commit
937ec63685
@ -31,45 +31,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef RECALC_SIGPENDING_TAKES_VOID
|
||||
/* Principal of maximum uselessness says we need to provide this */
|
||||
static inline int _has_pending_signals(sigset_t *signal, sigset_t *blocked)
|
||||
{
|
||||
unsigned long ready;
|
||||
long i;
|
||||
|
||||
switch (_NSIG_WORDS) {
|
||||
default:
|
||||
for (i = _NSIG_WORDS, ready = 0; --i >= 0 ;)
|
||||
ready |= signal->sig[i] &~ blocked->sig[i];
|
||||
break;
|
||||
|
||||
case 4: ready = signal->sig[3] &~ blocked->sig[3];
|
||||
ready |= signal->sig[2] &~ blocked->sig[2];
|
||||
ready |= signal->sig[1] &~ blocked->sig[1];
|
||||
ready |= signal->sig[0] &~ blocked->sig[0];
|
||||
break;
|
||||
|
||||
case 2: ready = signal->sig[1] &~ blocked->sig[1];
|
||||
ready |= signal->sig[0] &~ blocked->sig[0];
|
||||
break;
|
||||
|
||||
case 1: ready = signal->sig[0] &~ blocked->sig[0];
|
||||
}
|
||||
return ready != 0;
|
||||
}
|
||||
|
||||
#define PENDING(p,b) _has_pending_signals(&(p)->signal, (b))
|
||||
static inline void _recalc_sigpending_tsk(struct task_struct *t)
|
||||
{
|
||||
t->sigpending = PENDING(&t->pending, &t->blocked) ||
|
||||
#ifdef STRUCT_TASK_STRUCT_HAS_SIG
|
||||
PENDING(&t->sig->shared_pending, &t->blocked);
|
||||
#else
|
||||
PENDING(&t->signal->shared_pending, &t->blocked);
|
||||
#endif
|
||||
}
|
||||
|
||||
#define RECALC_SIGPENDING(X) _recalc_sigpending_tsk(X)
|
||||
#define RECALC_SIGPENDING(X) recalc_sigpending()
|
||||
#else
|
||||
#define RECALC_SIGPENDING(X) recalc_sigpending(X)
|
||||
#endif
|
||||
|
@ -451,14 +451,6 @@ void osi_linux_mask(void)
|
||||
SIG_UNLOCK(current);
|
||||
}
|
||||
|
||||
void osi_linux_unmask() {
|
||||
SIG_LOCK(rxk_ListenerTask);
|
||||
sigemptyset(&rxk_ListenerTask->blocked);
|
||||
flush_signals(rxk_ListenerTask);
|
||||
RECALC_SIGPENDING(rxk_ListenerTask);
|
||||
SIG_UNLOCK(rxk_ListenerTask);
|
||||
}
|
||||
|
||||
void osi_linux_rxkreg(void)
|
||||
{
|
||||
rxk_ListenerTask = current;
|
||||
|
@ -38,7 +38,6 @@ RCSID("$Header$");
|
||||
#endif
|
||||
|
||||
asmlinkage int (*sys_settimeofdayp)(struct timeval *tv, struct timezone *tz);
|
||||
asmlinkage int (*sys_killp)(int pid, int signal);
|
||||
asmlinkage long (*sys_setgroupsp)(int gidsetsize, gid_t *grouplist);
|
||||
|
||||
#ifdef EXPORTED_SYS_CALL_TABLE
|
||||
@ -193,7 +192,7 @@ int init_module(void)
|
||||
{
|
||||
#if defined(AFS_IA64_LINUX20_ENV)
|
||||
unsigned long kernel_gp;
|
||||
static struct fptr sys_kill, sys_settimeofday, sys_setgroups;
|
||||
static struct fptr sys_settimeofday, sys_setgroups;
|
||||
#endif
|
||||
extern int afs_syscall();
|
||||
extern long afs_xsetgroups();
|
||||
@ -319,18 +318,13 @@ int init_module(void)
|
||||
kernel_gp = ((struct fptr *)printk)->gp;
|
||||
|
||||
sys_settimeofdayp = (void *) &sys_settimeofday;
|
||||
sys_killp = (void *) &sys_kill;
|
||||
|
||||
((struct fptr *)sys_settimeofdayp)->ip =
|
||||
SYSCALL2POINTER sys_call_table[__NR_settimeofday - 1024];
|
||||
((struct fptr *)sys_settimeofdayp)->gp = kernel_gp;
|
||||
|
||||
((struct fptr *)sys_killp)->ip =
|
||||
SYSCALL2POINTER sys_call_table[__NR_kill - 1024];
|
||||
((struct fptr *)sys_killp)->gp = kernel_gp;
|
||||
#else /* !AFS_IA64_LINUX20_ENV */
|
||||
sys_settimeofdayp = SYSCALL2POINTER sys_call_table[__NR_settimeofday];
|
||||
sys_killp = SYSCALL2POINTER sys_call_table[__NR_kill];
|
||||
#endif /* AFS_IA64_LINUX20_ENV */
|
||||
|
||||
/* setup AFS entry point. */
|
||||
|
@ -282,9 +282,6 @@ void afs_osi_MaskSignals(void)
|
||||
/* unmask signals in rxk listener */
|
||||
void afs_osi_UnmaskRxkSignals(void)
|
||||
{
|
||||
#ifdef AFS_LINUX22_ENV
|
||||
osi_linux_unmask();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* register rxk listener proc info */
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
RCSID("$Header$");
|
||||
|
||||
#include <linux/version.h>
|
||||
#ifdef AFS_LINUX22_ENV
|
||||
#include "rx/rx_kcommon.h"
|
||||
#if defined(AFS_LINUX24_ENV)
|
||||
@ -174,11 +175,18 @@ int osi_NetReceive(osi_socket so, struct sockaddr_in *from,
|
||||
|
||||
void osi_StopListener(void)
|
||||
{
|
||||
extern int (*sys_killp)();
|
||||
struct task_struct *listener;
|
||||
extern int rxk_ListenerPid;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
|
||||
read_lock(&tasklist_lock);
|
||||
#endif
|
||||
listener = find_task_by_pid(rxk_ListenerPid);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
|
||||
read_unlock(&tasklist_lock);
|
||||
#endif
|
||||
while (rxk_ListenerPid) {
|
||||
(void) (*sys_killp)(rxk_ListenerPid, SIGKILL);
|
||||
force_sig(SIGKILL, listener);
|
||||
afs_osi_Sleep(&rxk_ListenerPid);
|
||||
}
|
||||
sock_release(rx_socket);
|
||||
|
Loading…
Reference in New Issue
Block a user