diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-21 00:21:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-21 00:21:46 -0400 |
commit | 14b395e35d1afdd8019d11b92e28041fad591b71 (patch) | |
tree | cff7ba9bed7a38300b19a5bacc632979d64fd9c8 /net/sunrpc/xprtrdma/svc_rdma.c | |
parent | 734b397cd14f3340394a8dd3266bec97d01f034b (diff) | |
parent | 5108b27651727b5aba0826e8fd7be71b42428701 (diff) |
Merge branch 'for-2.6.27' of git://linux-nfs.org/~bfields/linux
* 'for-2.6.27' of git://linux-nfs.org/~bfields/linux: (51 commits)
nfsd: nfs4xdr.c do-while is not a compound statement
nfsd: Use C99 initializers in fs/nfsd/nfs4xdr.c
lockd: Pass "struct sockaddr *" to new failover-by-IP function
lockd: get host reference in nlmsvc_create_block() instead of callers
lockd: minor svclock.c style fixes
lockd: eliminate duplicate nlmsvc_lookup_host call from nlmsvc_lock
lockd: eliminate duplicate nlmsvc_lookup_host call from nlmsvc_testlock
lockd: nlm_release_host() checks for NULL, caller needn't
file lock: reorder struct file_lock to save space on 64 bit builds
nfsd: take file and mnt write in nfs4_upgrade_open
nfsd: document open share bit tracking
nfsd: tabulate nfs4 xdr encoding functions
nfsd: dprint operation names
svcrdma: Change WR context get/put to use the kmem cache
svcrdma: Create a kmem cache for the WR contexts
svcrdma: Add flush_scheduled_work to module exit function
svcrdma: Limit ORD based on client's advertised IRD
svcrdma: Remove unused wait q from svcrdma_xprt structure
svcrdma: Remove unneeded spin locks from __svc_rdma_free
svcrdma: Add dma map count and WARN_ON
...
Diffstat (limited to 'net/sunrpc/xprtrdma/svc_rdma.c')
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c index 88c0ca20bb1e..87101177825b 100644 --- a/net/sunrpc/xprtrdma/svc_rdma.c +++ b/net/sunrpc/xprtrdma/svc_rdma.c | |||
@@ -69,6 +69,10 @@ atomic_t rdma_stat_rq_prod; | |||
69 | atomic_t rdma_stat_sq_poll; | 69 | atomic_t rdma_stat_sq_poll; |
70 | atomic_t rdma_stat_sq_prod; | 70 | atomic_t rdma_stat_sq_prod; |
71 | 71 | ||
72 | /* Temporary NFS request map and context caches */ | ||
73 | struct kmem_cache *svc_rdma_map_cachep; | ||
74 | struct kmem_cache *svc_rdma_ctxt_cachep; | ||
75 | |||
72 | /* | 76 | /* |
73 | * This function implements reading and resetting an atomic_t stat | 77 | * This function implements reading and resetting an atomic_t stat |
74 | * variable through read/write to a proc file. Any write to the file | 78 | * variable through read/write to a proc file. Any write to the file |
@@ -236,11 +240,14 @@ static ctl_table svcrdma_root_table[] = { | |||
236 | void svc_rdma_cleanup(void) | 240 | void svc_rdma_cleanup(void) |
237 | { | 241 | { |
238 | dprintk("SVCRDMA Module Removed, deregister RPC RDMA transport\n"); | 242 | dprintk("SVCRDMA Module Removed, deregister RPC RDMA transport\n"); |
243 | flush_scheduled_work(); | ||
239 | if (svcrdma_table_header) { | 244 | if (svcrdma_table_header) { |
240 | unregister_sysctl_table(svcrdma_table_header); | 245 | unregister_sysctl_table(svcrdma_table_header); |
241 | svcrdma_table_header = NULL; | 246 | svcrdma_table_header = NULL; |
242 | } | 247 | } |
243 | svc_unreg_xprt_class(&svc_rdma_class); | 248 | svc_unreg_xprt_class(&svc_rdma_class); |
249 | kmem_cache_destroy(svc_rdma_map_cachep); | ||
250 | kmem_cache_destroy(svc_rdma_ctxt_cachep); | ||
244 | } | 251 | } |
245 | 252 | ||
246 | int svc_rdma_init(void) | 253 | int svc_rdma_init(void) |
@@ -255,9 +262,37 @@ int svc_rdma_init(void) | |||
255 | svcrdma_table_header = | 262 | svcrdma_table_header = |
256 | register_sysctl_table(svcrdma_root_table); | 263 | register_sysctl_table(svcrdma_root_table); |
257 | 264 | ||
265 | /* Create the temporary map cache */ | ||
266 | svc_rdma_map_cachep = kmem_cache_create("svc_rdma_map_cache", | ||
267 | sizeof(struct svc_rdma_req_map), | ||
268 | 0, | ||
269 | SLAB_HWCACHE_ALIGN, | ||
270 | NULL); | ||
271 | if (!svc_rdma_map_cachep) { | ||
272 | printk(KERN_INFO "Could not allocate map cache.\n"); | ||
273 | goto err0; | ||
274 | } | ||
275 | |||
276 | /* Create the temporary context cache */ | ||
277 | svc_rdma_ctxt_cachep = | ||
278 | kmem_cache_create("svc_rdma_ctxt_cache", | ||
279 | sizeof(struct svc_rdma_op_ctxt), | ||
280 | 0, | ||
281 | SLAB_HWCACHE_ALIGN, | ||
282 | NULL); | ||
283 | if (!svc_rdma_ctxt_cachep) { | ||
284 | printk(KERN_INFO "Could not allocate WR ctxt cache.\n"); | ||
285 | goto err1; | ||
286 | } | ||
287 | |||
258 | /* Register RDMA with the SVC transport switch */ | 288 | /* Register RDMA with the SVC transport switch */ |
259 | svc_reg_xprt_class(&svc_rdma_class); | 289 | svc_reg_xprt_class(&svc_rdma_class); |
260 | return 0; | 290 | return 0; |
291 | err1: | ||
292 | kmem_cache_destroy(svc_rdma_map_cachep); | ||
293 | err0: | ||
294 | unregister_sysctl_table(svcrdma_table_header); | ||
295 | return -ENOMEM; | ||
261 | } | 296 | } |
262 | MODULE_AUTHOR("Tom Tucker <tom@opengridcomputing.com>"); | 297 | MODULE_AUTHOR("Tom Tucker <tom@opengridcomputing.com>"); |
263 | MODULE_DESCRIPTION("SVC RDMA Transport"); | 298 | MODULE_DESCRIPTION("SVC RDMA Transport"); |