The target_obd proc file was not being generated correctly
in cases where nonconsecutive MDT indices were used when
generating a filesystem.
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Change-Id: I4bd3aaffd56707ea29b9b2d4366de5e20b3d3760
Reviewed-on: http://review.whamcloud.com/20336
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
{
struct obd_device *dev = p->private;
struct lmv_obd *lmv = &dev->u.lmv;
{
struct obd_device *dev = p->private;
struct lmv_obd *lmv = &dev->u.lmv;
- return (*pos >= lmv->desc.ld_tgt_count) ? NULL : lmv->tgts[*pos];
+
+ while (*pos < lmv->tgts_size) {
+ if (lmv->tgts[*pos] != NULL)
+ return lmv->tgts[*pos];
+
+ ++*pos;
+ }
+
+ return NULL;
}
static void lmv_tgt_seq_stop(struct seq_file *p, void *v)
}
static void lmv_tgt_seq_stop(struct seq_file *p, void *v)
{
struct obd_device *dev = p->private;
struct lmv_obd *lmv = &dev->u.lmv;
{
struct obd_device *dev = p->private;
struct lmv_obd *lmv = &dev->u.lmv;
- return (*pos >= lmv->desc.ld_tgt_count) ? NULL : lmv->tgts[*pos];
+ while (*pos < lmv->tgts_size) {
+ if (lmv->tgts[*pos] != NULL)
+ return lmv->tgts[*pos];
+
+ ++*pos;
+ }
+
+ return NULL;
}
static int lmv_tgt_seq_show(struct seq_file *p, void *v)
}
static int lmv_tgt_seq_show(struct seq_file *p, void *v)