Ignore:
Timestamp:
Aug 19, 2016, 2:24:06 PM (9 years ago)
Author:
Yuri Dario
Message:

Samba code changes for using new dircache API. ticket#274.

File:
1 edited

Legend:

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

    r964 r966  
    2929#define INCL_LONGLONG
    3030#include <ndextpl2.h>
     31#include "dircache.h"
    3132#include "smbwrp.h"
    3233#include "util.h"
     
    499500         * the above values come from the gui. default: timeout 10; listings: 32
    500501        */
    501         dircache_create(pRes);
     502        dircache_create(&pRes->pdc, (void*) pRes,
     503                        pRes->cachetimeout, pRes->cachedepth);
    502504
    503505        return rc;
     
    715717        Resource *pRes = (Resource *)resource;
    716718        ENTER();
    717         dircache_delete(pRes);
     719
     720        // free cache dir
     721        dircache_delete(pRes->pdc);
     722
     723        // free local resources
    718724        memset(&pRes->srv, 0, sizeof(pRes->srv));
    719725        debuglocal(pRes, 9, "NdpFreeResource %d\n", NO_ERROR);
     
    957963           // First check if there is information in the directory cache.
    958964           unsigned long ulAge = 0;
    959            if (dircache_find_path(pRes, szPath, &finfo, &ulAge))
     965           if (dircache_find_path(pRes->pdc, szPath, &finfo, &ulAge))
    960966           {
    961967              if (ulAge <= 15) /* @todo configurable. */
     
    12011207
    12021208        // delete the dir cache
    1203         dircache_invalidate(szPathName, pRes, 1);
     1209        dircache_invalidate(pRes->pdc, szPathName, 1);
    12041210
    12051211        do {
     
    15141520        debuglocal(pRes, 9, "NdpForceDelete in [%p]\n", pConn);
    15151521
    1516         dircache_invalidate(szFile, pRes, 1);
     1522        dircache_invalidate(pRes->pdc, szFile, 1);
    15171523
    15181524        do {
     
    15431549        debuglocal(pRes, 9, "NdpCreateDir in [%p]\n", pConn);
    15441550
    1545         dircache_invalidate(szDirName, pRes, 1);
     1551        dircache_invalidate(pRes->pdc, szDirName, 1);
    15461552
    15471553        do {
     
    15751581        debuglocal(pRes, 9, "NdpDeleteDir in [%p]\n", pConn);
    15761582
    1577         dircache_invalidate(szDir, pRes, 1);
     1583        dircache_invalidate(pRes->pdc, szDir, 1);
    15781584
    15791585        do {
     
    16051611        debuglocal(pRes, 9, "NdpMove in [%p] from <%s> to <%s>\n", pConn, szSrc, szDst);
    16061612
    1607         dircache_invalidate(szSrc, pRes, 1);
    1608         dircache_invalidate(szDst, pRes, 1);
     1613        dircache_invalidate(pRes->pdc, szSrc, 1);
     1614        dircache_invalidate(pRes->pdc, szDst, 1);
    16091615
    16101616        do
     
    16691675
    16701676        if (flags & O_CREAT)
    1671            dircache_invalidate(szFileName, pRes, 1);
     1677           dircache_invalidate(pRes->pdc, szFileName, 1);
    16721678
    16731679        do {
     
    20152021
    20162022        // delete the dir cache
    2017         dircache_invalidate(pConn->file.fullname, pRes, 1);
     2023        dircache_invalidate(pRes->pdc, pConn->file.fullname, 1);
    20182024
    20192025        do {
     
    22222228         * a new function needs to be done to update only one file in the cache
    22232229        */
    2224         dircache_invalidate(pConn->file.fullname, pRes, 1);
     2230        dircache_invalidate(pRes->pdc, pConn->file.fullname, 1);
    22252231
    22262232        do {
Note: See TracChangeset for help on using the changeset viewer.