return proc;
}
-
-static ssize_t lprocfs_fops_read(struct file *f, char __user *buf, size_t size, loff_t *ppos)
+static ssize_t lprocfs_fops_read(struct file *f, char __user *buf, size_t size,
+ loff_t *ppos)
{
struct proc_dir_entry *dp = PDE(f->f_dentry->d_inode);
char *page, *start = NULL;
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;
return;
}
-
int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
unsigned long count, void *data)
{
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);
}
CFS_INIT_LIST_HEAD(&new_stat->nid_uuid_list);
new_stat->nid = *nid;
new_stat->nid_obd = exp->exp_obd;
- new_stat->nid_exp_ref_count = 1; /* need 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);
+ /* need live in hash after destroy export */
+ new_stat->nid_exp_ref_count = 1;
old_stat = lustre_hash_findadd_unique(obd->obd_nid_stats_hash,
nid, &new_stat->nid_hash);
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_stats(&exp->exp_ops_stats);
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;
temp_frac = frac_val * 10;
buffer[prtn++] = '.';
- while (frac_bits < 2 && (temp_frac / mult) < 1 ) { /*only reserved 2bits fraction*/
+ while (frac_bits < 2 && (temp_frac / mult) < 1 ) {
+ /*only reserved 2bits fraction*/
buffer[prtn++] ='0';
temp_frac *= 10;
frac_bits++;
obd->obd_recovery_end -
obd->obd_recovery_start) <= 0)
goto out;
- if (lprocfs_obd_snprintf(&page, size, &len,"delayed_clients: %d/%d\n",
+ if (lprocfs_obd_snprintf(&page, size, &len,
+ "delayed_clients: %d/%d\n",
obd->obd_delayed_clients,
obd->obd_max_recoverable_clients) <= 0)
goto out;
}
EXPORT_SYMBOL(lprocfs_obd_wr_flush_stale_exports);
-
EXPORT_SYMBOL(lprocfs_register);
EXPORT_SYMBOL(lprocfs_srch);
EXPORT_SYMBOL(lprocfs_remove);