unsigned int offset_in,
__u64 hdr_data_in);
-int LNetGet(lnet_nid_t self,
- struct lnet_handle_md md_in,
- struct lnet_process_id target_in,
- unsigned int portal_in,
- __u64 match_bits_in,
- unsigned int offset_in,
- bool recovery);
+int LNetGet(struct lnet_nid *self,
+ struct lnet_handle_md md_in,
+ struct lnet_processid *target_in,
+ unsigned int portal_in,
+ __u64 match_bits_in,
+ unsigned int offset_in,
+ bool recovery);
/** @} lnet_data */
*/
static atomic_t lnet_dlc_seq_no = ATOMIC_INIT(0);
-static int lnet_ping(struct lnet_process_id id, struct lnet_nid *src_nid,
+static int lnet_ping(struct lnet_process_id id4, struct lnet_nid *src_nid,
signed long timeout, struct lnet_process_id __user *ids,
int n_ids);
complete(&pd->completion);
}
-static int lnet_ping(struct lnet_process_id id, struct lnet_nid *src_nid,
+static int lnet_ping(struct lnet_process_id id4, struct lnet_nid *src_nid,
signed long timeout, struct lnet_process_id __user *ids,
int n_ids)
{
struct ping_data pd = { 0 };
struct lnet_ping_buffer *pbuf;
struct lnet_process_id tmpid;
+ struct lnet_processid id;
int i;
int nob;
int rc;
int rc2;
/* n_ids limit is arbitrary */
- if (n_ids <= 0 || id.nid == LNET_NID_ANY)
+ if (n_ids <= 0 || id4.nid == LNET_NID_ANY)
return -EINVAL;
/*
if (n_ids > lnet_interfaces_max)
n_ids = lnet_interfaces_max;
- if (id.pid == LNET_PID_ANY)
- id.pid = LNET_PID_LUSTRE;
+ if (id4.pid == LNET_PID_ANY)
+ id4.pid = LNET_PID_LUSTRE;
pbuf = lnet_ping_buffer_alloc(n_ids, GFP_NOFS);
if (!pbuf)
goto fail_ping_buffer_decref;
}
- rc = LNetGet(lnet_nid_to_nid4(src_nid), pd.mdh, id,
- LNET_RESERVED_PORTAL,
+ lnet_pid4_to_pid(id4, &id);
+ rc = LNetGet(src_nid, pd.mdh, &id, LNET_RESERVED_PORTAL,
LNET_PROTO_PING_MATCHBITS, 0, false);
if (rc != 0) {
if (nob < 8) {
CERROR("%s: ping info too short %d\n",
- libcfs_id2str(id), nob);
+ libcfs_id2str(id4), nob);
goto fail_ping_buffer_decref;
}
lnet_swap_pinginfo(pbuf);
} else if (pbuf->pb_info.pi_magic != LNET_PROTO_PING_MAGIC) {
CERROR("%s: Unexpected magic %08x\n",
- libcfs_id2str(id), pbuf->pb_info.pi_magic);
+ libcfs_id2str(id4), pbuf->pb_info.pi_magic);
goto fail_ping_buffer_decref;
}
if ((pbuf->pb_info.pi_features & LNET_PING_FEAT_NI_STATUS) == 0) {
CERROR("%s: ping w/o NI status: 0x%x\n",
- libcfs_id2str(id), pbuf->pb_info.pi_features);
+ libcfs_id2str(id4), pbuf->pb_info.pi_features);
goto fail_ping_buffer_decref;
}
if (nob < LNET_PING_INFO_SIZE(0)) {
CERROR("%s: Short reply %d(%d min)\n",
- libcfs_id2str(id),
+ libcfs_id2str(id4),
nob, (int)LNET_PING_INFO_SIZE(0));
goto fail_ping_buffer_decref;
}
if (nob < LNET_PING_INFO_SIZE(n_ids)) {
CERROR("%s: Short reply %d(%d expected)\n",
- libcfs_id2str(id),
+ libcfs_id2str(id4),
nob, (int)LNET_PING_INFO_SIZE(n_ids));
goto fail_ping_buffer_decref;
}
void *user_data, lnet_handler_t handler, bool recovery)
{
struct lnet_md md = { NULL };
- struct lnet_process_id id;
+ struct lnet_processid id;
struct lnet_ping_buffer *pbuf;
int rc;
goto fail_error;
}
id.pid = LNET_PID_LUSTRE;
- id.nid = lnet_nid_to_nid4(dest_nid);
+ id.nid = *dest_nid;
- rc = LNetGet(LNET_NID_ANY, *mdh, id,
+ rc = LNetGet(NULL, *mdh, &id,
LNET_RESERVED_PORTAL,
LNET_PROTO_PING_MATCHBITS, 0, recovery);
* \retval -ENOENT Invalid MD object.
*/
int
-LNetGet(lnet_nid_t self4, struct lnet_handle_md mdh,
- struct lnet_process_id target4, unsigned int portal,
+LNetGet(struct lnet_nid *self, struct lnet_handle_md mdh,
+ struct lnet_processid *target, unsigned int portal,
__u64 match_bits, unsigned int offset, bool recovery)
{
struct lnet_msg *msg;
struct lnet_rsp_tracker *rspt;
int cpt;
int rc;
- struct lnet_nid self;
- struct lnet_processid target;
LASSERT(the_lnet.ln_refcount > 0);
- lnet_nid4_to_nid(self4, &self);
- lnet_nid4_to_nid(target4.nid, &target.nid);
- target.pid = target4.pid;
-
if (!list_empty(&the_lnet.ln_test_peers) && /* normally we don't */
- fail_peer(&target.nid, 1)) /* shall we now? */
+ fail_peer(&target->nid, 1)) /* shall we now? */
{
CERROR("Dropping GET to %s: simulated failure\n",
- libcfs_id2str(target4));
+ libcfs_idstr(target));
return -EIO;
}
msg = lnet_msg_alloc();
if (!msg) {
CERROR("Dropping GET to %s: ENOMEM on struct lnet_msg\n",
- libcfs_id2str(target4));
+ libcfs_idstr(target));
return -ENOMEM;
}
rspt = lnet_rspt_alloc(cpt);
if (!rspt) {
CERROR("Dropping GET to %s: ENOMEM on response tracker\n",
- libcfs_id2str(target4));
+ libcfs_idstr(target));
return -ENOMEM;
}
INIT_LIST_HEAD(&rspt->rspt_on_list);
md = lnet_handle2md(&mdh);
if (md == NULL || md->md_threshold == 0 || md->md_me != NULL) {
CERROR("Dropping GET (%llu:%d:%s): MD (%d) invalid\n",
- match_bits, portal, libcfs_id2str(target4),
+ match_bits, portal, libcfs_idstr(target),
md == NULL ? -1 : md->md_threshold);
if (md != NULL && md->md_me != NULL)
CERROR("REPLY MD also attached to portal %d\n",
return -ENOENT;
}
- CDEBUG(D_NET, "%s -> %s\n", __func__, libcfs_id2str(target4));
+ CDEBUG(D_NET, "%s -> %s\n", __func__, libcfs_idstr(target));
lnet_msg_attach_md(msg, md, 0, 0);
- lnet_prep_send(msg, LNET_MSG_GET, &target, 0, 0);
+ lnet_prep_send(msg, LNET_MSG_GET, target, 0, 0);
msg->msg_hdr.msg.get.match_bits = cpu_to_le64(match_bits);
msg->msg_hdr.msg.get.ptl_index = cpu_to_le32(portal);
else
lnet_rspt_free(rspt, cpt);
- rc = lnet_send(&self, msg, NULL);
+ rc = lnet_send(self, msg, NULL);
if (rc < 0) {
CNETERR("Error sending GET to %s: %d\n",
- libcfs_id2str(target4), rc);
+ libcfs_idstr(target), rc);
msg->msg_no_resend = true;
lnet_finalize(msg, rc);
}
} else {
LASSERT((options & LNET_MD_OP_GET) != 0);
- rc = LNetGet(self4, *mdh, peer4, portal, matchbits, 0, false);
+ rc = LNetGet(&self, *mdh, &peer, portal, matchbits, 0, false);
}
if (rc != 0) {
int ptlrpc_start_bulk_transfer(struct ptlrpc_bulk_desc *desc)
{
struct obd_export *exp = desc->bd_export;
- lnet_nid_t self_nid4;
struct lnet_nid self_nid;
- struct lnet_process_id peer_id4;
struct lnet_processid peer_id;
- int rc = 0;
- __u64 mbits;
- int posted_md;
+ int rc = 0;
+ __u64 mbits;
+ int posted_md;
int total_md;
struct lnet_md md;
ENTRY;
* request, so they are based on the route taken by the
* message.
*/
- self_nid4 = desc->bd_req->rq_self;
- peer_id4 = desc->bd_req->rq_source;
- lnet_nid4_to_nid(self_nid4, &self_nid);
- lnet_pid4_to_pid(peer_id4, &peer_id);
+ lnet_nid4_to_nid(desc->bd_req->rq_self, &self_nid);
+ lnet_pid4_to_pid(desc->bd_req->rq_source, &peer_id);
/* NB total length may be 0 for a read past EOF, so we send 0
* length bulks, since the client expects bulk events.
LNET_ACK_REQ, &peer_id,
desc->bd_portal, mbits, 0, 0);
else
- rc = LNetGet(self_nid4, desc->bd_mds[posted_md],
- peer_id4, desc->bd_portal,
+ rc = LNetGet(&self_nid, desc->bd_mds[posted_md],
+ &peer_id, desc->bd_portal,
mbits, 0, false);
posted_md++;
if (rc != 0) {
CERROR("%s: failed bulk transfer with %s:%u x%llu: "
"rc = %d\n", exp->exp_obd->obd_name,
- libcfs_id2str(peer_id4), desc->bd_portal,
+ libcfs_idstr(&peer_id), desc->bd_portal,
mbits, rc);
break;
}
CDEBUG(D_NET, "Transferring %u pages %u bytes via portal %d "
"id %s mbits %#llx-%#llx\n", desc->bd_iov_count,
- desc->bd_nob, desc->bd_portal, libcfs_id2str(peer_id4),
+ desc->bd_nob, desc->bd_portal, libcfs_idstr(&peer_id),
mbits - posted_md, mbits - 1);
RETURN(0);