提交 b3eb67a2 编写于 作者: T Trond Myklebust

SUNRPC: Funny looking code in __rpc_purge_upcall

 In __rpc_purge_upcall (net/sunrpc/rpc_pipe.c), the newer code to clean up
 the in_upcall list has a typo.
 Thanks to Vince Busam <vbusam@google.com> for spotting this!
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 b37b03b7
...@@ -39,23 +39,27 @@ static kmem_cache_t *rpc_inode_cachep __read_mostly; ...@@ -39,23 +39,27 @@ static kmem_cache_t *rpc_inode_cachep __read_mostly;
#define RPC_UPCALL_TIMEOUT (30*HZ) #define RPC_UPCALL_TIMEOUT (30*HZ)
static void static void
__rpc_purge_upcall(struct inode *inode, int err) __rpc_purge_list(struct rpc_inode *rpci, struct list_head *head, int err)
{ {
struct rpc_inode *rpci = RPC_I(inode);
struct rpc_pipe_msg *msg; struct rpc_pipe_msg *msg;
void (*destroy_msg)(struct rpc_pipe_msg *);
while (!list_empty(&rpci->pipe)) { destroy_msg = rpci->ops->destroy_msg;
msg = list_entry(rpci->pipe.next, struct rpc_pipe_msg, list); while (!list_empty(head)) {
msg = list_entry(head->next, struct rpc_pipe_msg, list);
list_del_init(&msg->list); list_del_init(&msg->list);
msg->errno = err; msg->errno = err;
rpci->ops->destroy_msg(msg); destroy_msg(msg);
}
while (!list_empty(&rpci->in_upcall)) {
msg = list_entry(rpci->pipe.next, struct rpc_pipe_msg, list);
list_del_init(&msg->list);
msg->errno = err;
rpci->ops->destroy_msg(msg);
} }
}
static void
__rpc_purge_upcall(struct inode *inode, int err)
{
struct rpc_inode *rpci = RPC_I(inode);
__rpc_purge_list(rpci, &rpci->pipe, err);
__rpc_purge_list(rpci, &rpci->in_upcall, err);
rpci->pipelen = 0; rpci->pipelen = 0;
wake_up(&rpci->waitq); wake_up(&rpci->waitq);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册