aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2013-02-04 06:02:45 -0500
committerJ. Bruce Fields <bfields@redhat.com>2013-02-15 10:43:45 -0500
commit73fb847a44224d5708550e4be7baba9da75e00af (patch)
tree28046833f31b29bcea2a0af5e14d3d5c34723423 /fs
parent462b8f6bf1d3f5feb7a346394036dbc1df3a8ed5 (diff)
SUNRPC: introduce cache_detail->cache_request callback
This callback will allow to simplify upcalls in further patches in this series. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/dns_resolve.c3
-rw-r--r--fs/nfsd/export.c6
-rw-r--r--fs/nfsd/nfs4idmap.c6
3 files changed, 10 insertions, 5 deletions
diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c
index 9cbc98a4159d..55bc5d11457c 100644
--- a/fs/nfs/dns_resolve.c
+++ b/fs/nfs/dns_resolve.c
@@ -144,7 +144,7 @@ static int nfs_dns_upcall(struct cache_detail *cd,
144 144
145 ret = nfs_cache_upcall(cd, key->hostname); 145 ret = nfs_cache_upcall(cd, key->hostname);
146 if (ret) 146 if (ret)
147 ret = sunrpc_cache_pipe_upcall(cd, ch, nfs_dns_request); 147 ret = sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
148 return ret; 148 return ret;
149} 149}
150 150
@@ -359,6 +359,7 @@ static struct cache_detail nfs_dns_resolve_template = {
359 .name = "dns_resolve", 359 .name = "dns_resolve",
360 .cache_put = nfs_dns_ent_put, 360 .cache_put = nfs_dns_ent_put,
361 .cache_upcall = nfs_dns_upcall, 361 .cache_upcall = nfs_dns_upcall,
362 .cache_request = nfs_dns_request,
362 .cache_parse = nfs_dns_parse, 363 .cache_parse = nfs_dns_parse,
363 .cache_show = nfs_dns_show, 364 .cache_show = nfs_dns_show,
364 .match = nfs_dns_match, 365 .match = nfs_dns_match,
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 8e9df45b3d3c..0e16c7fa6800 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -69,7 +69,7 @@ static void expkey_request(struct cache_detail *cd,
69 69
70static int expkey_upcall(struct cache_detail *cd, struct cache_head *h) 70static int expkey_upcall(struct cache_detail *cd, struct cache_head *h)
71{ 71{
72 return sunrpc_cache_pipe_upcall(cd, h, expkey_request); 72 return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
73} 73}
74 74
75static struct svc_expkey *svc_expkey_update(struct cache_detail *cd, struct svc_expkey *new, 75static 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 = {
246 .name = "nfsd.fh", 246 .name = "nfsd.fh",
247 .cache_put = expkey_put, 247 .cache_put = expkey_put,
248 .cache_upcall = expkey_upcall, 248 .cache_upcall = expkey_upcall,
249 .cache_request = expkey_request,
249 .cache_parse = expkey_parse, 250 .cache_parse = expkey_parse,
250 .cache_show = expkey_show, 251 .cache_show = expkey_show,
251 .match = expkey_match, 252 .match = expkey_match,
@@ -340,7 +341,7 @@ static void svc_export_request(struct cache_detail *cd,
340 341
341static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h) 342static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h)
342{ 343{
343 return sunrpc_cache_pipe_upcall(cd, h, svc_export_request); 344 return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
344} 345}
345 346
346static struct svc_export *svc_export_update(struct svc_export *new, 347static struct svc_export *svc_export_update(struct svc_export *new,
@@ -714,6 +715,7 @@ static struct cache_detail svc_export_cache_template = {
714 .name = "nfsd.export", 715 .name = "nfsd.export",
715 .cache_put = svc_export_put, 716 .cache_put = svc_export_put,
716 .cache_upcall = svc_export_upcall, 717 .cache_upcall = svc_export_upcall,
718 .cache_request = svc_export_request,
717 .cache_parse = svc_export_parse, 719 .cache_parse = svc_export_parse,
718 .cache_show = svc_export_show, 720 .cache_show = svc_export_show,
719 .match = svc_export_match, 721 .match = svc_export_match,
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index a1f10c0a6255..9033dfde1812 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -142,7 +142,7 @@ idtoname_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
142static int 142static int
143idtoname_upcall(struct cache_detail *cd, struct cache_head *ch) 143idtoname_upcall(struct cache_detail *cd, struct cache_head *ch)
144{ 144{
145 return sunrpc_cache_pipe_upcall(cd, ch, idtoname_request); 145 return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
146} 146}
147 147
148static int 148static int
@@ -193,6 +193,7 @@ static struct cache_detail idtoname_cache_template = {
193 .name = "nfs4.idtoname", 193 .name = "nfs4.idtoname",
194 .cache_put = ent_put, 194 .cache_put = ent_put,
195 .cache_upcall = idtoname_upcall, 195 .cache_upcall = idtoname_upcall,
196 .cache_request = idtoname_request,
196 .cache_parse = idtoname_parse, 197 .cache_parse = idtoname_parse,
197 .cache_show = idtoname_show, 198 .cache_show = idtoname_show,
198 .warn_no_listener = warn_no_idmapd, 199 .warn_no_listener = warn_no_idmapd,
@@ -323,7 +324,7 @@ nametoid_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
323static int 324static int
324nametoid_upcall(struct cache_detail *cd, struct cache_head *ch) 325nametoid_upcall(struct cache_detail *cd, struct cache_head *ch)
325{ 326{
326 return sunrpc_cache_pipe_upcall(cd, ch, nametoid_request); 327 return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
327} 328}
328 329
329static int 330static int
@@ -366,6 +367,7 @@ static struct cache_detail nametoid_cache_template = {
366 .name = "nfs4.nametoid", 367 .name = "nfs4.nametoid",
367 .cache_put = ent_put, 368 .cache_put = ent_put,
368 .cache_upcall = nametoid_upcall, 369 .cache_upcall = nametoid_upcall,
370 .cache_request = nametoid_request,
369 .cache_parse = nametoid_parse, 371 .cache_parse = nametoid_parse,
370 .cache_show = nametoid_show, 372 .cache_show = nametoid_show,
371 .warn_no_listener = warn_no_idmapd, 373 .warn_no_listener = warn_no_idmapd,