VirtualBox

Changeset 3379 in kBuild


Ignore:
Timestamp:
Jun 12, 2020 12:54:55 AM (5 years ago)
Author:
bird
Message:

kFsCache: Fixed bug in name updating of missing entires. Fixed copy&paste error in lookup wrt flag handling (harmless). Update uCacheGen on old entries during directory repopulation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/nt/kFsCache.c

    r3372 r3379  
    912912    pCur->pszName = pch;
    913913    pCur->cchName = cchName;
    914     pch = kHlpMemPCopy(pch, pchName, cchShortName);
     914    pch = kHlpMemPCopy(pch, pchName, cchName);
    915915    *pch++ = '\0';
    916916
     
    15351535                                }
    15361536                            }
     1537                            if (pCur->uCacheGen != KFSOBJ_CACHE_GEN_IGNORE)
     1538                                pCur->uCacheGen = pCache->auGenerations[pCur->fFlags & KFSOBJ_F_USE_CUSTOM_GEN];
    15371539                        }
    15381540                        else if (pCur->bObjType == KFSOBJ_TYPE_MISSING)
     
    15411543                                          pDir->Obj.pParent->Obj.pszName, pDir->Obj.pszName, pCur->pszName, bObjType));
    15421544                            pCur->bObjType = bObjType;
     1545                            if (pCur->uCacheGen != KFSOBJ_CACHE_GEN_IGNORE)
     1546                                pCur->uCacheGen = pCache->auGenerations[pCur->fFlags & KFSOBJ_F_USE_CUSTOM_GEN];
    15431547                        }
    15441548                        else
     
    18371841                          pMissing->pParent->Obj.pszName, pMissing->pszName, bObjType, BasicInfo.FileAttributes));
    18381842            pMissing->bObjType  = bObjType;
    1839             pMissing->uCacheGen = pCache->auGenerations[pMissing->fFlags & KFSOBJ_F_USE_CUSTOM_GEN];
     1843            /* (auGenerations[] - 1): make sure it's not considered up to date */
     1844            pMissing->uCacheGen = pCache->auGenerations[pMissing->fFlags & KFSOBJ_F_USE_CUSTOM_GEN] - 1;
     1845            /* Trigger parent directory repopulation. */
     1846            if (pMissing->pParent->fPopulated)
     1847                pMissing->pParent->fNeedRePopulating = K_TRUE;
    18401848/**
    18411849 * @todo refresh missing object names when it appears.
     
    28022810                || pParent->Obj.uCacheGen == pCache->auGenerations[pParent->Obj.fFlags & KFSOBJ_F_USE_CUSTOM_GEN]) )
    28032811        { /* likely */ }
    2804         else if (   (fFlags & (KFSCACHE_LOOKUP_F_NO_INSERT | fFlags & KFSCACHE_LOOKUP_F_NO_REFRESH))
     2812        else if (   (fFlags & (KFSCACHE_LOOKUP_F_NO_INSERT | KFSCACHE_LOOKUP_F_NO_REFRESH))
    28052813                 || kFsCachePopuplateOrRefreshDir(pCache, pParent, penmError))
    28062814        { /* likely */ }
     
    29702978                || pParent->Obj.uCacheGen == pCache->auGenerations[pParent->Obj.fFlags & KFSOBJ_F_USE_CUSTOM_GEN]) )
    29712979        { /* likely */ }
    2972         else if (   (fFlags & (KFSCACHE_LOOKUP_F_NO_INSERT | fFlags & KFSCACHE_LOOKUP_F_NO_REFRESH))
     2980        else if (   (fFlags & (KFSCACHE_LOOKUP_F_NO_INSERT | KFSCACHE_LOOKUP_F_NO_REFRESH))
    29732981                 || kFsCachePopuplateOrRefreshDir(pCache, pParent, penmError))
    29742982        { /* likely */ }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette