Whamcloud - gitweb
The variable, not the literal. Thanks mjmac.
[fs/lustre-release.git] / lustre / lov / lproc_lov.c
index 7b7a00c..1f711af 100644 (file)
@@ -107,8 +107,8 @@ static int lov_rd_activeobd(char *page, char **start, off_t off, int count,
         return snprintf(page, count, "%u\n", desc->ld_active_tgt_count);
 }
 
-static int lov_rd_mdc(char *page, char **start, off_t off, int count, int *eof,
-                      void *data)
+static int lov_rd_desc_uuid(char *page, char **start, off_t off, int count,
+                            int *eof, void *data)
 {
         struct obd_device *dev = (struct obd_device*) data;
         struct lov_obd *lov;
@@ -116,7 +116,7 @@ static int lov_rd_mdc(char *page, char **start, off_t off, int count, int *eof,
         LASSERT(dev != NULL);
         lov = &dev->u.lov;
         *eof = 1;
-        return snprintf(page, count, "%s\n", lov->mdcobd->obd_uuid.uuid);
+        return snprintf(page, count, "%s\n", lov->desc.ld_uuid.uuid);
 }
 
 static void *lov_tgt_seq_start(struct seq_file *p, loff_t *pos)
@@ -146,9 +146,9 @@ static int lov_tgt_seq_show(struct seq_file *p, void *v)
         struct lov_tgt_desc *tgt = v;
         struct obd_device *dev = p->private;
         struct lov_obd *lov = &dev->u.lov;
-        int idx = tgt - &(lov->tgts[0]);
-        return seq_printf(p, "%d: %s %sACTIVE\n", idx+1, tgt->uuid.uuid,
-                          tgt->active ? "" : "IN");
+        int idx = tgt - lov->tgts;
+        return seq_printf(p, "%d: %s %sACTIVE\n", idx, tgt->uuid.uuid,
+                          (tgt->ltd_flags & LTD_ACTIVE) ? "" : "IN");
 }
 
 struct seq_operations lov_tgt_sops = {
@@ -160,7 +160,7 @@ struct seq_operations lov_tgt_sops = {
 
 static int lov_target_seq_open(struct inode *inode, struct file *file)
 {
-        struct proc_dir_entry *dp = inode->u.generic_ip;
+        struct proc_dir_entry *dp = PDE(inode);
         struct seq_file *seq;
         int rc = seq_open(file, &lov_tgt_sops);
 
@@ -187,7 +187,8 @@ struct lprocfs_vars lprocfs_obd_vars[] = {
         { "blocksize",    lprocfs_rd_blksize,     0, 0 },
         { "kbytestotal",  lprocfs_rd_kbytestotal, 0, 0 },
         { "kbytesfree",   lprocfs_rd_kbytesfree,  0, 0 },
-        { "target_mdc",   lov_rd_mdc,             0, 0 },
+        { "kbytesavail",  lprocfs_rd_kbytesavail, 0, 0 },
+        { "desc_uuid",    lov_rd_desc_uuid,       0, 0 },
         { 0 }
 };
 
@@ -197,9 +198,10 @@ static struct lprocfs_vars lprocfs_module_vars[] = {
 };
 
 struct file_operations lov_proc_target_fops = {
-        .open = lov_target_seq_open,
-        .read = seq_read,
-        .llseek = seq_lseek,
+        .owner   = THIS_MODULE,
+        .open    = lov_target_seq_open,
+        .read    = seq_read,
+        .llseek  = seq_lseek,
         .release = seq_release,
 };