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 reconnect, int *newnid);
+ lnet_nid_t *peer_nid, int *newnid);
extern int lprocfs_exp_cleanup(struct obd_export *exp);
extern cfs_proc_dir_entry_t *lprocfs_add_simple(struct proc_dir_entry *root,
char *name,
static inline int lprocfs_add_clear_entry(struct obd_export *exp)
{ return 0; }
static inline int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *peer_nid,
- int reconnect, int *newnid)
+ int *newnid)
{ return 0; }
static inline int lprocfs_exp_cleanup(struct obd_export *exp)
{ return 0; }
rc = mds_connect_internal(exp, data);
if (rc == 0)
- mds_export_stats_init(obd, exp, 1, localdata);
+ mds_export_stats_init(obd, exp, localdata);
RETURN(rc);
}
#include "mds_internal.h"
-int mds_export_stats_init(struct obd_device *obd,
- struct obd_export *exp,
- int reconnect,
- void *localdata)
+int mds_export_stats_init(struct obd_device *obd, struct obd_export *exp,
+ void *localdata)
{
lnet_nid_t *client_nid = localdata;
int rc, num_stats, newnid = 0;
- rc = lprocfs_exp_setup(exp, client_nid, reconnect, &newnid);
+ rc = lprocfs_exp_setup(exp, client_nid, &newnid);
if (rc) {
/* Mask error for already created
* /proc entries */
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, 0, localdata);
+ mds_export_stats_init(obd, exp, localdata);
if (new_client) {
struct lvfs_run_ctxt *saved = NULL;
}
struct lsd_client_data zero_lcd; /* globals are implicitly zeroed */
-
+
int mds_client_free(struct obd_export *exp)
{
struct mds_export_data *med = &exp->exp_mds_data;
void mds_update_last_epoch(struct obd_device *obd);
int mds_export_stats_init(struct obd_device *obd,
struct obd_export *exp,
- int reconnect,
void *client_nid);
int mds_client_add(struct obd_device *obd, struct obd_export *exp,
int cl_off, void *localdata);
int mgs_export_stats_init(struct obd_device *obd,
struct obd_export *exp,
- int reconnect,
void *localdata)
{
lnet_nid_t *client_nid = localdata;
int rc, num_stats, newnid = 0;
- rc = lprocfs_exp_setup(exp, client_nid, reconnect, &newnid);
+ rc = lprocfs_exp_setup(exp, client_nid, &newnid);
if (rc) {
/* Mask error for already created
* /proc entries */
/* Remove client export data from the MGS */
int mgs_client_free(struct obd_export *exp)
{
- return 0;
+ return 0;
}
/* Same as mds_fid2dentry */
data->ocd_version = LUSTRE_VERSION_CODE;
}
- rc = mgs_export_stats_init(obd, exp, 0, localdata);
+ rc = mgs_export_stats_init(obd, exp, localdata);
if (rc) {
class_disconnect(exp);
} else {
data->ocd_version = LUSTRE_VERSION_CODE;
}
- RETURN(mgs_export_stats_init(obd, exp, 1, localdata));
+ RETURN(mgs_export_stats_init(obd, exp, localdata));
}
static int mgs_disconnect(struct obd_export *exp)
/* mgs_fs.c */
int mgs_export_stats_init(struct obd_device *obd, struct obd_export *exp,
- int reconnect, void *localdata);
+ void *localdata);
int mgs_client_free(struct obd_export *exp);
int mgs_fs_setup(struct obd_device *obd, struct vfsmount *mnt);
int mgs_fs_cleanup(struct obd_device *obddev);
client_stat->nid_brw_stats);
LASSERTF(atomic_read(&client_stat->nid_exp_ref_count) == 0,
- "count %d\n", atomic_read(&client_stat->nid_exp_ref_count));
+ "nid %s:count %d\n", libcfs_nid2str(client_stat->nid),
+ atomic_read(&client_stat->nid_exp_ref_count));
hlist_del_init(&client_stat->nid_hash);
}
EXPORT_SYMBOL(lprocfs_nid_stats_clear_write);
-int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int reconnect,
- int *newnid)
+int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
{
int rc = 0;
struct nid_stat *new_stat, *old_stat;
old_stat, libcfs_nid2str(*nid),
atomic_read(&new_stat->nid_exp_ref_count));
+ /* we need to release old stats because lprocfs_exp_cleanup() hasn't
+ * been and will never be called. */
+ if (exp->exp_nid_stats != NULL) {
+ nidstat_putref(exp->exp_nid_stats);
+ exp->exp_nid_stats = NULL;
+ }
+
/* Return -EALREADY here so that we know that the /proc
* entry already has been created */
if (old_stat != new_stat) {
- /* if this reconnect to live export from diffrent nid, we need
- * to release old stats because disconnect will be never called.
- * */
- if (reconnect && exp->exp_nid_stats)
- nidstat_putref(exp->exp_nid_stats);
-
exp->exp_nid_stats = old_stat;
GOTO(destroy_new, rc = -EALREADY);
}
plus the procfs overhead :( */
static int filter_export_stats_init(struct obd_device *obd,
struct obd_export *exp,
- int reconnect,
void *client_nid)
{
struct proc_dir_entry *brw_entry;
if (obd_uuid_equals(&exp->exp_client_uuid, &obd->obd_uuid))
/* Self-export gets no proc entry */
RETURN(0);
- rc = lprocfs_exp_setup(exp, (lnet_nid_t *)client_nid,
- reconnect, &newnid);
+ rc = lprocfs_exp_setup(exp, (lnet_nid_t *)client_nid, &newnid);
if (rc) {
/* Mask error for already created
* /proc entries */
} else {
fed = &exp->exp_filter_data;
fed->fed_lcd = lcd;
- filter_export_stats_init(obd, exp, 0, NULL);
+ 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);
LPU64" left: "LPU64"\n", exp->exp_obd->obd_name,
exp->exp_client_uuid.uuid, exp,
data->ocd_grant, want, left);
-
+
filter->fo_tot_granted_clients ++;
}
rc = filter_connect_internal(exp, data, 1);
if (rc == 0)
- filter_export_stats_init(obd, exp, 1, localdata);
+ filter_export_stats_init(obd, exp, localdata);
RETURN(rc);
}
if (rc)
GOTO(cleanup, rc);
- filter_export_stats_init(obd, exp, 0, localdata);
+ filter_export_stats_init(obd, exp, localdata);
if (!obd->obd_replayable)
GOTO(cleanup, rc = 0);
filter = &exp->exp_obd->u.filter;
push_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
- /*
+ /*
* We need to be atomic against a concurrent write
* (which takes the semaphore for reading). fmd_mactime_xid
* checks will have no effect if a write request with lower
oinfo->oi_policy.l_extent.end);
RETURN(-EFAULT);
}
-
+
CDEBUG(D_INODE, "calling truncate for object "LPU64", valid = "LPX64
", o_size = "LPD64"\n", oinfo->oi_oa->o_id,
oinfo->oi_oa->o_valid, oinfo->oi_policy.l_extent.start);