Whamcloud - gitweb
LU-9855 lustre: rename obd_device variables to obd
[fs/lustre-release.git] / lustre / ptlrpc / sec_lproc.c
index e3d99ac..fdce982 100644 (file)
@@ -69,16 +69,16 @@ static char *sec_flags2str(unsigned long flags, char *buf, int bufsize)
 
 static int sptlrpc_info_lprocfs_seq_show(struct seq_file *seq, void *v)
 {
-        struct obd_device *dev = seq->private;
-        struct client_obd *cli = &dev->u.cli;
-        struct ptlrpc_sec *sec = NULL;
-        char               str[32];
+       struct obd_device *obd = seq->private;
+       struct client_obd *cli = &obd->u.cli;
+       struct ptlrpc_sec *sec = NULL;
+       char               str[32];
 
-       LASSERT(strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 ||
-               strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 ||
-               strcmp(dev->obd_type->typ_name, LUSTRE_MGC_NAME) == 0 ||
-               strcmp(dev->obd_type->typ_name, LUSTRE_LWP_NAME) == 0 ||
-               strcmp(dev->obd_type->typ_name, LUSTRE_OSP_NAME) == 0);
+       LASSERT(strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 ||
+               strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 ||
+               strcmp(obd->obd_type->typ_name, LUSTRE_MGC_NAME) == 0 ||
+               strcmp(obd->obd_type->typ_name, LUSTRE_LWP_NAME) == 0 ||
+               strcmp(obd->obd_type->typ_name, LUSTRE_OSP_NAME) == 0);
 
         if (cli->cl_import)
                 sec = sptlrpc_import_sec_ref(cli->cl_import);
@@ -111,15 +111,15 @@ LPROC_SEQ_FOPS_RO(sptlrpc_info_lprocfs);
 
 static int sptlrpc_ctxs_lprocfs_seq_show(struct seq_file *seq, void *v)
 {
-        struct obd_device *dev = seq->private;
-        struct client_obd *cli = &dev->u.cli;
-        struct ptlrpc_sec *sec = NULL;
+       struct obd_device *obd = seq->private;
+       struct client_obd *cli = &obd->u.cli;
+       struct ptlrpc_sec *sec = NULL;
 
-       LASSERT(strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 ||
-               strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 ||
-               strcmp(dev->obd_type->typ_name, LUSTRE_MGC_NAME) == 0 ||
-               strcmp(dev->obd_type->typ_name, LUSTRE_LWP_NAME) == 0 ||
-               strcmp(dev->obd_type->typ_name, LUSTRE_OSP_NAME) == 0);
+       LASSERT(strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 ||
+               strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 ||
+               strcmp(obd->obd_type->typ_name, LUSTRE_MGC_NAME) == 0 ||
+               strcmp(obd->obd_type->typ_name, LUSTRE_LWP_NAME) == 0 ||
+               strcmp(obd->obd_type->typ_name, LUSTRE_OSP_NAME) == 0);
 
         if (cli->cl_import)
                 sec = sptlrpc_import_sec_ref(cli->cl_import);
@@ -141,8 +141,8 @@ lprocfs_sptlrpc_sepol_seq_write(struct file *file, const char __user *buffer,
                                size_t count, void *data)
 {
        struct seq_file *seq = file->private_data;
-       struct obd_device *dev = seq->private;
-       struct client_obd *cli = &dev->u.cli;
+       struct obd_device *obd = seq->private;
+       struct client_obd *cli = &obd->u.cli;
        struct obd_import *imp = cli->cl_import;
        struct sepol_downcall_data *param;
        int size = sizeof(*param);
@@ -150,7 +150,7 @@ lprocfs_sptlrpc_sepol_seq_write(struct file *file, const char __user *buffer,
 
        if (count < size) {
                CERROR("%s: invalid data count = %lu, size = %d\n",
-                      dev->obd_name, (unsigned long) count, size);
+                      obd->obd_name, (unsigned long) count, size);
                return -EINVAL;
        }
 
@@ -159,20 +159,20 @@ lprocfs_sptlrpc_sepol_seq_write(struct file *file, const char __user *buffer,
                return -ENOMEM;
 
        if (copy_from_user(param, buffer, size)) {
-               CERROR("%s: bad sepol data\n", dev->obd_name);
+               CERROR("%s: bad sepol data\n", obd->obd_name);
                GOTO(out, rc = -EFAULT);
        }
 
        if (param->sdd_magic != SEPOL_DOWNCALL_MAGIC) {
                CERROR("%s: sepol downcall bad params\n",
-                      dev->obd_name);
+                      obd->obd_name);
                GOTO(out, rc = -EINVAL);
        }
 
        if (param->sdd_sepol_len == 0 ||
            param->sdd_sepol_len >= sizeof(imp->imp_sec->ps_sepol)) {
                CERROR("%s: invalid sepol data returned\n",
-                      dev->obd_name);
+                      obd->obd_name);
                GOTO(out, rc = -EINVAL);
        }
        rc = param->sdd_sepol_len; /* save sdd_sepol_len */
@@ -187,7 +187,7 @@ lprocfs_sptlrpc_sepol_seq_write(struct file *file, const char __user *buffer,
                return -ENOMEM;
 
        if (copy_from_user(param, buffer, size)) {
-               CERROR("%s: bad sepol data\n", dev->obd_name);
+               CERROR("%s: bad sepol data\n", obd->obd_name);
                GOTO(out, rc = -EFAULT);
        }
 
@@ -205,41 +205,41 @@ out:
 }
 LPROC_SEQ_FOPS_WR_ONLY(srpc, sptlrpc_sepol);
 
-int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev)
+int sptlrpc_lprocfs_cliobd_attach(struct obd_device *obd)
 {
        int     rc;
 
-       if (strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) != 0 &&
-           strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) != 0 &&
-           strcmp(dev->obd_type->typ_name, LUSTRE_MGC_NAME) != 0 &&
-           strcmp(dev->obd_type->typ_name, LUSTRE_LWP_NAME) != 0 &&
-           strcmp(dev->obd_type->typ_name, LUSTRE_OSP_NAME) != 0) {
+       if (strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) != 0 &&
+           strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) != 0 &&
+           strcmp(obd->obd_type->typ_name, LUSTRE_MGC_NAME) != 0 &&
+           strcmp(obd->obd_type->typ_name, LUSTRE_LWP_NAME) != 0 &&
+           strcmp(obd->obd_type->typ_name, LUSTRE_OSP_NAME) != 0) {
                CERROR("can't register lproc for obd type %s\n",
-                      dev->obd_type->typ_name);
+                      obd->obd_type->typ_name);
                return -EINVAL;
        }
 
