xprtrdma: Improve commentary around rpcrdma_reps_unmap()
authorChuck Lever <chuck.lever@oracle.com>
Mon, 19 Apr 2021 18:02:28 +0000 (14:02 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 26 Apr 2021 13:23:19 +0000 (09:23 -0400)
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
net/sunrpc/xprtrdma/verbs.c

index 2bc4589..baf4b8c 100644 (file)
@@ -1041,6 +1041,10 @@ static void rpcrdma_rep_put(struct rpcrdma_buffer *buf,
        llist_add(&rep->rr_node, &buf->rb_free_reps);
 }
 
+/* Caller must ensure the QP is quiescent (RQ is drained) before
+ * invoking this function, to guarantee rb_all_reps is not
+ * changing.
+ */
 static void rpcrdma_reps_unmap(struct rpcrdma_xprt *r_xprt)
 {
        struct rpcrdma_buffer *buf = &r_xprt->rx_buf;
@@ -1048,7 +1052,7 @@ static void rpcrdma_reps_unmap(struct rpcrdma_xprt *r_xprt)
 
        list_for_each_entry(rep, &buf->rb_all_reps, rr_all) {
                rpcrdma_regbuf_dma_unmap(rep->rr_rdmabuf);
-               rep->rr_temp = true;
+               rep->rr_temp = true;    /* Mark this rep for destruction */
        }
 }