Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / ptlrpc / sec_lproc.c
index 77c7cf4..df81d9c 100644 (file)
@@ -2,6 +2,7 @@
  * vim:expandtab:shiftwidth=8:tabstop=8:
  *
  * Copyright (C) 2006 Cluster File Systems, Inc.
+ *   Author: Eric Mei <ericm@clusterfs.com>
  *
  *   This file is part of Lustre, http://www.lustre.org.
  *
@@ -70,10 +71,8 @@ int sptlrpc_lprocfs_rd(char *page, char **start, off_t off, int count,
         struct obd_device        *obd = data;
         struct sec_flavor_config *conf = &obd->u.cli.cl_sec_conf;
         struct ptlrpc_sec        *sec = NULL;
-        struct ptlrpc_cli_ctx    *ctx;
-        struct hlist_node        *pos, *next;
         char                      flags_str[32];
-        int                       written, i;
+        int                       written;
 
         if (obd == NULL)
                 return 0;
@@ -99,7 +98,6 @@ int sptlrpc_lprocfs_rd(char *page, char **start, off_t off, int count,
                         "bulk checksum:         %s\n"
                         "bulk encrypt:          %s\n"
                         "flags:                 %s\n"
-                        "ctx cache size         %u\n"
                         "ctx cache busy         %d\n"
                         "gc interval            %lu\n"
                         "gc next                %ld\n",
@@ -107,32 +105,16 @@ int sptlrpc_lprocfs_rd(char *page, char **start, off_t off, int count,
                         sptlrpc_bulk_csum_alg2name(conf->sfc_bulk_csum),
                         sptlrpc_bulk_priv_alg2name(conf->sfc_bulk_priv),
                         flags_str,
-                        sec->ps_ccache_size,
                         atomic_read(&sec->ps_busy),
                         sec->ps_gc_interval,
                         sec->ps_gc_interval ?
                                 sec->ps_gc_next - cfs_time_current_sec() : 0
                           );
-        /*
-         * list contexts
-         */
-        if (sec->ps_policy->sp_policy != SPTLRPC_POLICY_GSS)
-                goto out;
 
-        written += snprintf(page + written, count - written,
-                            "GSS contexts ==>\n");
-
-        spin_lock(&sec->ps_lock);
-        for (i = 0; i < sec->ps_ccache_size; i++) {
-                hlist_for_each_entry_safe(ctx, pos, next,
-                                          &sec->ps_ccache[i], cc_hash) {
-                        if (written >= count)
-                                break;
-                        written += sptlrpc_ctx_display(ctx, page + written,
-                                                       count - written);
-                }
+        if (sec->ps_policy->sp_cops->display) {
+                written += sec->ps_policy->sp_cops->display(
+                                        sec, page + written, count - written);
         }
-        spin_unlock(&sec->ps_lock);
 
 out:
         return written;