Home | History | Annotate | Download | only in dist

Lines Matching refs:pShmNode

23730   unixShmNode *pShmNode;          /* Shared memory associated with this inode */
23860 assert( pInode->pShmNode==0 );
26321 unixShmNode *pShmNode; /* The underlying unixShmNode object */
26344 unixShmNode *pShmNode, /* Apply locks to this open shared-memory segment */
26353 assert( sqlite3_mutex_held(pShmNode->mutex) || pShmNode->nRef==0 );
26368 rc = fcntl(pShmNode->h, F_SETLK, &f);
26379 pShmNode->exclMask &= ~mask;
26380 pShmNode->sharedMask &= ~mask;
26383 pShmNode->exclMask &= ~mask;
26384 pShmNode->sharedMask |= mask;
26388 pShmNode->exclMask |= mask;
26389 pShmNode->sharedMask &= ~mask;
26402 pShmNode->sharedMask, pShmNode->exclMask));
26417 unixShmNode *p = pFd->pInode->pShmNode;
26428 p->pInode->pShmNode = 0;
26464 struct unixShmNode *pShmNode; /* The underlying mmapped file */
26481 pShmNode = pInode->pShmNode;
26482 if( pShmNode==0 ){
26500 pShmNode = sqlite3_malloc( sizeof(*pShmNode) + nShmFilename );
26501 if( pShmNode==0 ){
26505 memset(pShmNode, 0, sizeof(*pShmNode));
26506 zShmFilename = pShmNode->zFilename = (char*)&pShmNode[1];
26514 pShmNode->h = -1;
26515 pDbFd->pInode->pShmNode = pShmNode;
26516 pShmNode->pInode = pDbFd->pInode;
26517 pShmNode->mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST);
26518 if( pShmNode->mutex==0 ){
26523 pShmNode->h = open(zShmFilename, O_RDWR|O_CREAT, (sStat.st_mode & 0777));
26524 if( pShmNode->h<0 ){
26533 if( unixShmSystemLock(pShmNode, F_WRLCK, UNIX_SHM_DMS, 1)==SQLITE_OK ){
26534 if( robust_ftruncate(pShmNode->h, 0) ){
26539 rc = unixShmSystemLock(pShmNode, F_RDLCK, UNIX_SHM_DMS, 1);
26545 p->pShmNode = pShmNode;
26547 p->id = pShmNode->nextShmId++;
26549 pShmNode->nRef++;
26553 /* The reference count on pShmNode has already been incremented under
26555 ** new (struct unixShm) object to the pShmNode has been set. All that is
26557 ** at pShmNode->pFirst. This must be done while holding the pShmNode->mutex
26560 sqlite3_mutex_enter(pShmNode->mutex);
26561 p->pNext = pShmNode->pFirst;
26562 pShmNode->pFirst = p;
26563 sqlite3_mutex_leave(pShmNode->mutex);
26568 unixShmPurge(pDbFd); /* This call frees pShmNode if required */
26602 unixShmNode *pShmNode;
26612 pShmNode = p->pShmNode;
26613 sqlite3_mutex_enter(pShmNode->mutex);
26614 assert( szRegion==pShmNode->szRegion || pShmNode->nRegion==0 );
26616 if( pShmNode->nRegion<=iRegion ){
26621 pShmNode->szRegion = szRegion;
26627 if( fstat(pShmNode->h, &sStat) ){
26640 if( robust_ftruncate(pShmNode->h, nByte) ){
26641 rc = unixLogError(SQLITE_IOERR_SHMSIZE,"ftruncate",pShmNode->zFilename);
26648 pShmNode->apRegion, (iRegion+1)*sizeof(char *)
26654 pShmNode->apRegion = apNew;
26655 while(pShmNode->nRegion<=iRegion){
26657 MAP_SHARED, pShmNode->h, pShmNode->nRegion*szRegion
26663 pShmNode->apRegion[pShmNode->nRegion] = pMem;
26664 pShmNode->nRegion++;
26669 if( pShmNode->nRegion>iRegion ){
26670 *pp = pShmNode->apRegion[iRegion];
26674 sqlite3_mutex_leave(pShmNode->mutex);
26695 unixShmNode *pShmNode = p->pShmNode; /* The underlying file iNode */
26699 assert( pShmNode==pDbFd->pInode->pShmNode );
26700 assert( pShmNode->pInode==pDbFd->pInode );
26711 sqlite3_mutex_enter(pShmNode->mutex);
26716 for(pX=pShmNode->pFirst; pX; pX=pX->pNext){
26724 rc = unixShmSystemLock(pShmNode, F_UNLCK, ofst+UNIX_SHM_BASE, n);
26741 for(pX=pShmNode->pFirst; pX; pX=pX->pNext){
26752 rc = unixShmSystemLock(pShmNode, F_RDLCK, ofst+UNIX_SHM_BASE, n);
26766 for(pX=pShmNode->pFirst; pX; pX=pX->pNext){
26777 rc = unixShmSystemLock(pShmNode, F_WRLCK, ofst+UNIX_SHM_BASE, n);
26784 sqlite3_mutex_leave(pShmNode->mutex);
26816 unixShmNode *pShmNode; /* The underlying shared-memory file */
26823 pShmNode = p->pShmNode;
26825 assert( pShmNode==pDbFd->pInode->pShmNode );
26826 assert( pShmNode->pInode==pDbFd->pInode );
26829 ** with pShmNode */
26830 sqlite3_mutex_enter(pShmNode->mutex);
26831 for(pp=&pShmNode->pFirst; (*pp)!=p; pp = &(*pp)->pNext){}
26837 sqlite3_mutex_leave(pShmNode->mutex);
26839 /* If pShmNode->nRef has reached 0, then close the underlying
26842 assert( pShmNode->nRef>0 );
26843 pShmNode->nRef--;
26844 if( pShmNode->nRef==0 ){
26845 if( deleteFlag ) unlink(pShmNode->zFilename);
30942 ** winShm.pShmNode
30945 ** All other fields are read/write. The winShm.pShmNode->mutex must be held
30949 winShmNode *pShmNode; /* The underlying winShmNode object */
31072 struct winShmNode *pShmNode = 0; /* The underlying mmapped file */
31086 pNew = sqlite3_malloc( sizeof(*pShmNode) + nName + 15 );
31099 for(pShmNode = winShmNodeList; pShmNode; pShmNode=pShmNode->pNext){
31103 if( sqlite3StrICmp(pShmNode->zFilename, pNew->zFilename)==0 ) break;
31105 if( pShmNode ){
31108 pShmNode = pNew;
31110 ((winFile*)(&pShmNode->hFile))->h = INVALID_HANDLE_VALUE;
31111 pShmNode->pNext = winShmNodeList;
31112 winShmNodeList = pShmNode;
31114 pShmNode->mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST);
31115 if( pShmNode->mutex==0 ){
31121 pShmNode->zFilename, /* Name of the file (UTF-8) */
31122 (sqlite3_file*)&pShmNode->hFile, /* File handle here */
31133 if( winShmSystemLock(pShmNode, _SHM_WRLCK, WIN_SHM_DMS, 1)==SQLITE_OK ){
31134 rc = winTruncate((sqlite3_file *)&pShmNode->hFile, 0);
31140 winShmSystemLock(pShmNode, _SHM_UNLCK, WIN_SHM_DMS, 1);
31141 rc = winShmSystemLock(pShmNode, _SHM_RDLCK, WIN_SHM_DMS, 1);
31147 p->pShmNode = pShmNode;
31149 p->id = pShmNode->nextShmId++;
31151 pShmNode->nRef++;
31155 /* The reference count on pShmNode has already been incremented under
31157 ** new (struct winShm) object to the pShmNode has been set. All that is
31159 ** at pShmNode->pFirst. This must be done while holding the pShmNode->mutex
31162 sqlite3_mutex_enter(pShmNode->mutex);
31163 p->pNext = pShmNode->pFirst;
31164 pShmNode->pFirst = p;
31165 sqlite3_mutex_leave(pShmNode->mutex);
31170 winShmSystemLock(pShmNode, _SHM_UNLCK, WIN_SHM_DMS, 1);
31171 winShmPurge(pDbFd->pVfs, 0); /* This call frees pShmNode if required */
31188 winShmNode *pShmNode; /* The underlying shared-memory file */
31194 pShmNode = p->pShmNode;
31197 ** with pShmNode */
31198 sqlite3_mutex_enter(pShmNode->mutex);
31199 for(pp=&pShmNode->pFirst; (*pp)!=p; pp = &(*pp)->pNext){}
31205 sqlite3_mutex_leave(pShmNode->mutex);
31207 /* If pShmNode->nRef has reached 0, then close the underlying
31210 assert( pShmNode->nRef>0 );
31211 pShmNode->nRef--;
31212 if( pShmNode->nRef==0 ){
31232 winShmNode *pShmNode = p->pShmNode;
31246 sqlite3_mutex_enter(pShmNode->mutex);
31251 for(pX=pShmNode->pFirst; pX; pX=pX->pNext){
31259 rc = winShmSystemLock(pShmNode, _SHM_UNLCK, ofst+WIN_SHM_BASE, n);
31276 for(pX=pShmNode->pFirst; pX; pX=pX->pNext){
31287 rc = winShmSystemLock(pShmNode, _SHM_RDLCK, ofst+WIN_SHM_BASE, n);
31301 for(pX=pShmNode->pFirst; pX; pX=pX->pNext){
31312 rc = winShmSystemLock(pShmNode, _SHM_WRLCK, ofst+WIN_SHM_BASE, n);
31319 sqlite3_mutex_leave(pShmNode->mutex);
31369 winShmNode *pShmNode;
31377 pShmNode = p->pShmNode;
31379 sqlite3_mutex_enter(pShmNode->mutex);
31380 assert( szRegion==pShmNode->szRegion || pShmNode->nRegion==0 );
31382 if( pShmNode->nRegion<=iRegion ){
31387 pShmNode->szRegion = szRegion;
31393 rc = winFileSize((sqlite3_file *)&pShmNode->hFile, &sz);
31407 rc = winTruncate((sqlite3_file *)&pShmNode->hFile, nByte);
31416 pShmNode->aRegion, (iRegion+1)*sizeof(apNew[0])
31422 pShmNode->aRegion = apNew;
31424 while( pShmNode->nRegion<=iRegion ){
31428 hMap = CreateFileMapping(pShmNode->hFile.h,
31432 (int)GetCurrentProcessId(), pShmNode->nRegion, nByte,
31435 int iOffset = pShmNode->nRegion*szRegion;
31441 (int)GetCurrentProcessId(), pShmNode->nRegion, iOffset, szRegion,
31445 pShmNode->lastErrno = GetLastError();
31451 pShmNode->aRegion[pShmNode->nRegion].pMap = pMap;
31452 pShmNode->aRegion[pShmNode->nRegion].hMap = hMap;
31453 pShmNode->nRegion++;
31458 if( pShmNode->nRegion>iRegion ){
31461 char *p = (char *)pShmNode->aRegion[iRegion].pMap;
31466 sqlite3_mutex_leave(pShmNode->mutex);