sched.c (5d00837b90340af9106dcd93af75fd664c8eb87f) sched.c (f6a1cc89309f0ae847a9b6fe418d1c4215e5bc55)
1/*
2 * linux/net/sunrpc/sched.c
3 *
4 * Scheduling for synchronous and asynchronous RPC requests.
5 *
6 * Copyright (C) 1996 Olaf Kirch, <okir@monad.swb.de>
7 *
8 * TCP NFS related read + write fixes

--- 200 unchanged lines hidden (view full) ---

209}
210
211void rpc_init_wait_queue(struct rpc_wait_queue *queue, const char *qname)
212{
213 __rpc_init_priority_wait_queue(queue, qname, 1);
214}
215EXPORT_SYMBOL_GPL(rpc_init_wait_queue);
216
1/*
2 * linux/net/sunrpc/sched.c
3 *
4 * Scheduling for synchronous and asynchronous RPC requests.
5 *
6 * Copyright (C) 1996 Olaf Kirch, <okir@monad.swb.de>
7 *
8 * TCP NFS related read + write fixes

--- 200 unchanged lines hidden (view full) ---

209}
210
211void rpc_init_wait_queue(struct rpc_wait_queue *queue, const char *qname)
212{
213 __rpc_init_priority_wait_queue(queue, qname, 1);
214}
215EXPORT_SYMBOL_GPL(rpc_init_wait_queue);
216
217void rpc_destroy_wait_queue(struct rpc_wait_queue *queue)
218{
219}
220EXPORT_SYMBOL_GPL(rpc_destroy_wait_queue);
221
217static int rpc_wait_bit_killable(void *word)
218{
219 if (fatal_signal_pending(current))
220 return -ERESTARTSYS;
221 schedule();
222 return 0;
223}
224

--- 790 unchanged lines hidden (view full) ---

1015 if (rpc_buffer_mempool)
1016 mempool_destroy(rpc_buffer_mempool);
1017 if (rpc_task_mempool)
1018 mempool_destroy(rpc_task_mempool);
1019 if (rpc_task_slabp)
1020 kmem_cache_destroy(rpc_task_slabp);
1021 if (rpc_buffer_slabp)
1022 kmem_cache_destroy(rpc_buffer_slabp);
222static int rpc_wait_bit_killable(void *word)
223{
224 if (fatal_signal_pending(current))
225 return -ERESTARTSYS;
226 schedule();
227 return 0;
228}
229

--- 790 unchanged lines hidden (view full) ---

1020 if (rpc_buffer_mempool)
1021 mempool_destroy(rpc_buffer_mempool);
1022 if (rpc_task_mempool)
1023 mempool_destroy(rpc_task_mempool);
1024 if (rpc_task_slabp)
1025 kmem_cache_destroy(rpc_task_slabp);
1026 if (rpc_buffer_slabp)
1027 kmem_cache_destroy(rpc_buffer_slabp);
1028 rpc_destroy_wait_queue(&delay_queue);
1023}
1024
1025int
1026rpc_init_mempool(void)
1027{
1029}
1030
1031int
1032rpc_init_mempool(void)
1033{
1034 /*
1035 * The following is not strictly a mempool initialisation,
1036 * but there is no harm in doing it here
1037 */
1038 rpc_init_wait_queue(&delay_queue, "delayq");
1039 if (!rpciod_start())
1040 goto err_nomem;
1041
1028 rpc_task_slabp = kmem_cache_create("rpc_tasks",
1029 sizeof(struct rpc_task),
1030 0, SLAB_HWCACHE_ALIGN,
1031 NULL);
1032 if (!rpc_task_slabp)
1033 goto err_nomem;
1034 rpc_buffer_slabp = kmem_cache_create("rpc_buffers",
1035 RPC_BUFFER_MAXSIZE,

--- 4 unchanged lines hidden (view full) ---

1040 rpc_task_mempool = mempool_create_slab_pool(RPC_TASK_POOLSIZE,
1041 rpc_task_slabp);
1042 if (!rpc_task_mempool)
1043 goto err_nomem;
1044 rpc_buffer_mempool = mempool_create_slab_pool(RPC_BUFFER_POOLSIZE,
1045 rpc_buffer_slabp);
1046 if (!rpc_buffer_mempool)
1047 goto err_nomem;
1042 rpc_task_slabp = kmem_cache_create("rpc_tasks",
1043 sizeof(struct rpc_task),
1044 0, SLAB_HWCACHE_ALIGN,
1045 NULL);
1046 if (!rpc_task_slabp)
1047 goto err_nomem;
1048 rpc_buffer_slabp = kmem_cache_create("rpc_buffers",
1049 RPC_BUFFER_MAXSIZE,

--- 4 unchanged lines hidden (view full) ---

1054 rpc_task_mempool = mempool_create_slab_pool(RPC_TASK_POOLSIZE,
1055 rpc_task_slabp);
1056 if (!rpc_task_mempool)
1057 goto err_nomem;
1058 rpc_buffer_mempool = mempool_create_slab_pool(RPC_BUFFER_POOLSIZE,
1059 rpc_buffer_slabp);
1060 if (!rpc_buffer_mempool)
1061 goto err_nomem;
1048 if (!rpciod_start())
1049 goto err_nomem;
1050 /*
1051 * The following is not strictly a mempool initialisation,
1052 * but there is no harm in doing it here
1053 */
1054 rpc_init_wait_queue(&delay_queue, "delayq");
1055 return 0;
1056err_nomem:
1057 rpc_destroy_mempool();
1058 return -ENOMEM;
1059}
1062 return 0;
1063err_nomem:
1064 rpc_destroy_mempool();
1065 return -ENOMEM;
1066}