Lines Matching refs:pCtx

5724     afpLockingContext *pCtx;  in fillInUnixFile()  local
5725 pNew->lockingContext = pCtx = sqlite3_malloc64( sizeof(*pCtx) ); in fillInUnixFile()
5726 if( pCtx==0 ){ in fillInUnixFile()
5732 pCtx->dbPath = zFilename; in fillInUnixFile()
5733 pCtx->reserved = 0; in fillInUnixFile()
7177 proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; in proxyBreakConchLock() local
7178 unixFile *conchFile = pCtx->conchFile; in proxyBreakConchLock()
7181 char *cPath = pCtx->conchFilePath; in proxyBreakConchLock()
7237 proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; in proxyConchLock() local
7238 unixFile *conchFile = pCtx->conchFile; in proxyConchLock()
7315 proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; in proxyTakeConch() local
7317 if( pCtx->conchHeld!=0 ){ in proxyTakeConch()
7320 unixFile *conchFile = pCtx->conchFile; in proxyTakeConch()
7334 (pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), in proxyTakeConch()
7370 if( !pCtx->lockProxyPath ){ in proxyTakeConch()
7388 && !strncmp(pCtx->lockProxyPath, &readBuf[PROXY_PATHINDEX], in proxyTakeConch()
7403 if( !pCtx->lockProxyPath ){ in proxyTakeConch()
7404 proxyGetLockPath(pCtx->dbPath, lockPath, MAXPATHLEN); in proxyTakeConch()
7431 if( pCtx->lockProxyPath!=NULL ){ in proxyTakeConch()
7432 strlcpy(&writeBuffer[PROXY_PATHINDEX], pCtx->lockProxyPath, in proxyTakeConch()
7482 fd = robust_open(pCtx->dbPath, pFile->openFlags, 0); in proxyTakeConch()
7491 if( rc==SQLITE_OK && !pCtx->lockProxy ){ in proxyTakeConch()
7492 char *path = tempLockPath ? tempLockPath : pCtx->lockProxyPath; in proxyTakeConch()
7493 rc = proxyCreateUnixFile(path, &pCtx->lockProxy, 1); in proxyTakeConch()
7508 pCtx->lockProxyPath = sqlite3DbStrDup(0, tempLockPath); in proxyTakeConch()
7509 if( !pCtx->lockProxyPath ){ in proxyTakeConch()
7515 pCtx->conchHeld = 1; in proxyTakeConch()
7517 if( pCtx->lockProxy->pMethod == &afpIoMethods ){ in proxyTakeConch()
7519 afpCtx = (afpLockingContext *)pCtx->lockProxy->lockingContext; in proxyTakeConch()
7520 afpCtx->dbPath = pCtx->lockProxyPath; in proxyTakeConch()
7538 proxyLockingContext *pCtx; /* The locking context for the proxy lock */ in proxyReleaseConch() local
7541 pCtx = (proxyLockingContext *)pFile->lockingContext; in proxyReleaseConch()
7542 conchFile = pCtx->conchFile; in proxyReleaseConch()
7544 (pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), in proxyReleaseConch()
7546 if( pCtx->conchHeld>0 ){ in proxyReleaseConch()
7549 pCtx->conchHeld = 0; in proxyReleaseConch()
7604 proxyLockingContext *pCtx = (proxyLockingContext*)pFile->lockingContext; in switchLockProxyPath() local
7605 char *oldPath = pCtx->lockProxyPath; in switchLockProxyPath()
7617 unixFile *lockProxy = pCtx->lockProxy; in switchLockProxyPath()
7618 pCtx->lockProxy=NULL; in switchLockProxyPath()
7619 pCtx->conchHeld = 0; in switchLockProxyPath()
7626 pCtx->lockProxyPath = sqlite3DbStrDup(0, path); in switchLockProxyPath()
7671 proxyLockingContext *pCtx; in proxyTransformUnixFile() local
7689 pCtx = sqlite3_malloc64( sizeof(*pCtx) ); in proxyTransformUnixFile()
7690 if( pCtx==0 ){ in proxyTransformUnixFile()
7693 memset(pCtx, 0, sizeof(*pCtx)); in proxyTransformUnixFile()
7695 rc = proxyCreateConchPathname(dbPath, &pCtx->conchFilePath); in proxyTransformUnixFile()
7697 rc = proxyCreateUnixFile(pCtx->conchFilePath, &pCtx->conchFile, 0); in proxyTransformUnixFile()
7708 if( osStat(pCtx->conchFilePath, &conchInfo) == -1 ) { in proxyTransformUnixFile()
7715 pCtx->conchHeld = -1; /* read only FS/ lockless */ in proxyTransformUnixFile()
7721 pCtx->lockProxyPath = sqlite3DbStrDup(0, lockPath); in proxyTransformUnixFile()
7725 pCtx->dbPath = sqlite3DbStrDup(0, dbPath); in proxyTransformUnixFile()
7726 if( pCtx->dbPath==NULL ){ in proxyTransformUnixFile()
7734 pCtx->oldLockingContext = pFile->lockingContext; in proxyTransformUnixFile()
7735 pFile->lockingContext = pCtx; in proxyTransformUnixFile()
7736 pCtx->pOldMethod = pFile->pMethod; in proxyTransformUnixFile()
7739 if( pCtx->conchFile ){ in proxyTransformUnixFile()
7740 pCtx->conchFile->pMethod->xClose((sqlite3_file *)pCtx->conchFile); in proxyTransformUnixFile()
7741 sqlite3_free(pCtx->conchFile); in proxyTransformUnixFile()
7743 sqlite3DbFree(0, pCtx->lockProxyPath); in proxyTransformUnixFile()
7744 sqlite3_free(pCtx->conchFilePath); in proxyTransformUnixFile()
7745 sqlite3_free(pCtx); in proxyTransformUnixFile()
7762 proxyLockingContext *pCtx = (proxyLockingContext*)pFile->lockingContext; in proxyFileControl() local
7764 if( pCtx->lockProxyPath ){ in proxyFileControl()
7765 *(const char **)pArg = pCtx->lockProxyPath; in proxyFileControl()
7792 proxyLockingContext *pCtx = in proxyFileControl() local
7795 || (pCtx->lockProxyPath && in proxyFileControl()
7796 !strncmp(pCtx->lockProxyPath, proxyPath, MAXPATHLEN)) in proxyFileControl()
7834 proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; in proxyCheckReservedLock() local
7835 if( pCtx->conchHeld>0 ){ in proxyCheckReservedLock()
7836 unixFile *proxy = pCtx->lockProxy; in proxyCheckReservedLock()
7873 proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; in proxyLock() local
7874 if( pCtx->conchHeld>0 ){ in proxyLock()
7875 unixFile *proxy = pCtx->lockProxy; in proxyLock()
7897 proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; in proxyUnlock() local
7898 if( pCtx->conchHeld>0 ){ in proxyUnlock()
7899 unixFile *proxy = pCtx->lockProxy; in proxyUnlock()
7915 proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; in proxyClose() local
7916 unixFile *lockProxy = pCtx->lockProxy; in proxyClose()
7917 unixFile *conchFile = pCtx->conchFile; in proxyClose()
7926 pCtx->lockProxy = 0; in proxyClose()
7929 if( pCtx->conchHeld ){ in proxyClose()
7937 sqlite3DbFree(0, pCtx->lockProxyPath); in proxyClose()
7938 sqlite3_free(pCtx->conchFilePath); in proxyClose()
7939 sqlite3DbFree(0, pCtx->dbPath); in proxyClose()
7941 pFile->lockingContext = pCtx->oldLockingContext; in proxyClose()
7942 pFile->pMethod = pCtx->pOldMethod; in proxyClose()
7943 sqlite3_free(pCtx); in proxyClose()