Re: [PATCH 007 of 9] knfsd: Separate out some parts of nfsd_svc, which start nfs servers.

Andrew Morton
2006-07-26T06:42:11Z

On Tue, 25 Jul 2006 11:54:57 +1000
NeilBrown <neilb@suse.de> wrote:

>
> Separate out the code for creating a new service, and for creating
> initial sockets.
>
> Some of these new functions will have multiple callers soon.

In which case they shouldn't be inlined, hmm?

> +static inline int nfsd_create_serv(void)
> +{
> + int err = 0;
> + lock_kernel();
> + if (nfsd_serv) {
> + nfsd_serv->sv_nrthreads++;
> + unlock_kernel();
> + return 0;
> + }
> +
> + atomic_set(&nfsd_busy, 0);
> + nfsd_serv = svc_create(&nfsd_program, NFSD_BUFSIZE,
> + nfsd_last_thread);
> + if (nfsd_serv == NULL)
> + err = -ENOMEM;
> + else
> + nfsd_serv->sv_nrthreads++;
> + unlock_kernel();
> + do_gettimeofday(&nfssvc_boot); /* record boot time */
> + return err;
> +}
> +