mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
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. MFC after: 1 month
This commit is contained in:
parent
b2d05a1b26
commit
8592f07464
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=275112
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user