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

Commit 73fb847a authored by Stanislav Kinsbursky's avatar Stanislav Kinsbursky Committed by J. Bruce Fields
Browse files

SUNRPC: introduce cache_detail->cache_request callback



This callback will allow to simplify upcalls in further patches in this
series.

Signed-off-by: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 462b8f6b
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -144,7 +144,7 @@ static int nfs_dns_upcall(struct cache_detail *cd,


	ret = nfs_cache_upcall(cd, key->hostname);
	ret = nfs_cache_upcall(cd, key->hostname);
	if (ret)
	if (ret)
		ret = sunrpc_cache_pipe_upcall(cd, ch, nfs_dns_request);
		ret = sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
	return ret;
	return ret;
}
}


@@ -359,6 +359,7 @@ static struct cache_detail nfs_dns_resolve_template = {
	.name		= "dns_resolve",
	.name		= "dns_resolve",
	.cache_put	= nfs_dns_ent_put,
	.cache_put	= nfs_dns_ent_put,
	.cache_upcall	= nfs_dns_upcall,
	.cache_upcall	= nfs_dns_upcall,
	.cache_request	= nfs_dns_request,
	.cache_parse	= nfs_dns_parse,
	.cache_parse	= nfs_dns_parse,
	.cache_show	= nfs_dns_show,
	.cache_show	= nfs_dns_show,
	.match		= nfs_dns_match,
	.match		= nfs_dns_match,
+4 −2
Original line number Original line Diff line number Diff line
@@ -69,7 +69,7 @@ static void expkey_request(struct cache_detail *cd,


static int expkey_upcall(struct cache_detail *cd, struct cache_head *h)
static int expkey_upcall(struct cache_detail *cd, struct cache_head *h)
{
{
	return sunrpc_cache_pipe_upcall(cd, h, expkey_request);
	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
}
}


static struct svc_expkey *svc_expkey_update(struct cache_detail *cd, struct svc_expkey *new,
static struct svc_expkey *svc_expkey_update(struct cache_detail *cd, struct svc_expkey *new,
@@ -246,6 +246,7 @@ static struct cache_detail svc_expkey_cache_template = {
	.name		= "nfsd.fh",
	.name		= "nfsd.fh",
	.cache_put	= expkey_put,
	.cache_put	= expkey_put,
	.cache_upcall	= expkey_upcall,
	.cache_upcall	= expkey_upcall,
	.cache_request	= expkey_request,
	.cache_parse	= expkey_parse,
	.cache_parse	= expkey_parse,
	.cache_show	= expkey_show,
	.cache_show	= expkey_show,
	.match		= expkey_match,
	.match		= expkey_match,
@@ -340,7 +341,7 @@ static void svc_export_request(struct cache_detail *cd,


static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h)
static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h)
{
{
	return sunrpc_cache_pipe_upcall(cd, h, svc_export_request);
	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
}
}


static struct svc_export *svc_export_update(struct svc_export *new,
static struct svc_export *svc_export_update(struct svc_export *new,
@@ -714,6 +715,7 @@ static struct cache_detail svc_export_cache_template = {
	.name		= "nfsd.export",
	.name		= "nfsd.export",
	.cache_put	= svc_export_put,
	.cache_put	= svc_export_put,
	.cache_upcall	= svc_export_upcall,
	.cache_upcall	= svc_export_upcall,
	.cache_request	= svc_export_request,
	.cache_parse	= svc_export_parse,
	.cache_parse	= svc_export_parse,
	.cache_show	= svc_export_show,
	.cache_show	= svc_export_show,
	.match		= svc_export_match,
	.match		= svc_export_match,
+4 −2
Original line number Original line Diff line number Diff line
@@ -142,7 +142,7 @@ idtoname_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
static int
static int
idtoname_upcall(struct cache_detail *cd, struct cache_head *ch)
idtoname_upcall(struct cache_detail *cd, struct cache_head *ch)
{
{
	return sunrpc_cache_pipe_upcall(cd, ch, idtoname_request);
	return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
}
}


static int
static int
@@ -193,6 +193,7 @@ static struct cache_detail idtoname_cache_template = {
	.name		= "nfs4.idtoname",
	.name		= "nfs4.idtoname",
	.cache_put	= ent_put,
	.cache_put	= ent_put,
	.cache_upcall	= idtoname_upcall,
	.cache_upcall	= idtoname_upcall,
	.cache_request	= idtoname_request,
	.cache_parse	= idtoname_parse,
	.cache_parse	= idtoname_parse,
	.cache_show	= idtoname_show,
	.cache_show	= idtoname_show,
	.warn_no_listener = warn_no_idmapd,
	.warn_no_listener = warn_no_idmapd,
@@ -323,7 +324,7 @@ nametoid_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
static int
static int
nametoid_upcall(struct cache_detail *cd, struct cache_head *ch)
nametoid_upcall(struct cache_detail *cd, struct cache_head *ch)
{
{
	return sunrpc_cache_pipe_upcall(cd, ch, nametoid_request);
	return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
}
}


static int
static int
@@ -366,6 +367,7 @@ static struct cache_detail nametoid_cache_template = {
	.name		= "nfs4.nametoid",
	.name		= "nfs4.nametoid",
	.cache_put	= ent_put,
	.cache_put	= ent_put,
	.cache_upcall	= nametoid_upcall,
	.cache_upcall	= nametoid_upcall,
	.cache_request	= nametoid_request,
	.cache_parse	= nametoid_parse,
	.cache_parse	= nametoid_parse,
	.cache_show	= nametoid_show,
	.cache_show	= nametoid_show,
	.warn_no_listener = warn_no_idmapd,
	.warn_no_listener = warn_no_idmapd,
+4 −0
Original line number Original line Diff line number Diff line
@@ -83,6 +83,10 @@ struct cache_detail {
	int			(*cache_upcall)(struct cache_detail *,
	int			(*cache_upcall)(struct cache_detail *,
						struct cache_head *);
						struct cache_head *);


	void			(*cache_request)(struct cache_detail *cd,
						 struct cache_head *ch,
						 char **bpp, int *blen);

	int			(*cache_parse)(struct cache_detail *,
	int			(*cache_parse)(struct cache_detail *,
					       char *buf, int len);
					       char *buf, int len);


+2 −1
Original line number Original line Diff line number Diff line
@@ -184,7 +184,7 @@ static void rsi_request(struct cache_detail *cd,


static int rsi_upcall(struct cache_detail *cd, struct cache_head *h)
static int rsi_upcall(struct cache_detail *cd, struct cache_head *h)
{
{
	return sunrpc_cache_pipe_upcall(cd, h, rsi_request);
	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
}
}




@@ -276,6 +276,7 @@ static struct cache_detail rsi_cache_template = {
	.name           = "auth.rpcsec.init",
	.name           = "auth.rpcsec.init",
	.cache_put      = rsi_put,
	.cache_put      = rsi_put,
	.cache_upcall   = rsi_upcall,
	.cache_upcall   = rsi_upcall,
	.cache_request  = rsi_request,
	.cache_parse    = rsi_parse,
	.cache_parse    = rsi_parse,
	.match		= rsi_match,
	.match		= rsi_match,
	.init		= rsi_init,
	.init		= rsi_init,
Loading