/* * Use the nfsd_ctlbits to define which * versions that will be advertised. * If nfsd_ctlbits doesn't list any version, * export them all. */ found_one = 0;  for (i = NFSD_MINVERS; i < NFSD_NRVERS; i++) { if (NFSCTL_VERISSET(nfsd_versbits, i)) { nfsd_program.pg_vers[i] = nfsd_version[i]; found_one = 1; } else nfsd_program.pg_vers[i] = NULL; }  if (!found_one) { for (i = NFSD_MINVERS; i < NFSD_NRVERS; i++) nfsd_program.pg_vers[i] = nfsd_version[i]; }  
nfsd_svc(unsigned short port, int nrservs){	int	error;	int	none_left;		struct list_head *victim;		lock_kernel();	dprintk("nfsd: creating service\n");	error = -EINVAL;	if (nrservs <= 0)		nrservs = 0;	if (nrservs > NFSD_MAXSERVS)		nrservs = NFSD_MAXSERVS;		/* Readahead param cache - will no-op if it already exists */	error =	nfsd_racache_init(2*nrservs);	if (error<0)		goto out;	error = nfs4_state_start();	if (error<0)		goto out;	if (!nfsd_serv) {		atomic_set(&nfsd_busy, 0);		error = -ENOMEM;		nfsd_serv = svc_create(&nfsd_program, NFSD_BUFSIZE);		if (nfsd_serv == NULL)			goto out;		error = svc_makesock(nfsd_serv, IPPROTO_UDP, port);		if (error < 0)			goto failure;#ifdef CONFIG_NFSD_TCP		error = svc_makesock(nfsd_serv, IPPROTO_TCP, port);		if (error < 0)			goto failure;#endif		do_gettimeofday(&nfssvc_boot);		/* record boot time */	} else		nfsd_serv->sv_nrthreads++;	nrservs -= (nfsd_serv->sv_nrthreads-1);	while (nrservs > 0) {		nrservs--;		__module_get(THIS_MODULE);		error = svc_create_thread(nfsd, nfsd_serv);		if (error < 0) {			module_put(THIS_MODULE);			break;		}	}	victim = nfsd_list.next;	while (nrservs < 0 && victim != &nfsd_list) {		struct nfsd_list *nl =			list_entry(victim,struct nfsd_list, list);		victim = victim->next;		send_sig(SIG_NOCLEAN, nl->task, 1);		nrservs++;	} failure:	none_left = (nfsd_serv->sv_nrthreads == 1);	svc_destroy(nfsd_serv);		/* Release server */	if (none_left) {		nfsd_serv = NULL;		nfsd_racache_shutdown();		nfs4_state_shutdown();	} out:	unlock_kernel();	return error;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/70c3b76c28b012452d63bb27f6d0517afb05d86f/nfssvc.c/clean/fs/nfsd/nfssvc.c