return rc;
}
-static ssize_t lprocfs_fops_write(struct file *f, const char __user *buf, size_t size, loff_t *ppos)
+static ssize_t lprocfs_fops_write(struct file *f, const char __user *buf,
+ size_t size, loff_t *ppos)
{
struct proc_dir_entry *dp = PDE(f->f_dentry->d_inode);
int rc = -EIO;
#define flag2str(flag) \
if (imp->imp_##flag && max - len > 0) \
len += snprintf(str + len, max - len, " " #flag);
-
+
/**
* Append a space separated list of current set flags to str.
*/
-static int obd_import_flags2str(struct obd_import *imp, char *str,
+static int obd_import_flags2str(struct obd_import *imp, char *str,
int max)
{
int len = 0;
-
+
if (imp->imp_obd->obd_no_recov)
len += snprintf(str, max - len, " no_recov");
imp_state_name = ptlrpc_import_state_name(imp->imp_state);
*eof = 1;
- rc = snprintf(page, count,
+ rc = snprintf(page, count,
"import: %s\n"
" target: %s@%s\n"
" state: %s\n"
"%-10s : %ld, "DHMS_FMT" ago\n",
"last reply", imp->imp_last_reply_time, DHMS_VARS(&ts));
-
cur = at_get(&imp->imp_at.iat_net_latency);
worst = imp->imp_at.iat_net_latency.at_worst_ever;
worstt = imp->imp_at.iat_net_latency.at_worst_time;
lprocfs_nid_stats_clear_write_cb, &free_list);
while (!list_empty(&free_list)) {
- client_stat = list_entry(free_list.next, struct nid_stat, nid_list);
+ client_stat = list_entry(free_list.next, struct nid_stat,
+ nid_list);
list_del_init(&client_stat->nid_list);
lprocfs_free_client_stats(client_stat);
}
new_stat->nid_obd = exp->exp_obd;
new_stat->nid_exp_ref_count = 1; /* live in hash after destroy export */
- /* protect competitive add to list, not need locking on destroy */
- spin_lock(&obd->obd_nid_lock);
- list_add(&new_stat->nid_list, &obd->obd_nid_stats);
- spin_unlock(&obd->obd_nid_lock);
-
old_stat = lustre_hash_findadd_unique(obd->obd_nid_stats_hash,
nid, &new_stat->nid_hash);
CDEBUG(D_INFO, "Found stats %p for nid %s - ref %d\n",
exp->exp_nid_stats = new_stat;
*newnid = 1;
+ /* protect competitive add to list, not need locking on destroy */
+ spin_lock(&obd->obd_nid_lock);
+ list_add(&new_stat->nid_list, &obd->obd_nid_stats);
+ spin_unlock(&obd->obd_nid_lock);
+
RETURN(rc);
destroy_new_ns:
OBD_FREE_PTR(new_ns_uuid);
destroy_new:
- spin_lock(&obd->obd_nid_lock);
- list_del(&new_stat->nid_list);
- spin_unlock(&obd->obd_nid_lock);
OBD_FREE_PTR(new_stat);
RETURN(rc);
}
found = 1;
list_del(&cursor->ns_uuid_list);
OBD_FREE_PTR(cursor);
+ --stat->nid_exp_ref_count;
+ CDEBUG(D_INFO, "Put stat %p - %d\n", stat,
+ stat->nid_exp_ref_count);
break;
}
}
CERROR("obd_export's client uuid %s are not found in its "
"nid_stats list\n", exp->exp_client_uuid.uuid);
- stat->nid_exp_ref_count--;
- CDEBUG(D_INFO, "Put stat %p - %d\n", stat, stat->nid_exp_ref_count);
-
exp->exp_nid_stats = NULL;
lprocfs_free_md_stats(exp->exp_obd);
return 0;
}
-int lprocfs_read_frac_helper(char *buffer, unsigned long count, long val, int mult)
+int lprocfs_read_frac_helper(char *buffer, unsigned long count, long val,
+ int mult)
{
long decimal_val, frac_val;
int prtn;