diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-08-10 17:45:58 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-08-10 17:45:58 -0400 |
| commit | f884dcaead5f17bf586ac5fe6a3ad07b5203616a (patch) | |
| tree | 2406444df167f1d67b38733b544f2e2a96c778c7 | |
| parent | 976a6f921cad26651d25e73826c05c7a023f5fa4 (diff) | |
| parent | 8854e82d9accc80f43c0bc3ff06b5979ac858185 (diff) | |
Merge branch 'sunrpc_cache-for-2.6.32' into nfs-for-2.6.32
| -rw-r--r-- | fs/nfs/idmap.c | 6 | ||||
| -rw-r--r-- | fs/nfsd/export.c | 14 | ||||
| -rw-r--r-- | fs/nfsd/nfs4idmap.c | 20 | ||||
| -rw-r--r-- | include/linux/sunrpc/cache.h | 40 | ||||
| -rw-r--r-- | include/linux/sunrpc/clnt.h | 5 | ||||
| -rw-r--r-- | include/linux/sunrpc/rpc_pipe_fs.h | 18 | ||||
| -rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 12 | ||||
| -rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 7 | ||||
| -rw-r--r-- | net/sunrpc/cache.c | 550 | ||||
| -rw-r--r-- | net/sunrpc/clnt.c | 60 | ||||
| -rw-r--r-- | net/sunrpc/rpc_pipe.c | 678 | ||||
| -rw-r--r-- | net/sunrpc/svcauth_unix.c | 14 |
12 files changed, 939 insertions, 485 deletions
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c index 86147b0ab2c..21a84d45916 100644 --- a/fs/nfs/idmap.c +++ b/fs/nfs/idmap.c | |||
| @@ -101,7 +101,7 @@ static void idmap_pipe_destroy_msg(struct rpc_pipe_msg *); | |||
| 101 | 101 | ||
| 102 | static unsigned int fnvhash32(const void *, size_t); | 102 | static unsigned int fnvhash32(const void *, size_t); |
| 103 | 103 | ||
| 104 | static struct rpc_pipe_ops idmap_upcall_ops = { | 104 | static const struct rpc_pipe_ops idmap_upcall_ops = { |
| 105 | .upcall = idmap_pipe_upcall, | 105 | .upcall = idmap_pipe_upcall, |
| 106 | .downcall = idmap_pipe_downcall, | 106 | .downcall = idmap_pipe_downcall, |
| 107 | .destroy_msg = idmap_pipe_destroy_msg, | 107 | .destroy_msg = idmap_pipe_destroy_msg, |
| @@ -119,8 +119,8 @@ nfs_idmap_new(struct nfs_client *clp) | |||
| 119 | if (idmap == NULL) | 119 | if (idmap == NULL) |
| 120 | return -ENOMEM; | 120 | return -ENOMEM; |
| 121 | 121 | ||
| 122 | idmap->idmap_dentry = rpc_mkpipe(clp->cl_rpcclient->cl_dentry, "idmap", | 122 | idmap->idmap_dentry = rpc_mkpipe(clp->cl_rpcclient->cl_path.dentry, |
| 123 | idmap, &idmap_upcall_ops, 0); | 123 | "idmap", idmap, &idmap_upcall_ops, 0); |
| 124 | if (IS_ERR(idmap->idmap_dentry)) { | 124 | if (IS_ERR(idmap->idmap_dentry)) { |
| 125 | error = PTR_ERR(idmap->idmap_dentry); | 125 | error = PTR_ERR(idmap->idmap_dentry); |
| 126 | kfree(idmap); | 126 | kfree(idmap); |
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index b92a27629fb..d9462643155 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
| @@ -85,6 +85,11 @@ static void expkey_request(struct cache_detail *cd, | |||
| 85 | (*bpp)[-1] = '\n'; | 85 | (*bpp)[-1] = '\n'; |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | static int expkey_upcall(struct cache_detail *cd, struct cache_head *h) | ||
| 89 | { | ||
| 90 | return sunrpc_cache_pipe_upcall(cd, h, expkey_request); | ||
| 91 | } | ||
| 92 | |||
| 88 | static struct svc_expkey *svc_expkey_update(struct svc_expkey *new, struct svc_expkey *old); | 93 | static struct svc_expkey *svc_expkey_update(struct svc_expkey *new, struct svc_expkey *old); |
| 89 | static struct svc_expkey *svc_expkey_lookup(struct svc_expkey *); | 94 | static struct svc_expkey *svc_expkey_lookup(struct svc_expkey *); |
| 90 | static struct cache_detail svc_expkey_cache; | 95 | static struct cache_detail svc_expkey_cache; |
| @@ -259,7 +264,7 @@ static struct cache_detail svc_expkey_cache = { | |||
| 259 | .hash_table = expkey_table, | 264 | .hash_table = expkey_table, |
| 260 | .name = "nfsd.fh", | 265 | .name = "nfsd.fh", |
| 261 | .cache_put = expkey_put, | 266 | .cache_put = expkey_put, |
| 262 | .cache_request = expkey_request, | 267 | .cache_upcall = expkey_upcall, |
| 263 | .cache_parse = expkey_parse, | 268 | .cache_parse = expkey_parse, |
| 264 | .cache_show = expkey_show, | 269 | .cache_show = expkey_show, |
| 265 | .match = expkey_match, | 270 | .match = expkey_match, |
| @@ -355,6 +360,11 @@ static void svc_export_request(struct cache_detail *cd, | |||
| 355 | (*bpp)[-1] = '\n'; | 360 | (*bpp)[-1] = '\n'; |
| 356 | } | 361 | } |
| 357 | 362 | ||
| 363 | static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h) | ||
| 364 | { | ||
| 365 | return sunrpc_cache_pipe_upcall(cd, h, svc_export_request); | ||
| 366 | } | ||
| 367 | |||
| 358 | static struct svc_export *svc_export_update(struct svc_export *new, | 368 | static struct svc_export *svc_export_update(struct svc_export *new, |
| 359 | struct svc_export *old); | 369 | struct svc_export *old); |
| 360 | static struct svc_export *svc_export_lookup(struct svc_export *); | 370 | static struct svc_export *svc_export_lookup(struct svc_export *); |
| @@ -724,7 +734,7 @@ struct cache_detail svc_export_cache = { | |||
| 724 | .hash_table = export_table, | 734 | .hash_table = export_table, |
| 725 | .name = "nfsd.export", | 735 | .name = "nfsd.export", |
| 726 | .cache_put = svc_export_put, | 736 | .cache_put = svc_export_put, |
| 727 | .cache_request = svc_export_request, | 737 | .cache_upcall = svc_export_upcall, |
| 728 | .cache_parse = svc_export_parse, | 738 | .cache_parse = svc_export_parse, |
| 729 | .cache_show = svc_export_show, | 739 | .cache_show = svc_export_show, |
| 730 | .match = svc_export_match, | 740 | .match = svc_export_match, |
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index 5b398421b05..cdfa86fa147 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c | |||
| @@ -146,6 +146,12 @@ idtoname_request(struct cache_detail *cd, struct cache_head *ch, char **bpp, | |||
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | static int | 148 | static int |
| 149 | idtoname_upcall(struct cache_detail *cd, struct cache_head *ch) | ||
| 150 | { | ||
| 151 | return sunrpc_cache_pipe_upcall(cd, ch, idtoname_request); | ||
| 152 | } | ||
| 153 | |||
| 154 | static int | ||
| 149 | idtoname_match(struct cache_head *ca, struct cache_head *cb) | 155 | idtoname_match(struct cache_head *ca, struct cache_head *cb) |
| 150 | { | 156 | { |
| 151 | struct ent *a = container_of(ca, struct ent, h); | 157 | struct ent *a = container_of(ca, struct ent, h); |
| @@ -175,10 +181,10 @@ idtoname_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h) | |||
| 175 | } | 181 | } |
| 176 | 182 | ||
| 177 | static void | 183 | static void |
| 178 | warn_no_idmapd(struct cache_detail *detail) | 184 | warn_no_idmapd(struct cache_detail *detail, int has_died) |
| 179 | { | 185 | { |
| 180 | printk("nfsd: nfsv4 idmapping failing: has idmapd %s?\n", | 186 | printk("nfsd: nfsv4 idmapping failing: has idmapd %s?\n", |
| 181 | detail->last_close? "died" : "not been started"); | 187 | has_died ? "died" : "not been started"); |
| 182 | } | 188 | } |
| 183 | 189 | ||
| 184 | 190 | ||
| @@ -192,7 +198,7 @@ static struct cache_detail idtoname_cache = { | |||
| 192 | .hash_table = idtoname_table, | 198 | .hash_table = idtoname_table, |
| 193 | .name = "nfs4.idtoname", | 199 | .name = "nfs4.idtoname", |
| 194 | .cache_put = ent_put, | 200 | .cache_put = ent_put, |
| 195 | .cache_request = idtoname_request, | 201 | .cache_upcall = idtoname_upcall, |
| 196 | .cache_parse = idtoname_parse, | 202 | .cache_parse = idtoname_parse, |
| 197 | .cache_show = idtoname_show, | 203 | .cache_show = idtoname_show, |
| 198 | .warn_no_listener = warn_no_idmapd, | 204 | .warn_no_listener = warn_no_idmapd, |
| @@ -325,6 +331,12 @@ nametoid_request(struct cache_detail *cd, struct cache_head *ch, char **bpp, | |||
| 325 | } | 331 | } |
| 326 | 332 | ||
| 327 | static int | 333 | static int |
| 334 | nametoid_upcall(struct cache_detail *cd, struct cache_head *ch) | ||
| 335 | { | ||
| 336 | return sunrpc_cache_pipe_upcall(cd, ch, nametoid_request); | ||
| 337 | } | ||
| 338 | |||
| 339 | static int | ||
| 328 | nametoid_match(struct cache_head *ca, struct cache_head *cb) | 340 | nametoid_match(struct cache_head *ca, struct cache_head *cb) |
| 329 | { | 341 | { |
| 330 | struct ent *a = container_of(ca, struct ent, h); | 342 | struct ent *a = container_of(ca, struct ent, h); |
| @@ -363,7 +375,7 @@ static struct cache_detail nametoid_cache = { | |||
| 363 | .hash_table = nametoid_table, | 375 | .hash_table = nametoid_table, |
| 364 | .name = "nfs4.nametoid", | 376 | .name = "nfs4.nametoid", |
| 365 | .cache_put = ent_put, | 377 | .cache_put = ent_put, |
| 366 | .cache_request = nametoid_request, | 378 | .cache_upcall = nametoid_upcall, |
| 367 | .cache_parse = nametoid_parse, | 379 | .cache_parse = nametoid_parse, |
| 368 | .cache_show = nametoid_show, | 380 | .cache_show = nametoid_show, |
| 369 | .warn_no_listener = warn_no_idmapd, | 381 | .warn_no_listener = warn_no_idmapd, |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 2d8b211b932..6f52b4d7c44 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
| @@ -59,6 +59,15 @@ struct cache_head { | |||
| 59 | 59 | ||
| 60 | #define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ | 60 | #define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ |
| 61 | 61 | ||
| 62 | struct cache_detail_procfs { | ||
| 63 | struct proc_dir_entry *proc_ent; | ||
| 64 | struct proc_dir_entry *flush_ent, *channel_ent, *content_ent; | ||
| 65 | }; | ||
| 66 | |||
| 67 | struct cache_detail_pipefs { | ||
| 68 | struct dentry *dir; | ||
| 69 | }; | ||
| 70 | |||
| 62 | struct cache_detail { | 71 | struct cache_detail { |
| 63 | struct module * owner; | 72 | struct module * owner; |
| 64 | int hash_size; | 73 | int hash_size; |
| @@ -70,15 +79,17 @@ struct cache_detail { | |||
| 70 | char *name; | 79 | char *name; |
| 71 | void (*cache_put)(struct kref *); | 80 | void (*cache_put)(struct kref *); |
| 72 | 81 | ||
| 73 | void (*cache_request)(struct cache_detail *cd, | 82 | int (*cache_upcall)(struct cache_detail *, |
| 74 | struct cache_head *h, | 83 | struct cache_head *); |
| 75 | char **bpp, int *blen); | 84 | |
| 76 | int (*cache_parse)(struct cache_detail *, | 85 | int (*cache_parse)(struct cache_detail *, |
| 77 | char *buf, int len); | 86 | char *buf, int len); |
| 78 | 87 | ||
| 79 | int (*cache_show)(struct seq_file *m, | 88 | int (*cache_show)(struct seq_file *m, |
| 80 | struct cache_detail *cd, | 89 | struct cache_detail *cd, |
| 81 | struct cache_head *h); | 90 | struct cache_head *h); |
| 91 | void (*warn_no_listener)(struct cache_detail *cd, | ||
| 92 | |||
