diff options
author | mav <mav@FreeBSD.org> | 2014-12-26 09:09:50 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-12-26 09:09:50 +0000 |
commit | 28baac29e7d8b3754f2899fcdef2727decdddef9 (patch) | |
tree | 04459992286cea1ad9fe4628f7483df2d14b2d39 /sys/dev/isp | |
parent | 5d78bffe2b06e0aa6f7cd8c4dcd19ec5fcea8606 (diff) | |
download | FreeBSD-src-28baac29e7d8b3754f2899fcdef2727decdddef9.zip FreeBSD-src-28baac29e7d8b3754f2899fcdef2727decdddef9.tar.gz |
MFC r275112:
Make isp_find_pdb_by_*() search for targets in portdb in reverse order.
Records with target_mode == 1 are allocated from the end of portdb, so it
seems logical to start search from the end not traverse whole array.
Diffstat (limited to 'sys/dev/isp')
-rw-r--r-- | sys/dev/isp/isp_library.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/isp/isp_library.c b/sys/dev/isp/isp_library.c index b6d5945..cb9c4ff 100644 --- a/sys/dev/isp/isp_library.c +++ b/sys/dev/isp/isp_library.c @@ -2369,7 +2369,7 @@ isp_find_pdb_by_wwn(ispsoftc_t *isp, int chan, uint64_t wwn, fcportdb_t **lptr) if (chan < isp->isp_nchan) { fcp = FCPARAM(isp, chan); - for (i = 0; i < MAX_FC_TARG; i++) { + for (i = MAX_FC_TARG - 1; i >= 0; i--) { fcportdb_t *lp = &fcp->portdb[i]; if (lp->target_mode == 0) { @@ -2392,7 +2392,7 @@ isp_find_pdb_by_loopid(ispsoftc_t *isp, int chan, uint32_t loopid, fcportdb_t ** if (chan < isp->isp_nchan) { fcp = FCPARAM(isp, chan); - for (i = 0; i < MAX_FC_TARG; i++) { + for (i = MAX_FC_TARG - 1; i >= 0; i--) { fcportdb_t *lp = &fcp->portdb[i]; if (lp->target_mode == 0) { @@ -2418,7 +2418,7 @@ isp_find_pdb_by_sid(ispsoftc_t *isp, int chan, uint32_t sid, fcportdb_t **lptr) } fcp = FCPARAM(isp, chan); - for (i = 0; i < MAX_FC_TARG; i++) { + for (i = MAX_FC_TARG - 1; i >= 0; i--) { fcportdb_t *lp = &fcp->portdb[i]; if (lp->target_mode == 0) { |