From 3c10ef2cdb725d75bb492658608a8f366b0fd900 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 23 Jan 2002 19:29:49 +0000 Subject: [PATCH] STABLE12-linux-rework-signal-blocking-for-afsdb-handler-and-clean-up-osi-invisible-before-im-completely-blind-20020123 based on suggestion from kolya@mit.edu and osi_Invisible cleanup so ifdef logic would be more clear ==================== 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. ==================== don't do this in userland cache manager (cherry picked from commit 1f3f7bc3efea3ffca469fbfe090953dcaa668799) --- src/afs/afs_call.c | 3 +++ src/afs/afs_osi.c | 46 ++++++++++++++++++++-------------------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index b14dc17cb..7a15ec0b4 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -637,6 +637,9 @@ long parm, parm2, parm3, parm4, parm5, parm6; afs_int32 *kmsg = afs_osi_Alloc(kmsgLen); char *cellname = afs_osi_Alloc(cellLen); +#ifndef UKERNEL + afs_osi_MaskSignals(); +#endif AFS_COPYIN((afs_int32 *)parm2, cellname, cellLen, code); AFS_COPYIN((afs_int32 *)parm3, kmsg, kmsgLen, code); if (!code) { diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c index b60ee4cc3..5e6e61110 100644 --- a/src/afs/afs_osi.c +++ b/src/afs/afs_osi.c @@ -280,46 +280,40 @@ afs_gfs_FlushText(vp) #endif /* AFS_TEXT_ENV */ -/* procedure for making our processes as invisible as we can */ -void afs_osi_Invisible() { -#ifndef AFS_AIX32_ENV - /* called once per "kernel" lwp to make it invisible */ +/* mask signals in afsds */ +void afs_osi_MaskSignals(){ #ifdef AFS_LINUX22_ENV spin_lock_irq(¤t->sigmask_lock); sigfillset(¤t->blocked); recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); +#endif +} + +/* procedure for making our processes as invisible as we can */ +void afs_osi_Invisible() { +#ifdef AFS_LINUX22_ENV + afs_osi_MaskSignals(); daemonize(); -#else /* AFS_LINUX22_ENV */ +#endif #ifdef AFS_DEC_ENV u.u_procp->p_type |= SSYS; -#else /* AFS_DEC_ENV */ -#if defined(AFS_SUN5_ENV) +#endif +#if AFS_SUN5_ENV curproc->p_flag |= SSYS; -#else /* AFS_SUN5_ENV */ -#if defined(AFS_SGI_ENV) - vrelvm(); -#endif /* AFS_SGI_ENV */ -#ifdef AFS_SUN_ENV - relvm(u.u_procp); /* release all the resources */ -#endif /* AFS_SUN_ENV */ -#if defined(AFS_HPUX101_ENV) +#endif +#if AFS_HPUX101_ENV set_system_proc(u.u_procp); -#else /* AFS_HPUX101_ENV */ +#endif #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) /* maybe call init_process instead? */ current_proc()->p_flag |= P_SYSTEM; -#else /* AFS_DARWIN_ENV || AFS_FBSD_ENV */ -#if !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) - u.u_procp->p_flag |= SSYS; -#endif /* !AFS_SGI64_ENV && !AFS_LINUX20_ENV */ -#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */ -#endif /* AFS_HPUX101_ENV */ -#endif /* AFS_SUN5_ENV */ -#endif /* AFS_DEC_ENV */ -#endif /* AFS_LINUX22_ENV */ -#endif /* AFS_AIX32_ENV */ +#endif +#if defined(AFS_SGI_ENV) + vrelvm(); +#endif /* AFS_SGI_ENV */ + AFS_STATCNT(osi_Invisible); } -- 2.39.5