RDS: Add rds_send_path_reset()
[deliverable/linux.git] / net / rds / send.c
index c9cdb358ea885e3e356cc675b579f1313ed94ff9..bfb3e053021389d05a2a2582b4a91c27846d0055 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/export.h>
 #include <linux/sizes.h>
 
+#include "rds_single_path.h"
 #include "rds.h"
 
 /* When transmitting messages in rds_send_xmit, we need to emerge from
@@ -62,14 +63,14 @@ static void rds_send_remove_from_sock(struct list_head *messages, int status);
  * Reset the send state.  Callers must ensure that this doesn't race with
  * rds_send_xmit().
  */
-void rds_send_reset(struct rds_connection *conn)
+static void rds_send_path_reset(struct rds_conn_path *cp)
 {
        struct rds_message *rm, *tmp;
        unsigned long flags;
 
-       if (conn->c_xmit_rm) {
-               rm = conn->c_xmit_rm;
-               conn->c_xmit_rm = NULL;
+       if (cp->cp_xmit_rm) {
+               rm = cp->cp_xmit_rm;
+               cp->cp_xmit_rm = NULL;
                /* Tell the user the RDMA op is no longer mapped by the
                 * transport. This isn't entirely true (it's flushed out
                 * independently) but as the connection is down, there's
@@ -78,27 +79,33 @@ void rds_send_reset(struct rds_connection *conn)
                rds_message_put(rm);
        }
 
-       conn->c_xmit_sg = 0;
-       conn->c_xmit_hdr_off = 0;
-       conn->c_xmit_data_off = 0;
-       conn->c_xmit_atomic_sent = 0;
-       conn->c_xmit_rdma_sent = 0;
-       conn->c_xmit_data_sent = 0;
+       cp->cp_xmit_sg = 0;
+       cp->cp_xmit_hdr_off = 0;
+       cp->cp_xmit_data_off = 0;
+       cp->cp_xmit_atomic_sent = 0;
+       cp->cp_xmit_rdma_sent = 0;
+       cp->cp_xmit_data_sent = 0;
 
-       conn->c_map_queued = 0;
+       cp->cp_conn->c_map_queued = 0;
 
-       conn->c_unacked_packets = rds_sysctl_max_unacked_packets;
-       conn->c_unacked_bytes = rds_sysctl_max_unacked_bytes;
+       cp->cp_unacked_packets = rds_sysctl_max_unacked_packets;
+       cp->cp_unacked_bytes = rds_sysctl_max_unacked_bytes;
 
        /* Mark messages as retransmissions, and move them to the send q */
-       spin_lock_irqsave(&conn->c_lock, flags);
-       list_for_each_entry_safe(rm, tmp, &conn->c_retrans, m_conn_item) {
+       spin_lock_irqsave(&cp->cp_lock, flags);
+       list_for_each_entry_safe(rm, tmp, &cp->cp_retrans, m_conn_item) {
                set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags);
                set_bit(RDS_MSG_RETRANSMITTED, &rm->m_flags);
        }
-       list_splice_init(&conn->c_retrans, &conn->c_send_queue);
-       spin_unlock_irqrestore(&conn->c_lock, flags);
+       list_splice_init(&cp->cp_retrans, &cp->cp_send_queue);
+       spin_unlock_irqrestore(&cp->cp_lock, flags);
+}
+
+void rds_send_reset(struct rds_connection *conn)
+{
+       rds_send_path_reset(&conn->c_path[0]);
 }
+EXPORT_SYMBOL_GPL(rds_send_reset);
 
 static int acquire_in_xmit(struct rds_connection *conn)
 {
This page took 0.026645 seconds and 5 git commands to generate.