diff options
Diffstat (limited to 'net/rds/send.c')
-rw-r--r-- | net/rds/send.c | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/net/rds/send.c b/net/rds/send.c index d1f364e44e36..8a0647af5d95 100644 --- a/net/rds/send.c +++ b/net/rds/send.c | |||
@@ -147,41 +147,16 @@ int rds_send_xmit(struct rds_connection *conn) | |||
147 | /* | 147 | /* |
148 | * If between sending messages, we can send a pending congestion | 148 | * If between sending messages, we can send a pending congestion |
149 | * map update. | 149 | * map update. |
150 | * | ||
151 | * Transports either define a special xmit_cong_map function, | ||
152 | * or we allocate a cong_map message and treat it just like any | ||
153 | * other send. | ||
154 | */ | 150 | */ |
155 | if (!rm && test_and_clear_bit(0, &conn->c_map_queued)) { | 151 | if (!rm && test_and_clear_bit(0, &conn->c_map_queued)) { |
156 | if (conn->c_trans->xmit_cong_map) { | 152 | rm = rds_cong_update_alloc(conn); |
157 | unsigned long map_offset = 0; | 153 | if (IS_ERR(rm)) { |
158 | unsigned long map_bytes = sizeof(struct rds_header) + | 154 | ret = PTR_ERR(rm); |
159 | RDS_CONG_MAP_BYTES; | 155 | break; |
160 | |||
161 | while (map_bytes) { | ||
162 | ret = conn->c_trans->xmit_cong_map(conn, conn->c_lcong, | ||
163 | map_offset); | ||
164 | if (ret <= 0) { | ||
165 | /* too far down the rabbithole! */ | ||
166 | mutex_unlock(&conn->c_send_lock); | ||
167 | rds_conn_error(conn, "Cong map xmit failed\n"); | ||
168 | goto out; | ||
169 | } | ||
170 | |||
171 | map_offset += ret; | ||
172 | map_bytes -= ret; | ||
173 | } | ||
174 | } else { | ||
175 | /* send cong update like a normal rm */ | ||
176 | rm = rds_cong_update_alloc(conn); | ||
177 | if (IS_ERR(rm)) { | ||
178 | ret = PTR_ERR(rm); | ||
179 | break; | ||
180 | } | ||
181 | rm->data.op_active = 1; | ||
182 | |||
183 | conn->c_xmit_rm = rm; | ||
184 | } | 156 | } |
157 | rm->data.op_active = 1; | ||
158 | |||
159 | conn->c_xmit_rm = rm; | ||
185 | } | 160 | } |
186 | 161 | ||
187 | /* | 162 | /* |