bdev: use claim_module to determine leaf status

A bdev that is claimed is not a leaf, even if it has no vbdevs exposed
currently.

Change-Id: I3b790068128890a569f83b15071ea916c54bff9b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402935
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Daniel Verkamp 2018-03-06 10:42:54 -07:00
parent 0a37a369f3
commit 85cc748fd0

View File

@ -246,7 +246,7 @@ static struct spdk_bdev *
_bdev_next_leaf(struct spdk_bdev *bdev)
{
while (bdev != NULL) {
if (TAILQ_EMPTY(&bdev->vbdevs)) {
if (bdev->claim_module == NULL) {
return bdev;
} else {
bdev = TAILQ_NEXT(bdev, link);