Whamcloud - gitweb
b=23094 add layout lock connect flag
[fs/lustre-release.git] / lustre / obdclass / lprocfs_status.c
index 5463e77..da3410f 100644 (file)
@@ -26,7 +26,7 @@
  * 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.
  */
 /*
@@ -766,7 +766,9 @@ static const char *obd_connect_names[] = {
         "pools",
         "grant_shrink",
         "skip_orphan",
+        "large_ea",
         "full20",
+        "layout_lock",
         NULL
 };
 
@@ -793,6 +795,7 @@ int lprocfs_rd_import(char *page, char **start, off_t off, int count,
         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);
@@ -804,12 +807,10 @@ int lprocfs_rd_import(char *page, char **start, off_t off, int count,
                      "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,
@@ -822,9 +823,22 @@ int lprocfs_rd_import(char *page, char **start, off_t off, int count,
         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));
@@ -1802,7 +1816,7 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
                 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);