From 42f37d44a8b947cd0e382fb1105cc71d5e16ba85 Mon Sep 17 00:00:00 2001 From: Tom Tucker Date: Wed, 30 Apr 2008 22:00:46 -0500 Subject: [PATCH] --- yaml --- r: 97119 b: refs/heads/master c: 8da91ea8de873ee8be82377ff18637d05e882058 h: refs/heads/master i: 97117: 6f236e09ab753a19ebbd20ee77c822296886bb10 97115: edfd98ccd5f8ff85269cb11ac4aec6c1f3ff6bb3 97111: e7a7d225085fec9629f9fd17872cce3bdf778e09 97103: ff564269f756d6e639ffa5442854ab5bb2b8aed4 97087: 6400b823fb75c900cb4419aeb425c98c30b91a89 v: v3 --- [refs] | 2 +- trunk/include/linux/sunrpc/svc_rdma.h | 1 + trunk/net/sunrpc/xprtrdma/svc_rdma_transport.c | 17 ++++++++++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 1166a4529d75..d95f144b78df 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 47698e083e40bbd3ef87f5561390ae33abb13cd0 +refs/heads/master: 8da91ea8de873ee8be82377ff18637d05e882058 diff --git a/trunk/include/linux/sunrpc/svc_rdma.h b/trunk/include/linux/sunrpc/svc_rdma.h index 701439064d21..f5f15ae2438b 100644 --- a/trunk/include/linux/sunrpc/svc_rdma.h +++ b/trunk/include/linux/sunrpc/svc_rdma.h @@ -124,6 +124,7 @@ struct svcxprt_rdma { struct list_head sc_dto_q; /* DTO tasklet I/O pending Q */ struct list_head sc_read_complete_q; spinlock_t sc_read_complete_lock; + struct work_struct sc_work; }; /* sc_flags */ #define RDMAXPRT_RQ_PENDING 1 diff --git a/trunk/net/sunrpc/xprtrdma/svc_rdma_transport.c b/trunk/net/sunrpc/xprtrdma/svc_rdma_transport.c index 78303f0fad92..028c6cf89364 100644 --- a/trunk/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/trunk/net/sunrpc/xprtrdma/svc_rdma_transport.c @@ -963,12 +963,15 @@ static void svc_rdma_detach(struct svc_xprt *xprt) rdma_destroy_id(rdma->sc_cm_id); } -static void svc_rdma_free(struct svc_xprt *xprt) +static void __svc_rdma_free(struct work_struct *work) { - struct svcxprt_rdma *rdma = (struct svcxprt_rdma *)xprt; + struct svcxprt_rdma *rdma = + container_of(work, struct svcxprt_rdma, sc_work); dprintk("svcrdma: svc_rdma_free(%p)\n", rdma); + /* We should only be called from kref_put */ - BUG_ON(atomic_read(&xprt->xpt_ref.refcount) != 0); + BUG_ON(atomic_read(&rdma->sc_xprt.xpt_ref.refcount) != 0); + if (rdma->sc_sq_cq && !IS_ERR(rdma->sc_sq_cq)) ib_destroy_cq(rdma->sc_sq_cq); @@ -985,6 +988,14 @@ static void svc_rdma_free(struct svc_xprt *xprt) kfree(rdma); } +static void svc_rdma_free(struct svc_xprt *xprt) +{ + struct svcxprt_rdma *rdma = + container_of(xprt, struct svcxprt_rdma, sc_xprt); + INIT_WORK(&rdma->sc_work, __svc_rdma_free); + schedule_work(&rdma->sc_work); +} + static int svc_rdma_has_wspace(struct svc_xprt *xprt) { struct svcxprt_rdma *rdma =