extern int lprocfs_add_clear_entry(struct obd_device * obd,
cfs_proc_dir_entry_t *entry);
extern int lprocfs_exp_setup(struct obd_export *exp,
- lnet_nid_t peer_nid, int *newnid);
+ lnet_nid_t *peer_nid, int *newnid);
extern int lprocfs_exp_cleanup(struct obd_export *exp);
extern int lprocfs_add_simple(struct proc_dir_entry *root,
char *name, read_proc_t *read_proc,
struct obd_export;
static inline int lprocfs_add_clear_entry(struct obd_export *exp)
{ return 0; }
-static inline int lprocfs_exp_setup(struct obd_export *exp)
+static inline int lprocfs_exp_setup(struct obd_export *exp,
+ lnet_nid_t *peer_nid, int *newnid)
{ return 0; }
static inline int lprocfs_exp_cleanup(struct obd_export *exp)
{ return 0; }
int rc = 0;
int initial_conn = 0;
struct obd_connect_data *data, *tmpdata;
- lnet_nid_t client_nid = 0;
+ lnet_nid_t *client_nid = NULL;
ENTRY;
OBD_RACE(OBD_FAIL_TGT_CONN_RACE);
/* Tell the client if we support replayable requests */
if (target->obd_replayable)
lustre_msg_add_op_flags(req->rq_repmsg, MSG_CONNECT_REPLAYABLE);
- client_nid = req->rq_peer.nid;
+ client_nid = &req->rq_peer.nid;
if (export == NULL) {
if (target->obd_recovering) {
dont_check_exports:
rc = obd_connect(req->rq_svc_thread->t_env,
&conn, target, &cluuid, data,
- &client_nid);
+ client_nid);
}
} else {
rc = obd_reconnect(req->rq_svc_thread->t_env,
struct obd_export *exp;
struct mds_export_data *med;
struct mds_client_data *mcd = NULL;
- lnet_nid_t *client_nid = (lnet_nid_t *)localdata;
int rc;
ENTRY;
memcpy(mcd->mcd_uuid, cluuid, sizeof(mcd->mcd_uuid));
med->med_mcd = mcd;
- rc = mds_client_add(obd, exp, -1, *client_nid);
+ rc = mds_client_add(obd, exp, -1, localdata);
GOTO(out, rc);
out:
static int mds_export_stats_init(struct obd_device *obd,
struct obd_export *exp,
- lnet_nid_t client_nid)
+ void *localdata)
{
int rc, num_stats, newnid;
- rc = lprocfs_exp_setup(exp, client_nid, &newnid);
+
+ rc = lprocfs_exp_setup(exp, localdata, &newnid);
if (rc)
return rc;
- if (client_nid && newnid) {
+ if (newnid) {
struct nid_stat *tmp = exp->exp_nid_stats;
LASSERT(tmp != NULL);
num_stats = (sizeof(*obd->obd_type->typ_dt_ops) / sizeof(void *)) +
* mds_init_server_data() callsite needs to be fixed.
*/
int mds_client_add(struct obd_device *obd, struct obd_export *exp,
- int cl_idx, lnet_nid_t client_nid)
+ int cl_idx, void *localdata)
{
struct mds_obd *mds = &obd->u.mds;
struct mds_export_data *med = &exp->exp_mds_data;
med->med_lr_off = le32_to_cpu(mds->mds_server_data->lsd_client_start) +
(cl_idx * le16_to_cpu(mds->mds_server_data->lsd_client_size));
LASSERTF(med->med_lr_off > 0, "med_lr_off = %llu\n", med->med_lr_off);
- mds_export_stats_init(obd, exp, client_nid);
+ mds_export_stats_init(obd, exp, localdata);
if (new_client) {
struct lvfs_run_ctxt saved;
} else {
med = &exp->exp_mds_data;
med->med_mcd = mcd;
- rc = mds_client_add(obd, exp, cl_idx, 0);
+ rc = mds_client_add(obd, exp, cl_idx, NULL);
LASSERTF(rc == 0, "rc = %d\n", rc); /* can't fail existing */
mcd = NULL;
/* mds/mds_fs.c */
int mds_client_add(struct obd_device *obd, struct obd_export *exp,
- int cl_off, lnet_nid_t client_nid);
+ int cl_off, void *localdata);
int mds_client_free(struct obd_export *exp);
int mds_obd_create(struct obd_export *exp, struct obdo *oa,
struct lov_stripe_md **ea, struct obd_trans_info *oti);
}
EXPORT_SYMBOL(lprocfs_nid_stats_clear_write);
-int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t nid, int *newnid)
+int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
{
int rc = 0;
struct nid_stat *tmp = NULL, *tmp1;
!exp->exp_obd->obd_nid_stats_hash_body)
RETURN(-EINVAL);
- if (!nid)
+ /* not test against zero because eric say:
+ * You may only test nid against another nid, or LNET_NID_ANY. Anything else is
+ * nonsense.*/
+ if (!nid || *nid == LNET_NID_ANY)
RETURN(0);
obd = exp->exp_obd;
if (tmp == NULL)
RETURN(-ENOMEM);
- tmp->nid = nid;
+ tmp->nid = *nid;
tmp->nid_obd = exp->exp_obd;
tmp->nid_exp_ref_count = 1; /* need live in hash after destroy export */
- tmp1= lustre_hash_findadd_unique(obd->obd_nid_stats_hash_body, &nid,
+ tmp1= lustre_hash_findadd_unique(obd->obd_nid_stats_hash_body, nid,
&tmp->nid_hash);
CDEBUG(D_INFO, "Found stats %p for nid %s - ref %d\n",
- tmp1, libcfs_nid2str(nid), tmp->nid_exp_ref_count);
+ tmp1, libcfs_nid2str(*nid), tmp->nid_exp_ref_count);
if (tmp1 != tmp) {
exp->exp_nid_stats = tmp1;
GOTO(destroy_new, rc = 0);
}
/* not found - create */
- tmp->nid_proc = proc_mkdir(libcfs_nid2str(nid),
+ tmp->nid_proc = proc_mkdir(libcfs_nid2str(*nid),
obd->obd_proc_exports_entry);
if (!tmp->nid_proc) {
CERROR("Error making export directory for"
- " nid %s\n", libcfs_nid2str(nid));
- lustre_hash_delitem(obd->obd_nid_stats_hash_body, &nid,
+ " nid %s\n", libcfs_nid2str(*nid));
+ lustre_hash_delitem(obd->obd_nid_stats_hash_body, nid,
&tmp->nid_hash);
GOTO(destroy_new, rc = -ENOMEM);
}
plus the procfs overhead :( */
static int filter_export_stats_init(struct obd_device *obd,
struct obd_export *exp,
- lnet_nid_t client_nid)
+ void *client_nid)
{
struct filter_export_data *fed = &exp->exp_filter_data;
struct proc_dir_entry *brw_entry;
if (rc)
RETURN(rc);
- if (client_nid && newnid) {
+ if (newnid) {
struct nid_stat *tmp = exp->exp_nid_stats;
LASSERT(tmp != NULL);
* Otherwise, we have just read the data from the last_rcvd file and
* we know its offset. */
static int filter_client_add(struct obd_device *obd, struct obd_export *exp,
- int cl_idx, lnet_nid_t client_nid)
+ int cl_idx)
{
struct filter_obd *filter = &obd->u.filter;
struct filter_export_data *fed = &exp->exp_filter_data;
fed = &exp->exp_filter_data;
fed->fed_fcd = fcd;
fed->fed_group = le32_to_cpu(fcd->fcd_group);
- filter_export_stats_init(obd, exp, 0);
- rc = filter_client_add(obd, exp, cl_idx, 0);
+ filter_export_stats_init(obd, exp, NULL);
+ rc = filter_client_add(obd, exp, cl_idx);
/* can't fail for existing client */
LASSERTF(rc == 0, "rc = %d\n", rc);
struct obd_export *exp;
struct filter_export_data *fed;
struct filter_client_data *fcd = NULL;
- lnet_nid_t client_nid;
__u32 group;
int rc;
ENTRY;
if (conn == NULL || obd == NULL || cluuid == NULL)
RETURN(-EINVAL);
- if (localdata != NULL)
- client_nid = *(lnet_nid_t *)localdata;
- else
- client_nid = 0ULL;
-
-
rc = class_connect(conn, obd, cluuid);
if (rc)
RETURN(rc);
if (rc)
GOTO(cleanup, rc);
- filter_export_stats_init(obd, exp, client_nid);
+ filter_export_stats_init(obd, exp, localdata);
group = data->ocd_group;
if (obd->obd_replayable) {
OBD_ALLOC(fcd, sizeof(*fcd));
memcpy(fcd->fcd_uuid, cluuid, sizeof(fcd->fcd_uuid));
fed->fed_fcd = fcd;
fed->fed_fcd->fcd_group = group;
- rc = filter_client_add(obd, exp, -1, client_nid);
+ rc = filter_client_add(obd, exp, -1);
if (rc)
GOTO(cleanup, rc);
}