X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fsunrpc%2Fsched.c;h=2ac43c41c3a9889664a1c36b5072e1690ce0fea2;hb=40b77c943468236c6dfad3e7b94348fe70c70331;hp=f6eed4d4e5dd13df239bbe9f1a07d468ac300e18;hpb=ab418d70e1fceda1e2824c45ba3323a1b1413507;p=linux-2.6 diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index f6eed4d4e5..2ac43c41c3 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -39,7 +39,6 @@ static mempool_t *rpc_task_mempool __read_mostly; static mempool_t *rpc_buffer_mempool __read_mostly; static void __rpc_default_timer(struct rpc_task *task); -static void rpciod_killall(void); static void rpc_async_schedule(struct work_struct *); static void rpc_release_task(struct rpc_task *task); @@ -48,12 +47,6 @@ static void rpc_release_task(struct rpc_task *task); */ static RPC_WAITQ(delay_queue, "delayq"); -/* - * All RPC clients are linked into this list - */ -static LIST_HEAD(all_clients); -static DECLARE_WAIT_QUEUE_HEAD(client_kill_wait); - /* * rpciod-related stuff */ @@ -61,11 +54,6 @@ static DEFINE_MUTEX(rpciod_mutex); static atomic_t rpciod_users = ATOMIC_INIT(0); struct workqueue_struct *rpciod_workqueue; -/* - * Spinlock for other critical sections of code. - */ -static DEFINE_SPINLOCK(rpc_sched_lock); - /* * Disable the timer for a given RPC task. Should be called with * queue->lock and bh_disabled in order to avoid races within @@ -945,29 +933,6 @@ static void rpc_release_task(struct rpc_task *task) rpc_put_task(task); } -/** - * rpc_run_task - Allocate a new RPC task, then run rpc_execute against it - * @clnt: pointer to RPC client - * @flags: RPC flags - * @ops: RPC call ops - * @data: user call data - */ -struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags, - const struct rpc_call_ops *ops, - void *data) -{ - struct rpc_task *task; - task = rpc_new_task(clnt, flags, ops, data); - if (task == NULL) { - rpc_release_calldata(ops, data); - return ERR_PTR(-ENOMEM); - } - atomic_inc(&task->tk_count); - rpc_execute(task); - return task; -} -EXPORT_SYMBOL(rpc_run_task); - /* * Kill all tasks for the given client. * XXX: kill their descendants as well? @@ -996,48 +961,6 @@ void rpc_killall_tasks(struct rpc_clnt *clnt) spin_unlock(&clnt->cl_lock); } -static void rpciod_killall(void) -{ - struct rpc_clnt *clnt; - unsigned long flags; - - for(;;) { - clear_thread_flag(TIF_SIGPENDING); - - spin_lock(&rpc_sched_lock); - list_for_each_entry(clnt, &all_clients, cl_clients) - rpc_killall_tasks(clnt); - spin_unlock(&rpc_sched_lock); - flush_workqueue(rpciod_workqueue); - if (!list_empty(&all_clients)) - break; - dprintk("RPC: rpciod_killall: waiting for tasks " - "to exit\n"); - wait_event_timeout(client_kill_wait, - list_empty(&all_clients), 1*HZ); - } - - spin_lock_irqsave(¤t->sighand->siglock, flags); - recalc_sigpending(); - spin_unlock_irqrestore(¤t->sighand->siglock, flags); -} - -void rpc_register_client(struct rpc_clnt *clnt) -{ - spin_lock(&rpc_sched_lock); - list_add(&clnt->cl_clients, &all_clients); - spin_unlock(&rpc_sched_lock); -} - -void rpc_unregister_client(struct rpc_clnt *clnt) -{ - spin_lock(&rpc_sched_lock); - list_del(&clnt->cl_clients); - if (list_empty(&all_clients)) - wake_up(&client_kill_wait); - spin_unlock(&rpc_sched_lock); -} - /* * Start up the rpciod process if it's not already running. */ @@ -1083,51 +1006,12 @@ rpciod_down(void) dprintk("RPC: destroying workqueue rpciod\n"); if (atomic_read(&rpciod_users) == 0 && rpciod_workqueue != NULL) { - rpciod_killall(); destroy_workqueue(rpciod_workqueue); rpciod_workqueue = NULL; } mutex_unlock(&rpciod_mutex); } -#ifdef RPC_DEBUG -void rpc_show_tasks(void) -{ - struct rpc_clnt *clnt; - struct rpc_task *t; - - spin_lock(&rpc_sched_lock); - if (list_empty(&all_clients)) - goto out; - printk("-pid- proc flgs status -client- -prog- --rqstp- -timeout " - "-rpcwait -action- ---ops--\n"); - list_for_each_entry(clnt, &all_clients, cl_clients) { - if (list_empty(&clnt->cl_tasks)) - continue; - spin_lock(&clnt->cl_lock); - list_for_each_entry(t, &clnt->cl_tasks, tk_task) { - const char *rpc_waitq = "none"; - - if (RPC_IS_QUEUED(t)) - rpc_waitq = rpc_qname(t->u.tk_wait.rpc_waitq); - - printk("%5u %04d %04x %6d %8p %6d %8p %8ld %8s %8p %8p\n", - t->tk_pid, - (t->tk_msg.rpc_proc ? t->tk_msg.rpc_proc->p_proc : -1), - t->tk_flags, t->tk_status, - t->tk_client, - (t->tk_client ? t->tk_client->cl_prog : 0), - t->tk_rqstp, t->tk_timeout, - rpc_waitq, - t->tk_action, t->tk_ops); - } - spin_unlock(&clnt->cl_lock); - } -out: - spin_unlock(&rpc_sched_lock); -} -#endif - void rpc_destroy_mempool(void) {