* 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.
*/
/*
if (page == NULL)
return -ENOMEM;
- if (LPROCFS_ENTRY_AND_CHECK(dp))
- return -ENOENT;
+ if (LPROCFS_ENTRY_AND_CHECK(dp)) {
+ rc = -ENOENT;
+ goto out;
+ }
OBD_FAIL_TIMEOUT(OBD_FAIL_LPROC_REMOVE, 10);
if (dp->read_proc)
int *eof, void *data)
{
struct obd_statfs osfs;
- int rc = obd_statfs(data, &osfs, cfs_time_current_64() - CFS_HZ,
+ int rc = obd_statfs(data, &osfs,
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
OBD_STATFS_NODELAY);
if (!rc) {
*eof = 1;
int *eof, void *data)
{
struct obd_statfs osfs;
- int rc = obd_statfs(data, &osfs, cfs_time_current_64() - CFS_HZ,
+ int rc = obd_statfs(data, &osfs,
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
OBD_STATFS_NODELAY);
if (!rc) {
__u32 blk_size = osfs.os_bsize >> 10;
int *eof, void *data)
{
struct obd_statfs osfs;
- int rc = obd_statfs(data, &osfs, cfs_time_current_64() - CFS_HZ,
+ int rc = obd_statfs(data, &osfs,
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
OBD_STATFS_NODELAY);
if (!rc) {
__u32 blk_size = osfs.os_bsize >> 10;
int *eof, void *data)
{
struct obd_statfs osfs;
- int rc = obd_statfs(data, &osfs, cfs_time_current_64() - CFS_HZ,
+ int rc = obd_statfs(data, &osfs,
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
OBD_STATFS_NODELAY);
if (!rc) {
__u32 blk_size = osfs.os_bsize >> 10;
int *eof, void *data)
{
struct obd_statfs osfs;
- int rc = obd_statfs(data, &osfs, cfs_time_current_64() - CFS_HZ,
+ int rc = obd_statfs(data, &osfs,
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
OBD_STATFS_NODELAY);
if (!rc) {
*eof = 1;
int *eof, void *data)
{
struct obd_statfs osfs;
- int rc = obd_statfs(data, &osfs, cfs_time_current_64() - CFS_HZ,
+ int rc = obd_statfs(data, &osfs,
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
OBD_STATFS_NODELAY);
if (!rc) {
*eof = 1;
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));
}
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_wr_recovery_time_hard);
+int lprocfs_obd_rd_mntdev(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct obd_device *obd = (struct obd_device *)data;
+
+ LASSERT(obd != NULL);
+ LASSERT(obd->u.obt.obt_vfsmnt->mnt_devname);
+ *eof = 1;
+ return snprintf(page, count, "%s\n",
+ obd->u.obt.obt_vfsmnt->mnt_devname);
+}
+EXPORT_SYMBOL(lprocfs_obd_rd_mntdev);
+
EXPORT_SYMBOL(lprocfs_register);
EXPORT_SYMBOL(lprocfs_srch);
EXPORT_SYMBOL(lprocfs_remove);