* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
flag2str(deactive);
flag2str(replayable);
flag2str(pingable);
- flag2str(recon_bk);
- flag2str(last_recon);
return len;
}
#undef flags2str
"pools",
"grant_shrink",
"skip_orphan",
+ "large_ea",
+ "full20",
+ "layout_lock",
NULL
};
struct lprocfs_counter ret;
struct obd_device *obd = (struct obd_device *)data;
struct obd_import *imp;
+ struct obd_import_conn *conn;
int i, j, k, rw = 0;
LASSERT(obd != NULL);
"import:\n"
" name: %s\n"
" target: %s\n"
- " current_connection: %s\n"
" state: %s\n"
" connect_flags: [",
obd->obd_name,
obd2cli_tgt(obd),
- imp->imp_connection->c_remote_uuid.uuid,
ptlrpc_import_state_name(imp->imp_state));
i += obd_connect_flags2str(page + i, count - i,
imp->imp_connect_data.ocd_connect_flags,
i += snprintf(page + i, count - i,
"]\n"
" connection:\n"
+ " failover_nids: [");
+ cfs_spin_lock(&imp->imp_lock);
+ j = 0;
+ cfs_list_for_each_entry(conn, &imp->imp_conn_list, oic_item) {
+ i += snprintf(page + i, count - i, "%s%s", j ? ", " : "",
+ libcfs_nid2str(conn->oic_conn->c_peer.nid));
+ j++;
+ }
+ cfs_spin_unlock(&imp->imp_lock);
+ i += snprintf(page + i, count - i,
+ "]\n"
+ " current_connection: %s\n"
" connection_attempts: %u\n"
" generation: %u\n"
" in-progress_invalidations: %u\n",
+ libcfs_nid2str(imp->imp_connection->c_peer.nid),
imp->imp_conn_cnt,
imp->imp_generation,
cfs_atomic_read(&imp->imp_inval_count));
lprocfs_stats_collect(obd->obd_svc_stats, PTLRPC_REQWAIT_CNTR, &ret);
- do_div(ret.lc_sum, ret.lc_count);
+ if (ret.lc_count != 0)
+ do_div(ret.lc_sum, ret.lc_count);
+ else
+ ret.lc_sum = 0;
i += snprintf(page + i, count - i,
" rpcs:\n"
" inflight: %u\n"
lprocfs_stats_collect(obd->obd_svc_stats,
PTLRPC_LAST_CNTR + BRW_READ_BYTES + rw,
&ret);
- if (ret.lc_sum > 0) {
+ if (ret.lc_sum > 0 && ret.lc_count > 0) {
do_div(ret.lc_sum, ret.lc_count);
i += snprintf(page + i, count - i,
" %s_data_averages:\n"
k = (int)ret.lc_sum;
j = opcode_offset(OST_READ + rw) + EXTRA_MAX_OPCODES;
lprocfs_stats_collect(obd->obd_svc_stats, j, &ret);
- if (ret.lc_sum > 0) {
+ if (ret.lc_sum > 0 && ret.lc_count != 0) {
do_div(ret.lc_sum, ret.lc_count);
i += snprintf(page + i, count - i,
" %s_per_rpc: "LPU64"\n",
}
EXPORT_SYMBOL(lprocfs_nid_stats_clear_read);
-void lprocfs_nid_stats_clear_write_cb(void *obj, void *data)
+int lprocfs_nid_stats_clear_write_cb(void *obj, void *data)
{
struct nid_stat *stat = obj;
int i;
* add/delete blocked by hash bucket lock */
CDEBUG(D_INFO,"refcnt %d\n", cfs_atomic_read(&stat->nid_exp_ref_count));
if (cfs_atomic_read(&stat->nid_exp_ref_count) == 2) {
- cfs_hlist_del_init(&stat->nid_hash);
- nidstat_putref(stat);
cfs_spin_lock(&stat->nid_obd->obd_nid_lock);
cfs_list_move(&stat->nid_list, data);
cfs_spin_unlock(&stat->nid_obd->obd_nid_lock);
- EXIT;
- return;
+ RETURN(1);
}
/* we has reference to object - only clear data*/
if (stat->nid_stats)
for (i = 0; i < BRW_LAST; i++)
lprocfs_oh_clear(&stat->nid_brw_stats->hist[i]);
}
- EXIT;
- return;
+ RETURN(0);
}
int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
struct nid_stat *client_stat;
CFS_LIST_HEAD(free_list);
- cfs_hash_for_each(obd->obd_nid_stats_hash,
+ cfs_hash_cond_del(obd->obd_nid_stats_hash,
lprocfs_nid_stats_clear_write_cb, &free_list);
while (!cfs_list_empty(&free_list)) {
GOTO(destroy_new, rc = -ENOMEM);
memcpy(buffer, libcfs_nid2str(*nid), LNET_NIDSTR_SIZE);
- new_stat->nid_proc = lprocfs_register(buffer,
+ new_stat->nid_proc = lprocfs_register(buffer,
obd->obd_proc_exports_entry,
NULL, NULL);
OBD_FREE(buffer, LNET_NIDSTR_SIZE);
}
EXPORT_SYMBOL(lprocfs_obd_rd_recovery_status);
-int lprocfs_obd_rd_recovery_maxtime(char *page, char **start, off_t off,
- int count, int *eof, void *data)
+int lprocfs_obd_rd_recovery_time_soft(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct obd_device *obd = (struct obd_device *)data;
+ LASSERT(obd != NULL);
+
+ return snprintf(page, count, "%d\n",
+ obd->obd_recovery_timeout);
+}
+EXPORT_SYMBOL(lprocfs_obd_rd_recovery_time_soft);
+
+int lprocfs_obd_wr_recovery_time_soft(struct file *file, const char *buffer,
+ unsigned long count, void *data)
+{
+ struct obd_device *obd = (struct obd_device *)data;
+ int val, rc;
+ LASSERT(obd != NULL);
+
+ rc = lprocfs_write_helper(buffer, count, &val);
+ if (rc)
+ return rc;
+
+ obd->obd_recovery_timeout = val;
+ return count;
+}
+EXPORT_SYMBOL(lprocfs_obd_wr_recovery_time_soft);
+
+int lprocfs_obd_rd_recovery_time_hard(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
{
struct obd_device *obd = data;
LASSERT(obd != NULL);
- return snprintf(page, count, "%lu\n", obd->obd_recovery_max_time);
+ return snprintf(page, count, "%lu\n", obd->obd_recovery_time_hard);
}
-EXPORT_SYMBOL(lprocfs_obd_rd_recovery_maxtime);
+EXPORT_SYMBOL(lprocfs_obd_rd_recovery_time_hard);
-int lprocfs_obd_wr_recovery_maxtime(struct file *file, const char *buffer,
- unsigned long count, void *data)
+int lprocfs_obd_wr_recovery_time_hard(struct file *file, const char *buffer,
+ unsigned long count, void *data)
{
struct obd_device *obd = data;
int val, rc;
if (rc)
return rc;
- obd->obd_recovery_max_time = val;
+ obd->obd_recovery_time_hard = val;
return count;
}
-EXPORT_SYMBOL(lprocfs_obd_wr_recovery_maxtime);
-
+EXPORT_SYMBOL(lprocfs_obd_wr_recovery_time_hard);
EXPORT_SYMBOL(lprocfs_register);
EXPORT_SYMBOL(lprocfs_srch);