Changeset 967


Ignore:
Timestamp:
Aug 19, 2016, 3:13:31 PM (9 years ago)
Author:
Yuri Dario
Message:

Since pdc field is already known to upper layer, avoid storing it in
each cache entry. ticket#274.

Location:
trunk/client/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/src/dircache.c

    r965 r967  
    8888    pdce->ulHash = computehash (path);
    8989    pdce->ulLastUpdateTime = 0;
    90     pdce->pdc = pdc;
    9190    pdce->fInvalid = 0;
    9291
     
    267266}
    268267
    269 static void dcRemoveEntry (DirectoryCacheEntry *pdce)
    270 {
    271     DirectoryCache *pdc = pdce->pdc;
    272 
     268static void dcRemoveEntry (DirectoryCache *pdc, DirectoryCacheEntry *pdce)
     269{
    273270    if (pdce->pNext)
    274271    {
     
    295292}
    296293
    297 static void dcInsertEntry (DirectoryCacheEntry *pdce)
    298 {
    299     DirectoryCache *pdc = pdce->pdc;
    300 
     294static void dcInsertEntry (DirectoryCache *pdc, DirectoryCacheEntry *pdce)
     295{
    301296    pdce->pNext = pdc->pEntriesHead;
    302297
     
    371366                {
    372367                    debuglocal(pdc->resource, 9, "dcRead: expired\n");
    373                     dcRemoveEntry (pdce);
     368                    dcRemoveEntry (pdc, pdce);
    374369                    dceDelete (pdce);
    375370                }
     
    415410            dceClear (pdce);
    416411            /* Remove the entry from list. It will be added again in dircache_write_end. */
    417             dcRemoveEntry (pdce);
     412            dcRemoveEntry (pdc, pdce);
    418413        }
    419414
     
    440435    while (pdce)
    441436    {
    442         dcRemoveEntry (pdce);
     437        dcRemoveEntry (pdc, pdce);
    443438        dceDelete (pdce);
    444439       
     
    604599        /* Remove oldest entry. */
    605600        pdce = pdc->pEntriesTail;
    606         dcRemoveEntry (pdce);
     601        dcRemoveEntry (pdc, pdce);
    607602        dceDelete (pdce);
    608603        pdce = NULL;
     
    629624    }
    630625   
    631     lockRequest (pdce->pdc->mutex);
     626    lockRequest (pdc->mutex);
    632627   
    633628    dceWriteEntry (pdc, pdce, finfo);
    634629   
    635     lockRelease (pdce->pdc->mutex);
     630    lockRelease (pdc->mutex);
    636631}
    637632
     
    657652    {
    658653        dceAdjust (pdc, pdce);
    659         dcInsertEntry (pdce);
     654        dcInsertEntry (pdc, pdce);
    660655    }
    661656   
  • trunk/client/src/dircache.h

    r965 r967  
    3838    struct DirectoryCacheEntry *pNext;
    3939    struct DirectoryCacheEntry *pPrev;
    40 
    41     struct DirectoryCache *pdc;
    4240
    4341    smbwrp_fileinfo *aInfos;
Note: See TracChangeset for help on using the changeset viewer.