/* By the time this is called we can't have any more ioctls called on the socket so we don't need to worry about racing with others.  */
void rds_rdma_drop_keys(struct rds_sock *rs)
/* By the time this is called we can't have any more ioctls called on the socket so we don't need to worry about racing with others.  */
void rds_rdma_drop_keys(struct rds_sock *rs)
{
	struct rds_mr *mr;
	struct rb_node *node;
	while ((node = rb_first(&rs->rs_rdma_keys))) {
		mr = container_of(node, struct rds_mr, r_rb_node);
		if (mr->r_trans == rs->rs_transport)
			mr->r_invalidate = 0;
		rds_mr_put(mr);
	}
	if (rs->rs_transport && rs->rs_transport->flush_mrs)
		rs->rs_transport->flush_mrs();
}