diff options
author | Dmitry Eremin <dmitry.eremin@intel.com> | 2016-05-05 14:53:05 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-09 14:03:33 +0200 |
commit | 1f199a0c46fbdec52e25afaeb0b4736d40850409 (patch) | |
tree | 51aac309cfc984f483ac6d38438b5a4a74a9f527 /drivers/staging | |
parent | c1b2e0b517d0eba6936c69fa6d9a1a727534f879 (diff) | |
download | linux-1f199a0c46fbdec52e25afaeb0b4736d40850409.tar.bz2 |
staging: lustre: o2iblnd: handle unmapping of FMR in kiblnd_fmr_pool_unmap
Move FMR unmapping from kiblnd_unmap_tx() to the function
kiblnd_fmr_pool_unmap() so kiblnd_unmap_tx() can be used
with the Fast Registration API as well.
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5783
Reviewed-on: http://review.whamcloud.com/17606
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 14 | ||||
-rw-r--r-- | drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 4 |
2 files changed, 11 insertions, 7 deletions
diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index 491bd6cd1460..fc29d5c0f769 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -1470,13 +1470,20 @@ void kiblnd_fmr_pool_unmap(kib_fmr_t *fmr, int status) { LIST_HEAD(zombies); kib_fmr_pool_t *fpo = fmr->fmr_pool; - kib_fmr_poolset_t *fps = fpo->fpo_owner; + kib_fmr_poolset_t *fps; unsigned long now = cfs_time_current(); kib_fmr_pool_t *tmp; int rc; - rc = ib_fmr_pool_unmap(fmr->fmr_pfmr); - LASSERT(!rc); + if (!fpo) + return; + + fps = fpo->fpo_owner; + if (fmr->fmr_pfmr) { + rc = ib_fmr_pool_unmap(fmr->fmr_pfmr); + LASSERT(!rc); + fmr->fmr_pfmr = NULL; + } if (status) { rc = ib_flush_fmr_pool(fpo->fmr.fpo_fmr_pool); @@ -1484,7 +1491,6 @@ void kiblnd_fmr_pool_unmap(kib_fmr_t *fmr, int status) } fmr->fmr_pool = NULL; - fmr->fmr_pfmr = NULL; spin_lock(&fps->fps_lock); fpo->fpo_map_count--; /* decref the pool */ diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c index b243f1faa348..7d1c750d3b1f 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -613,10 +613,8 @@ static void kiblnd_unmap_tx(lnet_ni_t *ni, kib_tx_t *tx) LASSERT(net); - if (net->ibn_fmr_ps && tx->fmr.fmr_pfmr) { + if (net->ibn_fmr_ps) kiblnd_fmr_pool_unmap(&tx->fmr, tx->tx_status); - tx->fmr.fmr_pfmr = NULL; - } if (tx->tx_nfrags) { kiblnd_dma_unmap_sg(tx->tx_pool->tpo_hdev->ibh_ibdev, |