From: Amir Shehata Date: Thu, 6 Dec 2018 20:52:22 +0000 (+0000) Subject: Revert "LU-11152 lnd: test fpo_fmr_poool pointer instead of special bool" X-Git-Tag: 2.12.0-RC2~3 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=a65d072fa45fc90c2fc74b61d214de79c0bf33e5 Revert "LU-11152 lnd: test fpo_fmr_poool pointer instead of special bool" This reverts commit 9b790ba0f5606c0a91563828fa43f5e4ae210425. Change-Id: Ibca8e813ec7372510709578e33309140e8fc7b5f Signed-off-by: Amir Shehata Reviewed-on: https://review.whamcloud.com/33802 Reviewed-by: James Simmons Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index e28d596..98818ed 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -1459,9 +1459,8 @@ kiblnd_destroy_fmr_pool(struct kib_fmr_pool *fpo) { LASSERT(fpo->fpo_map_count == 0); - if (!IS_ERR_OR_NULL(fpo->fmr.fpo_fmr_pool)) { + if (fpo->fpo_is_fmr && fpo->fmr.fpo_fmr_pool) { ib_destroy_fmr_pool(fpo->fmr.fpo_fmr_pool); - fpo->fmr.fpo_fmr_pool = NULL; } else { struct kib_fast_reg_descriptor *frd, *tmp; int i = 0; @@ -1540,6 +1539,7 @@ static int kiblnd_alloc_fmr_pool(struct kib_fmr_poolset *fps, else CERROR("FMRs are not supported\n"); } + fpo->fpo_is_fmr = true; return rc; } @@ -1551,6 +1551,8 @@ static int kiblnd_alloc_freg_pool(struct kib_fmr_poolset *fps, struct kib_fast_reg_descriptor *frd, *tmp; int i, rc; + fpo->fpo_is_fmr = false; + INIT_LIST_HEAD(&fpo->fast_reg.fpo_pool_list); fpo->fast_reg.fpo_pool_size = 0; for (i = 0; i < fps->fps_pool_size; i++) { @@ -1782,7 +1784,7 @@ kiblnd_fmr_pool_unmap(struct kib_fmr *fmr, int status) return; fps = fpo->fpo_owner; - if (!IS_ERR_OR_NULL(fpo->fmr.fpo_fmr_pool)) { + if (fpo->fpo_is_fmr) { if (fmr->fmr_pfmr) { rc = ib_fmr_pool_unmap(fmr->fmr_pfmr); LASSERT(!rc); @@ -1844,7 +1846,7 @@ again: fpo->fpo_deadline = ktime_get_seconds() + IBLND_POOL_DEADLINE; fpo->fpo_map_count++; - if (!IS_ERR_OR_NULL(fpo->fmr.fpo_fmr_pool)) { + if (fpo->fpo_is_fmr) { struct ib_pool_fmr *pfmr; spin_unlock(&fps->fps_lock); diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h index 747c670..ddee13d 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.h +++ b/lnet/klnds/o2iblnd/o2iblnd.h @@ -349,6 +349,7 @@ struct kib_fmr_pool { time64_t fpo_deadline; /* deadline of this pool */ int fpo_failed; /* fmr pool is failed */ int fpo_map_count; /* # of mapped FMR */ + bool fpo_is_fmr; /* True if FMR pools allocated */ }; struct kib_fmr {