summary refs log tree commit diff
path: root/net/9p/trans_rdma.c
diff options
context:
space:
mode:
authorSimon Derr <simon.derr@bull.net>2013-06-21 15:32:43 +0200
committerEric Van Hensbergen <ericvh@gmail.com>2013-07-07 22:18:18 -0500
commit80b45261a0b263536b043c5ccfc4ba4fc27c2acc (patch)
treeb4d06110f4f121b8e2c26e521c164f5c668e2cc0 /net/9p/trans_rdma.c
parent1cff33069a4a1ac9ed080756113ecd17ad408282 (diff)
downloadlinux-80b45261a0b263536b043c5ccfc4ba4fc27c2acc.tar.gz
9P: Add cancelled() to the transport functions.
RDMA needs to post a buffer for each incoming reply.
Hence it needs to keep count of these and needs to be
aware of whether a flushed request has received a reply
or not.

This patch adds the cancelled() callback to the transport modules.
It is called when RFLUSH has been received and that the corresponding
request will never receive a reply.

Signed-off-by: Simon Derr <simon.derr@bull.net>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p/trans_rdma.c')
-rw-r--r--net/9p/trans_rdma.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
index 8f68df5d2973..928f2bb9bf8d 100644
--- a/net/9p/trans_rdma.c
+++ b/net/9p/trans_rdma.c
@@ -588,6 +588,17 @@ static int rdma_cancel(struct p9_client *client, struct p9_req_t *req)
 	return 1;
 }
 
+/* A request has been fully flushed without a reply.
+ * That means we have posted one buffer in excess.
+ */
+static int rdma_cancelled(struct p9_client *client, struct p9_req_t *req)
+{
+	struct p9_trans_rdma *rdma = client->trans;
+
+	atomic_inc(&rdma->excess_rc);
+	return 0;
+}
+
 /**
  * trans_create_rdma - Transport method for creating atransport instance
  * @client: client instance