aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sunrpc/rpc_pipe.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 81e00a6c19de..e3b242daf53c 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -39,23 +39,27 @@ static kmem_cache_t *rpc_inode_cachep __read_mostly;
39#define RPC_UPCALL_TIMEOUT (30*HZ) 39#define RPC_UPCALL_TIMEOUT (30*HZ)
40 40
41static void 41static void
42__rpc_purge_upcall(struct inode *inode, int err) 42__rpc_purge_list(struct rpc_inode *rpci, struct list_head *head, int err)
43{ 43{
44 struct rpc_inode *rpci = RPC_I(inode);
45 struct rpc_pipe_msg *msg; 44 struct rpc_pipe_msg *msg;
45 void (*destroy_msg)(struct rpc_pipe_msg *);
46 46
47 while (!list_empty(&rpci->pipe)) { 47 destroy_msg = rpci->ops->destroy_msg;
48 msg = list_entry(rpci->pipe.next, struct rpc_pipe_msg, list); 48 while (!list_empty(head)) {
49 msg = list_entry(head->next, struct rpc_pipe_msg, list);
49 list_del_init(&msg->list); 50 list_del_init(&msg->list);
50 msg->errno = err; 51 msg->errno = err;
51 rpci->ops->destroy_msg(msg); 52 destroy_msg(msg);
52 }
53 while (!list_empty(&rpci->in_upcall)) {
54 msg = list_entry(rpci->pipe.next, struct rpc_pipe_msg, list);
55 list_del_init(&msg->list);
56 msg->errno = err;
57 rpci->ops->destroy_msg(msg);
58 } 53 }
54}
55
56static void
57__rpc_purge_upcall(struct inode *inode, int err)
58{
59 struct rpc_inode *rpci = RPC_I(inode);
60
61 __rpc_purge_list(rpci, &rpci->pipe, err);
62 __rpc_purge_list(rpci, &rpci->in_upcall, err);
59 rpci->pipelen = 0; 63 rpci->pipelen = 0;
60 wake_up(&rpci->waitq); 64 wake_up(&rpci->waitq);
61} 65}