Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65aaf99d authored by Giuseppe Di Natale's avatar Giuseppe Di Natale Committed by Greg Kroah-Hartman
Browse files

staging: lustre: lmv: Correctly generate target_obd



The target_obd debugfs file was not being generated correctly
in cases where nonconsecutive MDT indices were used when
generating a filesystem.

Signed-off-by: default avatarGiuseppe Di Natale <dinatale2@llnl.gov>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8100
Reviewed-on: http://review.whamcloud.com/20336


Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarLai Siyao <lai.siyao@intel.com>
Reviewed-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8a140b45
Loading
Loading
Loading
Loading
+15 −2
Original line number Original line Diff line number Diff line
@@ -147,7 +147,13 @@ static void *lmv_tgt_seq_start(struct seq_file *p, loff_t *pos)
	struct obd_device       *dev = p->private;
	struct obd_device       *dev = p->private;
	struct lmv_obd	  *lmv = &dev->u.lmv;
	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])
			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)
@@ -159,8 +165,15 @@ static void *lmv_tgt_seq_next(struct seq_file *p, void *v, loff_t *pos)
{
{
	struct obd_device       *dev = p->private;
	struct obd_device       *dev = p->private;
	struct lmv_obd	  *lmv = &dev->u.lmv;
	struct lmv_obd	  *lmv = &dev->u.lmv;

	++*pos;
	++*pos;
	return (*pos >= lmv->desc.ld_tgt_count) ? NULL : lmv->tgts[*pos];
	while (*pos < lmv->tgts_size) {
		if (lmv->tgts[*pos])
			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)