mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	knfsd: remove special handling for SIGHUP
The special handling for SIGHUP in knfsd is a holdover from much earlier versions of Linux where reloading the export table was more expensive. That facility is not really needed anymore and to my knowledge, is seldom-used. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
This commit is contained in:
		
							parent
							
								
									3dd98a3bcc
								
							
						
					
					
						commit
						e096bbc648
					
				
					 1 changed files with 7 additions and 24 deletions
				
			
		| 
						 | 
					@ -44,11 +44,6 @@
 | 
				
			||||||
 * when not handling a request. i.e. when waiting
 | 
					 * when not handling a request. i.e. when waiting
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
#define SHUTDOWN_SIGS	(sigmask(SIGKILL) | sigmask(SIGHUP) | sigmask(SIGINT) | sigmask(SIGQUIT))
 | 
					#define SHUTDOWN_SIGS	(sigmask(SIGKILL) | sigmask(SIGHUP) | sigmask(SIGINT) | sigmask(SIGQUIT))
 | 
				
			||||||
/* if the last thread dies with SIGHUP, then the exports table is
 | 
					 | 
				
			||||||
 * left unchanged ( like 2.4-{0-9} ).  Any other signal will clear
 | 
					 | 
				
			||||||
 * the exports table (like 2.2).
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
#define	SIG_NOCLEAN	SIGHUP
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern struct svc_program	nfsd_program;
 | 
					extern struct svc_program	nfsd_program;
 | 
				
			||||||
static void			nfsd(struct svc_rqst *rqstp);
 | 
					static void			nfsd(struct svc_rqst *rqstp);
 | 
				
			||||||
| 
						 | 
					@ -175,7 +170,6 @@ int nfsd_nrthreads(void)
 | 
				
			||||||
		return nfsd_serv->sv_nrthreads;
 | 
							return nfsd_serv->sv_nrthreads;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int killsig;	/* signal that was used to kill last nfsd */
 | 
					 | 
				
			||||||
static void nfsd_last_thread(struct svc_serv *serv)
 | 
					static void nfsd_last_thread(struct svc_serv *serv)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	/* When last nfsd thread exits we need to do some clean-up */
 | 
						/* When last nfsd thread exits we need to do some clean-up */
 | 
				
			||||||
| 
						 | 
					@ -186,11 +180,9 @@ static void nfsd_last_thread(struct svc_serv *serv)
 | 
				
			||||||
	nfsd_racache_shutdown();
 | 
						nfsd_racache_shutdown();
 | 
				
			||||||
	nfs4_state_shutdown();
 | 
						nfs4_state_shutdown();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	printk(KERN_WARNING "nfsd: last server has exited\n");
 | 
						printk(KERN_WARNING "nfsd: last server has exited, flushing export "
 | 
				
			||||||
	if (killsig != SIG_NOCLEAN) {
 | 
								    "cache\n");
 | 
				
			||||||
		printk(KERN_WARNING "nfsd: unexporting all filesystems\n");
 | 
						nfsd_export_flush();
 | 
				
			||||||
		nfsd_export_flush();
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void nfsd_reset_versions(void)
 | 
					void nfsd_reset_versions(void)
 | 
				
			||||||
| 
						 | 
					@ -242,10 +234,9 @@ int nfsd_create_serv(void)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	atomic_set(&nfsd_busy, 0);
 | 
						atomic_set(&nfsd_busy, 0);
 | 
				
			||||||
	nfsd_serv = svc_create_pooled(&nfsd_program,
 | 
						nfsd_serv = svc_create_pooled(&nfsd_program, nfsd_max_blksize,
 | 
				
			||||||
				      nfsd_max_blksize,
 | 
									      nfsd_last_thread, nfsd, SIGINT,
 | 
				
			||||||
				      nfsd_last_thread,
 | 
									      THIS_MODULE);
 | 
				
			||||||
				      nfsd, SIG_NOCLEAN, THIS_MODULE);
 | 
					 | 
				
			||||||
	if (nfsd_serv == NULL)
 | 
						if (nfsd_serv == NULL)
 | 
				
			||||||
		err = -ENOMEM;
 | 
							err = -ENOMEM;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -490,17 +481,9 @@ nfsd(struct svc_rqst *rqstp)
 | 
				
			||||||
		atomic_dec(&nfsd_busy);
 | 
							atomic_dec(&nfsd_busy);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (err != -EINTR) {
 | 
						if (err != -EINTR)
 | 
				
			||||||
		printk(KERN_WARNING "nfsd: terminating on error %d\n", -err);
 | 
							printk(KERN_WARNING "nfsd: terminating on error %d\n", -err);
 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		unsigned int	signo;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (signo = 1; signo <= _NSIG; signo++)
 | 
					 | 
				
			||||||
			if (sigismember(¤t->pending.signal, signo) &&
 | 
					 | 
				
			||||||
			    !sigismember(¤t->blocked, signo))
 | 
					 | 
				
			||||||
				break;
 | 
					 | 
				
			||||||
		killsig = signo;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	/* Clear signals before calling svc_exit_thread() */
 | 
						/* Clear signals before calling svc_exit_thread() */
 | 
				
			||||||
	flush_signals(current);
 | 
						flush_signals(current);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue