STABLE12-linux-rxk-listener-shutdown-cleanup-20030323

avoid need for sys_kill

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================

get rid of need for sys_kill

====================

get rid of need for sys_kill


(cherry picked from commit 937ec63685)
This commit is contained in:
Derrick Brashear 2003-03-26 09:11:29 +00:00
parent d0c1a98d36
commit 6549f0b0ea
5 changed files with 12 additions and 59 deletions

View File

@ -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

View File

@ -450,14 +450,6 @@ void osi_linux_mask() {
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() {
rxk_ListenerTask = current;
}

View File

@ -41,7 +41,6 @@ asmlinkage int (*sys_settimeofdayp)(struct timeval *tv, struct timezone *tz);
#if !defined(AFS_ALPHA_LINUX20_ENV)
asmlinkage int (*sys_socketcallp)(int call, long *args);
#endif /* no socketcall on alpha */
asmlinkage int (*sys_killp)(int pid, int signal);
asmlinkage long (*sys_setgroupsp)(int gidsetsize, gid_t *grouplist);
#ifdef EXPORTED_SYS_CALL_TABLE
@ -196,7 +195,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();
@ -322,21 +321,16 @@ error cant support this yet.
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];
#ifdef __NR_socketcall
sys_socketcallp = SYSCALL2POINTER sys_call_table[__NR_socketcall];
#endif /* no socketcall on alpha */
sys_killp = SYSCALL2POINTER sys_call_table[__NR_kill];
#endif /* AFS_IA64_LINUX20_ENV */
/* setup AFS entry point. */

View File

@ -289,9 +289,6 @@ void afs_osi_MaskSignals(){
/* unmask signals in rxk listener */
void afs_osi_UnmaskRxkSignals(){
#ifdef AFS_LINUX22_ENV
osi_linux_unmask();
#endif
}
/* register rxk listener proc info */

View File

@ -17,6 +17,7 @@
RCSID("$Header$");
#include <linux/version.h>
#ifdef AFS_LINUX22_ENV
#include "../rx/rx_kcommon.h"
#if defined(AFS_LINUX24_ENV)
@ -175,11 +176,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);