Whamcloud - gitweb
LU-9855 lustre: rename obd_device variables to obd
[fs/lustre-release.git] / lustre / mdc / lproc_mdc.c
index f5bae91..9de5c70 100644 (file)
 static ssize_t active_show(struct kobject *kobj, struct attribute *attr,
                           char *buf)
 {
-       struct obd_device *dev = container_of(kobj, struct obd_device,
+       struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);
        struct obd_import *imp;
        ssize_t len;
 
-       with_imp_locked(dev, imp, len)
+       with_imp_locked(obd, imp, len)
                len = sprintf(buf, "%d\n", !imp->imp_deactive);
        return len;
 }
@@ -54,7 +54,7 @@ static ssize_t active_show(struct kobject *kobj, struct attribute *attr,
 static ssize_t active_store(struct kobject *kobj, struct attribute *attr,
                            const char *buffer, size_t count)
 {
-       struct obd_device *dev = container_of(kobj, struct obd_device,
+       struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);
        bool val;
        int rc;
@@ -64,8 +64,8 @@ static ssize_t active_store(struct kobject *kobj, struct attribute *attr,
                return rc;
 
        /* opposite senses */
-       if (dev->u.cli.cl_import->imp_deactive == val)
-               rc = ptlrpc_set_import_active(dev->u.cli.cl_import, val);
+       if (obd->u.cli.cl_import->imp_deactive == val)
+               rc = ptlrpc_set_import_active(obd->u.cli.cl_import, val);
        else
                CDEBUG(D_CONFIG, "activate %u: ignoring repeat request\n",
                       val);
@@ -78,12 +78,12 @@ static ssize_t max_rpcs_in_flight_show(struct kobject *kobj,
                                       struct attribute *attr,
                                       char *buf)
 {
-       struct obd_device *dev = container_of(kobj, struct obd_device,
+       struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);
        ssize_t len;
        u32 max;
 
-       max = obd_get_max_rpcs_in_flight(&dev->u.cli);
+       max = obd_get_max_rpcs_in_flight(&obd->u.cli);
        len = sprintf(buf, "%u\n", max);
 
        return len;
@@ -94,7 +94,7 @@ static ssize_t max_rpcs_in_flight_store(struct kobject *kobj,
                                        const char *buffer,
                                        size_t count)
 {
-       struct obd_device *dev = container_of(kobj, struct obd_device,
+       struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);
        unsigned int val;
        int rc;
@@ -103,7 +103,7 @@ static ssize_t max_rpcs_in_flight_store(struct kobject *kobj,
        if (rc)
                return rc;
 
-       rc = obd_set_max_rpcs_in_flight(&dev->u.cli, val);
+       rc = obd_set_max_rpcs_in_flight(&obd->u.cli, val);
        if (rc)
                count = rc;
 
@@ -115,11 +115,11 @@ static ssize_t max_mod_rpcs_in_flight_show(struct kobject *kobj,
                                           struct attribute *attr,
                                           char *buf)
 {
-       struct obd_device *dev = container_of(kobj, struct obd_device,
+       struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);
        u16 max;
 
-       max = obd_get_max_mod_rpcs_in_flight(&dev->u.cli);
+       max = obd_get_max_mod_rpcs_in_flight(&obd->u.cli);
        return sprintf(buf, "%hu\n", max);
 }
 
@@ -128,7 +128,7 @@ static ssize_t max_mod_rpcs_in_flight_store(struct kobject *kobj,
                                            const char *buffer,
                                            size_t count)
 {
-       struct obd_device *dev = container_of(kobj, struct obd_device,
+       struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);
        u16 val;
        int rc;
@@ -137,7 +137,7 @@ static ssize_t max_mod_rpcs_in_flight_store(struct kobject *kobj,
        if (rc)
                return rc;
 
-       rc = obd_set_max_mod_rpcs_in_flight(&dev->u.cli, val);
+       rc = obd_set_max_mod_rpcs_in_flight(&obd->u.cli, val);
        if (rc)
                count = rc;
 
@@ -147,8 +147,8 @@ LUSTRE_RW_ATTR(max_mod_rpcs_in_flight);
 
 static int mdc_max_dirty_mb_seq_show(struct seq_file *m, void *v)
 {
-       struct obd_device *dev = m->private;
-       struct client_obd *cli = &dev->u.cli;
+       struct obd_device *obd = m->private;
+       struct client_obd *cli = &obd->u.cli;
        unsigned long val;
 
        spin_lock(&cli->cl_loi_list_lock);
@@ -164,8 +164,8 @@ static ssize_t mdc_max_dirty_mb_seq_write(struct file *file,
                                          size_t count, loff_t *off)
 {
        struct seq_file *sfl = file->private_data;
-       struct obd_device *dev = sfl->private;
-       struct client_obd *cli = &dev->u.cli;
+       struct obd_device *obd = sfl->private;
+       struct client_obd *cli = &obd->u.cli;
        char kernbuf[22] = "";
        u64 pages_number;
        int rc;
@@ -236,8 +236,8 @@ LUSTRE_RW_ATTR(ping);
 
 static int mdc_cached_mb_seq_show(struct seq_file *m, void *v)
 {
-       struct obd_device *dev = m->private;
-       struct client_obd *cli = &dev->u.cli;
+       struct obd_device *obd = m->private;
+       struct client_obd *cli = &obd->u.cli;
        int shift = 20 - PAGE_SHIFT;
 
        seq_printf(m, "used_mb: %ld\n"
@@ -257,8 +257,8 @@ mdc_cached_mb_seq_write(struct file *file, const char __user *buffer,
                        size_t count, loff_t *off)
 {
        struct seq_file *sfl = file->private_data;
-       struct obd_device *dev = sfl->private;
-       struct client_obd *cli = &dev->u.cli;
+       struct obd_device *obd = sfl->private;
+       struct client_obd *cli = &obd->u.cli;
        u64 pages_number;
        const char *tmp;
        long rc;
@@ -296,8 +296,8 @@ LPROC_SEQ_FOPS(mdc_cached_mb);
 
 static int mdc_unstable_stats_seq_show(struct seq_file *m, void *v)
 {
-       struct obd_device *dev = m->private;
-       struct client_obd *cli = &dev->u.cli;
+       struct obd_device *obd = m->private;
+       struct client_obd *cli = &obd->u.cli;
        long pages;
        int mb;
 
@@ -315,8 +315,8 @@ static ssize_t mdc_rpc_stats_seq_write(struct file *file,
                                       size_t len, loff_t *off)
 {
        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;
 
        lprocfs_oh_clear(&cli->cl_mod_rpcs_hist);
 
@@ -332,12 +332,12 @@ static ssize_t mdc_rpc_stats_seq_write(struct file *file,
 
 static int mdc_rpc_stats_seq_show(struct seq_file *seq, void *v)
 {
-       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;
        unsigned long read_tot = 0, write_tot = 0, read_cum, write_cum;
        int i;
 
-       obd_mod_rpc_stats_seq_show(&dev->u.cli, seq);
+       obd_mod_rpc_stats_seq_show(cli, seq);
 
        spin_lock(&cli->cl_loi_list_lock);
 
@@ -427,8 +427,8 @@ LPROC_SEQ_FOPS(mdc_rpc_stats);
 static int mdc_stats_seq_show(struct seq_file *seq, void *v)
 {
        struct timespec64 now;
-       struct obd_device *dev = seq->private;
-       struct osc_stats *stats = &obd2osc_dev(dev)->od_stats;
+       struct obd_device *obd = seq->private;
+       struct osc_stats *stats = &obd2osc_dev(obd)->od_stats;
 
        ktime_get_real_ts64(&now);
 
@@ -448,8 +448,8 @@ static ssize_t mdc_stats_seq_write(struct file *file,
                                   size_t len, loff_t *off)
 {
        struct seq_file *seq = file->private_data;
-       struct obd_device *dev = seq->private;
-       struct osc_stats *stats = &obd2osc_dev(dev)->od_stats;
+       struct obd_device *obd = seq->private;
+       struct osc_stats *stats = &obd2osc_dev(obd)->od_stats;
 
        memset(stats, 0, sizeof(*stats));
        return len;
@@ -458,9 +458,9 @@ LPROC_SEQ_FOPS(mdc_stats);
 
 static int mdc_dom_min_repsize_seq_show(struct seq_file *m, void *v)
 {
-       struct obd_device *dev = m->private;
+       struct obd_device *obd = m->private;
 
-       seq_printf(m, "%u\n", dev->u.cli.cl_dom_min_inline_repsize);
+       seq_printf(m, "%u\n", obd->u.cli.cl_dom_min_inline_repsize);
 
        return 0;
 }
@@ -470,7 +470,7 @@ static ssize_t mdc_dom_min_repsize_seq_write(struct file *file,
                                             size_t count, loff_t *off)
 {
        struct seq_file *m = file->private_data;
-       struct obd_device *dev = m->private;
+       struct obd_device *obd = m->private;
        unsigned int val;
        int rc;
 
@@ -481,7 +481,7 @@ static ssize_t mdc_dom_min_repsize_seq_write(struct file *file,
        if (val > MDC_DOM_MAX_INLINE_REPSIZE)
                return -ERANGE;
 
-       dev->u.cli.cl_dom_min_inline_repsize = val;
+       obd->u.cli.cl_dom_min_inline_repsize = val;
        return count;
 }
 LPROC_SEQ_FOPS(mdc_dom_min_repsize);