aboutsummaryrefslogtreecommitdiff
path: root/src/test_osinst.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-07-13 18:44:03 +0000
committerdan <dan@noemail.net>2010-07-13 18:44:03 +0000
commitda9fe0c327ae952c3e16587e069a878888b3c089 (patch)
tree51672674ac3f9f56756916f34f48d0bc4663c624 /src/test_osinst.c
parent2103245e75a2b3c9eb76af75700f800d718a66a7 (diff)
downloadsqlite-da9fe0c327ae952c3e16587e069a878888b3c089.tar.gz
sqlite-da9fe0c327ae952c3e16587e069a878888b3c089.zip
Changes so that the xShmOpen VFS method is no longer required. Its job can be done by the first call to xShmMap. Rename xShmClose to xShmUnmap.
FossilOrigin-Name: f4780bde62c6c19146d2723c101540b8db898d38
Diffstat (limited to 'src/test_osinst.c')
-rw-r--r--src/test_osinst.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/test_osinst.c b/src/test_osinst.c
index d77eeafa5..25e9bcbfb 100644
--- a/src/test_osinst.c
+++ b/src/test_osinst.c
@@ -98,8 +98,7 @@
#define OS_TRUNCATE 18
#define OS_UNLOCK 19
#define OS_WRITE 20
-#define OS_SHMOPEN 21
-#define OS_SHMCLOSE 22
+#define OS_SHMUNMAP 22
#define OS_SHMMAP 23
#define OS_SHMLOCK 25
#define OS_SHMBARRIER 26
@@ -149,11 +148,10 @@ static int vfslogFileControl(sqlite3_file*, int op, void *pArg);
static int vfslogSectorSize(sqlite3_file*);
static int vfslogDeviceCharacteristics(sqlite3_file*);
-static int vfslogShmOpen(sqlite3_file *pFile);
static int vfslogShmLock(sqlite3_file *pFile, int ofst, int n, int flags);
static int vfslogShmMap(sqlite3_file *pFile,int,int,int,volatile void **);
static void vfslogShmBarrier(sqlite3_file*);
-static int vfslogShmClose(sqlite3_file *pFile, int deleteFlag);
+static int vfslogShmUnmap(sqlite3_file *pFile, int deleteFlag);
/*
** Method declarations for vfslog_vfs.
@@ -209,11 +207,10 @@ static sqlite3_io_methods vfslog_io_methods = {
vfslogFileControl, /* xFileControl */
vfslogSectorSize, /* xSectorSize */
vfslogDeviceCharacteristics, /* xDeviceCharacteristics */
- vfslogShmOpen, /* xShmOpen */
- vfslogShmLock, /* xShmLock */
vfslogShmMap, /* xShmMap */
+ vfslogShmLock, /* xShmLock */
vfslogShmBarrier, /* xShmBarrier */
- vfslogShmClose /* xShmClose */
+ vfslogShmUnmap /* xShmUnmap */
};
#if defined(SQLITE_OS_UNIX) && !defined(NO_GETTOD)
@@ -423,16 +420,6 @@ static int vfslogDeviceCharacteristics(sqlite3_file *pFile){
return rc;
}
-static int vfslogShmOpen(sqlite3_file *pFile){
- int rc;
- sqlite3_uint64 t;
- VfslogFile *p = (VfslogFile *)pFile;
- t = vfslog_time();
- rc = p->pReal->pMethods->xShmOpen(p->pReal);
- t = vfslog_time() - t;
- vfslog_call(p->pVfslog, OS_SHMOPEN, p->iFileId, t, rc, 0, 0);
- return rc;
-}
static int vfslogShmLock(sqlite3_file *pFile, int ofst, int n, int flags){
int rc;
sqlite3_uint64 t;
@@ -467,14 +454,14 @@ static void vfslogShmBarrier(sqlite3_file *pFile){
t = vfslog_time() - t;
vfslog_call(p->pVfslog, OS_SHMBARRIER, p->iFileId, t, SQLITE_OK, 0, 0);
}
-static int vfslogShmClose(sqlite3_file *pFile, int deleteFlag){
+static int vfslogShmUnmap(sqlite3_file *pFile, int deleteFlag){
int rc;
sqlite3_uint64 t;
VfslogFile *p = (VfslogFile *)pFile;
t = vfslog_time();
- rc = p->pReal->pMethods->xShmClose(p->pReal, deleteFlag);
+ rc = p->pReal->pMethods->xShmUnmap(p->pReal, deleteFlag);
t = vfslog_time() - t;
- vfslog_call(p->pVfslog, OS_SHMCLOSE, p->iFileId, t, rc, 0, 0);
+ vfslog_call(p->pVfslog, OS_SHMUNMAP, p->iFileId, t, rc, 0, 0);
return rc;
}
@@ -794,8 +781,7 @@ static const char *vfslog_eventname(int eEvent){
case OS_SLEEP: zEvent = "xSleep"; break;
case OS_CURRENTTIME: zEvent = "xCurrentTime"; break;
- case OS_SHMCLOSE: zEvent = "xShmClose"; break;
- case OS_SHMOPEN: zEvent = "xShmOpen"; break;
+ case OS_SHMUNMAP: zEvent = "xShmUnmap"; break;
case OS_SHMLOCK: zEvent = "xShmLock"; break;
case OS_SHMBARRIER: zEvent = "xShmBarrier"; break;
case OS_SHMMAP: zEvent = "xShmMap"; break;