aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Grover <andy.grover@oracle.com>2010-01-27 19:15:48 -0500
committerAndy Grover <andy.grover@oracle.com>2010-09-08 21:11:57 -0400
commitd0ab25a83c4a08cd98b73a37d3f4c069f7b4f50b (patch)
treed21dad44f483e684c35209f61b905b53ae582050
parent4324879df06ba4db01a0b455af2d003f117e6aa3 (diff)
RDS: purge atomic resources too in rds_message_purge()
Add atomic_free_op function, analogous to rdma_free_op, and call it in rds_message_purge(). Signed-off-by: Andy Grover <andy.grover@oracle.com>
-rw-r--r--net/rds/message.c5
-rw-r--r--net/rds/rdma.c16
-rw-r--r--net/rds/rds.h1
3 files changed, 22 insertions, 0 deletions
diff --git a/net/rds/message.c b/net/rds/message.c
index a27e493a63a2..b53306c3e656 100644
--- a/net/rds/message.c
+++ b/net/rds/message.c
@@ -73,6 +73,11 @@ static void rds_message_purge(struct rds_message *rm)
73 rds_rdma_free_op(&rm->rdma.m_rdma_op); 73 rds_rdma_free_op(&rm->rdma.m_rdma_op);
74 if (rm->rdma.m_rdma_mr) 74 if (rm->rdma.m_rdma_mr)
75 rds_mr_put(rm->rdma.m_rdma_mr); 75 rds_mr_put(rm->rdma.m_rdma_mr);
76
77 if (rm->atomic.op_active)
78 rds_atomic_free_op(&rm->atomic);
79 if (rm->atomic.op_rdma_mr)
80 rds_mr_put(rm->atomic.op_rdma_mr);
76} 81}
77 82
78void rds_message_put(struct rds_message *rm) 83void rds_message_put(struct rds_message *rm)
diff --git a/net/rds/rdma.c b/net/rds/rdma.c
index 91967c8bc572..0df86a382e2e 100644
--- a/net/rds/rdma.c
+++ b/net/rds/rdma.c
@@ -462,6 +462,22 @@ void rds_rdma_free_op(struct rds_rdma_op *ro)
462 ro->r_active = 0; 462 ro->r_active = 0;
463} 463}
464 464
465void rds_atomic_free_op(struct rm_atomic_op *ao)
466{
467 struct page *page = sg_page(ao->op_sg);
468
469 /* Mark page dirty if it was possibly modified, which
470 * is the case for a RDMA_READ which copies from remote
471 * to local memory */
472 set_page_dirty(page);
473 put_page(page);
474
475 kfree(ao->op_notifier);
476 ao->op_notifier = NULL;
477 ao->op_active = 0;
478}
479
480
465/* 481/*
466 * Count the number of pages needed to describe an incoming iovec. 482 * Count the number of pages needed to describe an incoming iovec.
467 */ 483 */
diff --git a/net/rds/rds.h b/net/rds/rds.h
index bf2349da4db7..32b3d46aea36 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -745,6 +745,7 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
745int rds_cmsg_rdma_map(struct rds_sock *rs, struct rds_message *rm, 745int rds_cmsg_rdma_map(struct rds_sock *rs, struct rds_message *rm,
746 struct cmsghdr *cmsg); 746 struct cmsghdr *cmsg);
747void rds_rdma_free_op(struct rds_rdma_op *ro); 747void rds_rdma_free_op(struct rds_rdma_op *ro);
748void rds_atomic_free_op(struct rm_atomic_op *ao);
748void rds_rdma_send_complete(struct rds_message *rm, int wc_status); 749void rds_rdma_send_complete(struct rds_message *rm, int wc_status);
749void rds_atomic_send_complete(struct rds_message *rm, int wc_status); 750void rds_atomic_send_complete(struct rds_message *rm, int wc_status);
750int rds_cmsg_atomic(struct rds_sock *rs, struct rds_message *rm, 751int rds_cmsg_atomic(struct rds_sock *rs, struct rds_message *rm,