lmv->connected = 0;
lmv->conn_data = *data;
+ lmv->lmv_cache = localdata;
lmv->lmv_tgts_kobj = kobject_create_and_add("target_obds",
&obd->obd_kset.kobj);
}
rc = obd_connect(NULL, &mdc_exp, mdc_obd, &obd->obd_uuid,
- &lmv->conn_data, NULL);
+ &lmv->conn_data, lmv->lmv_cache);
if (rc) {
CERROR("target %s connect error %d\n", tgt->ltd_uuid.uuid, rc);
RETURN(rc);
if (remote_gf != NULL) {
struct getinfo_fid2path *ori_gf;
char *ptr;
+ int len;
ori_gf = (struct getinfo_fid2path *)karg;
if (strlen(ori_gf->gf_u.gf_path) + 1 +
ptr = ori_gf->gf_u.gf_path;
- memmove(ptr + strlen(gf->gf_u.gf_path) + 1, ptr,
- strlen(ori_gf->gf_u.gf_path));
-
- strncpy(ptr, gf->gf_u.gf_path,
- strlen(gf->gf_u.gf_path));
- ptr += strlen(gf->gf_u.gf_path);
- *ptr = '/';
+ len = strlen(gf->gf_u.gf_path);
+ /* move the current path to the right to release space
+ * for closer-to-root part */
+ memmove(ptr + len + 1, ptr, strlen(ori_gf->gf_u.gf_path));
+ memcpy(ptr, gf->gf_u.gf_path, len);
+ ptr[len] = '/';
}
CDEBUG(D_INFO, "%s: get path %s "DFID" rec: %llu ln: %u\n",
break;
if (LNET_NETTYP(LNET_NIDNET(lnet_id.nid)) != LOLND) {
+ /* We dont need a full 64-bit modulus, just enough
+ * to distribute the requests across MDTs evenly.
+ */
lmv->lmv_statfs_start =
- lnet_id.nid % lmv->desc.ld_tgt_count;
+ (u32)lnet_id.nid % lmv->desc.ld_tgt_count;
break;
}
}
rc = obd_statfs(env, lmv->tgts[idx]->ltd_exp, temp,
max_age, flags);
if (rc) {
- CERROR("can't stat MDS #%d (%s), error %d\n", i,
- lmv->tgts[idx]->ltd_exp->exp_obd->obd_name,
+ CERROR("%s: can't stat MDS #%d: rc = %d\n",
+ lmv->tgts[idx]->ltd_exp->exp_obd->obd_name, i,
rc);
GOTO(out_free_temp, rc);
}