-       rc = ldebugfs_seq_create(dev->obd_debugfs_entry, "srpc_info", 0444,
-                                &sptlrpc_info_lprocfs_fops, dev);
+       rc = ldebugfs_seq_create(obd->obd_debugfs_entry, "srpc_info", 0444,
+                                &sptlrpc_info_lprocfs_fops, obd);
        if (rc) {
                CERROR("create proc entry srpc_info for %s: %d\n",
-                      dev->obd_name, rc);
+                      obd->obd_name, rc);
                return rc;
        }
 
-       rc = ldebugfs_seq_create(dev->obd_debugfs_entry, "srpc_contexts",
-                                0444, &sptlrpc_ctxs_lprocfs_fops, dev);
+       rc = ldebugfs_seq_create(obd->obd_debugfs_entry, "srpc_contexts",
+                                0444, &sptlrpc_ctxs_lprocfs_fops, obd);
        if (rc) {
                CERROR("create proc entry srpc_contexts for %s: %d\n",
-                      dev->obd_name, rc);
+                      obd->obd_name, rc);
                return rc;
        }
 
-       rc = ldebugfs_seq_create(dev->obd_debugfs_entry, "srpc_sepol",
-                                0200, &srpc_sptlrpc_sepol_fops, dev);
+       rc = ldebugfs_seq_create(obd->obd_debugfs_entry, "srpc_sepol",
+                                0200, &srpc_sptlrpc_sepol_fops, obd);
        if (rc) {
                CERROR("create proc entry srpc_sepol for %s: %d\n",
-                      dev->obd_name, rc);
+                      obd->obd_name, rc);
                return rc;
        }