Whamcloud - gitweb
LU-8648 all: remove all Sun license and URL references
[fs/lustre-release.git] / lustre / ptlrpc / gss / lproc_gss.c
index 06d7cf7..6702531 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -96,25 +92,26 @@ void gss_stat_oos_record_svc(int phase, int replay)
 
 static int gss_proc_oos_seq_show(struct seq_file *m, void *v)
 {
-       return seq_printf(m, "seqwin:              %u\n"
-                         "backwin:             %u\n"
-                         "client fall behind seqwin\n"
-                         "  occurrence:        %d\n"
-                         "  max seq behind:    %d\n"
-                         "server replay detected:\n"
-                         "  phase 0:           %d\n"
-                         "  phase 1:           %d\n"
-                         "  phase 2:           %d\n"
-                         "server verify ok:\n"
-                         "  phase 2:           %d\n",
-                         GSS_SEQ_WIN_MAIN,
-                         GSS_SEQ_WIN_BACK,
-                         atomic_read(&gss_stat_oos.oos_cli_count),
-                         gss_stat_oos.oos_cli_behind,
-                         atomic_read(&gss_stat_oos.oos_svc_replay[0]),
-                         atomic_read(&gss_stat_oos.oos_svc_replay[1]),
-                         atomic_read(&gss_stat_oos.oos_svc_replay[2]),
-                         atomic_read(&gss_stat_oos.oos_svc_pass[2]));
+       seq_printf(m, "seqwin:             %u\n"
+                  "backwin:            %u\n"
+                  "client fall behind seqwin\n"
+                  "  occurrence:       %d\n"
+                  "  max seq behind:   %d\n"
+                  "server replay detected:\n"
+                  "  phase 0:          %d\n"
+                  "  phase 1:          %d\n"
+                  "  phase 2:          %d\n"
+                  "server verify ok:\n"
+                  "  phase 2:          %d\n",
+                  GSS_SEQ_WIN_MAIN,
+                  GSS_SEQ_WIN_BACK,
+                  atomic_read(&gss_stat_oos.oos_cli_count),
+                  gss_stat_oos.oos_cli_behind,
+                  atomic_read(&gss_stat_oos.oos_svc_replay[0]),
+                  atomic_read(&gss_stat_oos.oos_svc_replay[1]),
+                  atomic_read(&gss_stat_oos.oos_svc_replay[2]),
+                  atomic_read(&gss_stat_oos.oos_svc_pass[2]));
+       return 0;
 }
 LPROC_SEQ_FOPS_RO(gss_proc_oos);
 
@@ -136,7 +133,7 @@ static const struct file_operations gss_proc_secinit = {
        .write = gss_proc_write_secinit,
 };
 
-static struct lprocfs_seq_vars gss_lprocfs_vars[] = {
+static struct lprocfs_vars gss_lprocfs_vars[] = {
        { .name =       "replays",
          .fops =       &gss_proc_oos_fops      },
        { .name =       "init_channel",
@@ -154,28 +151,31 @@ static int gss_lk_debug_level = 1;
 
 static int gss_lk_proc_dl_seq_show(struct seq_file *m, void *v)
 {
-       return seq_printf(m, "%u\n", gss_lk_debug_level);
+       seq_printf(m, "%u\n", gss_lk_debug_level);
+       return 0;
 }
 
 static ssize_t
-gss_lk_proc_dl_seq_write(struct file *file, const char *buffer,
+gss_lk_proc_dl_seq_write(struct file *file, const char __user *buffer,
                                size_t count, loff_t *off)
 {
-        int     val, rc;
+       int rc;
+       __s64 val;
 
-        rc = lprocfs_write_helper(buffer, count, &val);
-        if (rc < 0)
-                return rc;
+       rc = lprocfs_str_to_s64(buffer, count, &val);
+       if (rc < 0)
+               return rc;
+
+       if (val < 0 || val > 4)
+               return -ERANGE;
 
-        if (val < 0 || val > 4)
-                return -ERANGE;
+       gss_lk_debug_level = val;
 
-        gss_lk_debug_level = val;
-        return count;
+       return count;
 }
 LPROC_SEQ_FOPS(gss_lk_proc_dl);
 
-static struct lprocfs_seq_vars gss_lk_lprocfs_vars[] = {
+static struct lprocfs_vars gss_lk_lprocfs_vars[] = {
        { .name =       "debug_level",
          .fops =       &gss_lk_proc_dl_fops    },
        { NULL }
@@ -200,16 +200,16 @@ int gss_init_lproc(void)
 
        spin_lock_init(&gss_stat_oos.oos_lock);
 
-       gss_proc_root = lprocfs_seq_register("gss", sptlrpc_proc_root,
-                                               gss_lprocfs_vars, NULL);
+       gss_proc_root = lprocfs_register("gss", sptlrpc_proc_root,
+                                        gss_lprocfs_vars, NULL);
        if (IS_ERR(gss_proc_root)) {
                rc = PTR_ERR(gss_proc_root);
                gss_proc_root = NULL;
                GOTO(out, rc);
        }
 
-       gss_proc_lk = lprocfs_seq_register("lgss_keyring", gss_proc_root,
-                                               gss_lk_lprocfs_vars, NULL);
+       gss_proc_lk = lprocfs_register("lgss_keyring", gss_proc_root,
+                                      gss_lk_lprocfs_vars, NULL);
        if (IS_ERR(gss_proc_lk)) {
                rc = PTR_ERR(gss_proc_lk);
                gss_proc_lk = NULL;