Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9e13cdf authored by Jeff Layton's avatar Jeff Layton Committed by J. Bruce Fields
Browse files

nfsd/sunrpc: turn enqueueing a svc_xprt into a svc_serv operation



For now, all services use svc_xprt_do_enqueue, but once we add
workqueue-based service support, we'll need to do something different.

Signed-off-by: default avatarShirley Ma <shirley.ma@oracle.com>
Acked-by: default avatarJeff Layton <jlayton@primarydata.com>
Tested-by: default avatarShirley Ma <shirley.ma@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 758f62ff
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -324,6 +324,7 @@ static int lockd_start_svc(struct svc_serv *serv)

static struct svc_serv_ops lockd_sv_ops = {
	.svo_shutdown		= svc_rpcb_cleanup,
	.svo_enqueue_xprt	= svc_xprt_do_enqueue,
};

static struct svc_serv *lockd_create_svc(void)
+1 −0
Original line number Diff line number Diff line
@@ -309,6 +309,7 @@ static int nfs_callback_up_net(int minorversion, struct svc_serv *serv, struct n
}

static struct svc_serv_ops nfs_cb_sv_ops = {
	.svo_enqueue_xprt	= svc_xprt_do_enqueue,
};

static struct svc_serv *nfs_callback_create_svc(int minorversion)
+6 −5
Original line number Diff line number Diff line
@@ -391,9 +391,10 @@ static int nfsd_get_default_max_blksize(void)
	return ret;
}

static struct svc_serv_ops nfsd_sv_ops = {
static struct svc_serv_ops nfsd_thread_sv_ops = {
	.svo_shutdown		= nfsd_last_thread,
	.svo_function		= nfsd,
	.svo_enqueue_xprt	= svc_xprt_do_enqueue,
	.svo_module		= THIS_MODULE,
};

@@ -411,7 +412,7 @@ int nfsd_create_serv(struct net *net)
		nfsd_max_blksize = nfsd_get_default_max_blksize();
	nfsd_reset_versions();
	nn->nfsd_serv = svc_create_pooled(&nfsd_program, nfsd_max_blksize,
						&nfsd_sv_ops);
						&nfsd_thread_sv_ops);
	if (nn->nfsd_serv == NULL)
		return -ENOMEM;

+3 −0
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@ struct svc_serv_ops {
	/* function for service threads to run */
	int		(*svo_function)(void *);

	/* queue up a transport for servicing */
	void		(*svo_enqueue_xprt)(struct svc_xprt *);

	/* optional module to count when adding threads (pooled svcs only) */
	struct module	*svo_module;
};
+1 −0
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ void svc_xprt_init(struct net *, struct svc_xprt_class *, struct svc_xprt *,
		      struct svc_serv *);
int	svc_create_xprt(struct svc_serv *, const char *, struct net *,
			const int, const unsigned short, int);
void	svc_xprt_do_enqueue(struct svc_xprt *xprt);
void	svc_xprt_enqueue(struct svc_xprt *xprt);
void	svc_xprt_put(struct svc_xprt *xprt);
void	svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt);
Loading