return kiblnd_map_tx(ni, tx, rd, sg - tx->tx_frags);
}
+static inline int
+get_kiov_length (int nkiov, lnet_kiov_t *kiov, int offset, int nob)
+{
+ int fragnob;
+ int count = 0;
+
+ do {
+ LASSERT (nkiov > 0);
+
+ fragnob = min((int)(kiov->kiov_len - offset), nob);
+
+ count++;
+
+ offset = 0;
+ kiov++;
+ nkiov--;
+ nob -= fragnob;
+ } while (nob > 0);
+
+ return count;
+}
+
int
kiblnd_setup_rd_kiov (lnet_ni_t *ni, kib_tx_t *tx, kib_rdma_desc_t *rd,
int nkiov, lnet_kiov_t *kiov, int offset, int nob)
}
sg = tx->tx_frags;
+ tx->tx_nfrags = get_kiov_length(nkiov, kiov, offset, nob);
+ sg_init_table(sg, tx->tx_nfrags);
do {
LASSERT (nkiov > 0);
fragnob = min((int)(kiov->kiov_len - offset), nob);
- memset(sg, 0, sizeof(*sg));
sg_set_page(sg, kiov->kiov_page, fragnob,
kiov->kiov_offset + offset);
sg++;
if (done)
kiblnd_tx_done(peer->ibp_ni, tx);
+
+ cfs_spin_lock(&conn->ibc_lock);
+
return -EIO;
}
kiblnd_queue_tx_locked(tx, conn);
}
+ kiblnd_conn_addref(conn); /* 1 ref for me.... (see b21911) */
+
for (;;) {
int credit;
}
cfs_spin_unlock(&conn->ibc_lock);
+
+ kiblnd_conn_decref(conn); /* ...until here */
}
void