diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2013-02-04 06:02:45 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-02-15 10:43:45 -0500 |
commit | 73fb847a44224d5708550e4be7baba9da75e00af (patch) | |
tree | 28046833f31b29bcea2a0af5e14d3d5c34723423 | |
parent | 462b8f6bf1d3f5feb7a346394036dbc1df3a8ed5 (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>
-rw-r--r-- | fs/nfs/dns_resolve.c | 3 | ||||
-rw-r--r-- | fs/nfsd/export.c | 6 | ||||
-rw-r--r-- | fs/nfsd/nfs4idmap.c | 6 | ||||
-rw-r--r-- | include/linux/sunrpc/cache.h | 4 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 3 | ||||
-rw-r--r-- | net/sunrpc/svcauth_unix.c | 6 |
6 files changed, 20 insertions, 8 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 | ||
70 | static int expkey_upcall(struct cache_detail *cd, struct cache_head *h) | 70 | static 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 | ||
75 | static struct svc_expkey *svc_expkey_update(struct cache_detail *cd, struct svc_expkey *new, | 75 | 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 = { | |||
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 | ||
341 | static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h) | 342 | static 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 | ||
346 | static struct svc_export *svc_export_update(struct svc_export *new, | 347 | static 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, | |||
142 | static int | 142 | static int |
143 | idtoname_upcall(struct cache_detail *cd, struct cache_head *ch) | 143 | idtoname_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 | ||
148 | static int | 148 | static 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, | |||
323 | static int | 324 | static int |
324 | nametoid_upcall(struct cache_detail *cd, struct cache_head *ch) | 325 | nametoid_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 | ||
329 | static int | 330 | static 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, |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 5dc9ee4d616e..4f1c8582053c 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
@@ -83,6 +83,10 @@ struct cache_detail { | |||
83 | int (*cache_upcall)(struct cache_detail *, | 83 | int (*cache_upcall)(struct cache_detail *, |
84 | struct cache_head *); | 84 | struct cache_head *); |
85 | 85 | ||
86 | void (*cache_request)(struct cache_detail *cd, | ||
87 | struct cache_head *ch, | ||
88 | char **bpp, int *blen); | ||
89 | |||
86 | int (*cache_parse)(struct cache_detail *, | 90 | int (*cache_parse)(struct cache_detail *, |
87 | char *buf, int len); | 91 | char *buf, int len); |
88 | 92 | ||
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index a5b41e2ac25a..1b0df530b59d 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -184,7 +184,7 @@ static void rsi_request(struct cache_detail *cd, | |||
184 | 184 | ||
185 | static int rsi_upcall(struct cache_detail *cd, struct cache_head *h) | 185 | static int rsi_upcall(struct cache_detail *cd, struct cache_head *h) |
186 | { | 186 | { |
187 | return sunrpc_cache_pipe_upcall(cd, h, rsi_request); | 187 | return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request); |
188 | } | 188 | } |
189 | 189 | ||
190 | 190 | ||
@@ -276,6 +276,7 @@ static struct cache_detail rsi_cache_template = { | |||
276 | .name = "auth.rpcsec.init", | 276 | .name = "auth.rpcsec.init", |
277 | .cache_put = rsi_put, | 277 | .cache_put = rsi_put, |
278 | .cache_upcall = rsi_upcall, | 278 | .cache_upcall = rsi_upcall, |
279 | .cache_request = rsi_request, | ||
279 | .cache_parse = rsi_parse, | 280 | .cache_parse = rsi_parse, |
280 | .match = rsi_match, | 281 | .match = rsi_match, |
281 | .init = rsi_init, | 282 | .init = rsi_init, |
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index ce34c8e5b8eb..18b8742eaa50 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c | |||
@@ -159,7 +159,7 @@ static void ip_map_request(struct cache_detail *cd, | |||
159 | 159 | ||
160 | static int ip_map_upcall(struct cache_detail *cd, struct cache_head *h) | 160 | static int ip_map_upcall(struct cache_detail *cd, struct cache_head *h) |
161 | { | 161 | { |
162 | return sunrpc_cache_pipe_upcall(cd, h, ip_map_request); | 162 | return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request); |
163 | } | 163 | } |
164 | 164 | ||
165 | static struct ip_map *__ip_map_lookup(struct cache_detail *cd, char *class, struct in6_addr *addr); | 165 | static struct ip_map *__ip_map_lookup(struct cache_detail *cd, char *class, struct in6_addr *addr); |
@@ -472,7 +472,7 @@ static void unix_gid_request(struct cache_detail *cd, | |||
472 | 472 | ||
473 | static int unix_gid_upcall(struct cache_detail *cd, struct cache_head *h) | 473 | static int unix_gid_upcall(struct cache_detail *cd, struct cache_head *h) |
474 | { | 474 | { |
475 | return sunrpc_cache_pipe_upcall(cd, h, unix_gid_request); | 475 | return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request); |
476 | } | 476 | } |
477 | 477 | ||
478 | static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, uid_t uid); | 478 | static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, uid_t uid); |
@@ -578,6 +578,7 @@ static struct cache_detail unix_gid_cache_template = { | |||
578 | .name = "auth.unix.gid", | 578 | .name = "auth.unix.gid", |
579 | .cache_put = unix_gid_put, | 579 | .cache_put = unix_gid_put, |
580 | .cache_upcall = unix_gid_upcall, | 580 | .cache_upcall = unix_gid_upcall, |
581 | .cache_request = unix_gid_request, | ||
581 | .cache_parse = unix_gid_parse, | 582 | .cache_parse = unix_gid_parse, |
582 | .cache_show = unix_gid_show, | 583 | .cache_show = unix_gid_show, |
583 | .match = unix_gid_match, | 584 | .match = unix_gid_match, |
@@ -875,6 +876,7 @@ static struct cache_detail ip_map_cache_template = { | |||
875 | .name = "auth.unix.ip", | 876 | .name = "auth.unix.ip", |
876 | .cache_put = ip_map_put, | 877 | .cache_put = ip_map_put, |
877 | .cache_upcall = ip_map_upcall, | 878 | .cache_upcall = ip_map_upcall, |
879 | .cache_request = ip_map_request, | ||
878 | .cache_parse = ip_map_parse, | 880 | .cache_parse = ip_map_parse, |
879 | .cache_show = ip_map_show, | 881 | .cache_show = ip_map_show, |
880 | .match = ip_map_match, | 882 | .match = ip_map_match, |