summaryrefslogtreecommitdiff
path: root/src/backend/storage/smgr/mm.c
diff options
context:
space:
mode:
authorTom Lane2002-08-06 02:36:35 +0000
committerTom Lane2002-08-06 02:36:35 +0000
commit5df307c7782518c4a3c19ffd05c7cb591b97e23c (patch)
tree0ff988dc5b7b115e9f6bbf29852dd4bad7fcaeea /src/backend/storage/smgr/mm.c
parent35cd432b185938c33967c9fa48223ce33e1c66bd (diff)
Restructure local-buffer handling per recent pghackers discussion.
The local buffer manager is no longer used for newly-created relations (unless they are TEMP); a new non-TEMP relation goes through the shared bufmgr and thus will participate normally in checkpoints. But TEMP relations use the local buffer manager throughout their lifespan. Also, operations in TEMP relations are not logged in WAL, thus improving performance. Since it's no longer necessary to fsync relations as they move out of the local buffers into shared buffers, quite a lot of smgr.c/md.c/fd.c code is no longer needed and has been removed: there's no concept of a dirty relation anymore in md.c/fd.c, and we never fsync anything but WAL. Still TODO: improve local buffer management algorithms so that it would be reasonable to increase NLocBuffer.
Diffstat (limited to 'src/backend/storage/smgr/mm.c')
-rw-r--r--src/backend/storage/smgr/mm.c35
1 files changed, 10 insertions, 25 deletions
diff --git a/src/backend/storage/smgr/mm.c b/src/backend/storage/smgr/mm.c
index 89396d173c9..739e938fe28 100644
--- a/src/backend/storage/smgr/mm.c
+++ b/src/backend/storage/smgr/mm.c
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/smgr/Attic/mm.c,v 1.31 2002/06/20 20:29:36 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/Attic/mm.c,v 1.32 2002/08/06 02:36:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -81,7 +81,7 @@ static HTAB *MMCacheHT;
static HTAB *MMRelCacheHT;
int
-mminit()
+mminit(void)
{
char *mmcacheblk;
int mmsize = 0;
@@ -151,7 +151,7 @@ mminit()
}
int
-mmshutdown()
+mmshutdown(void)
{
return SM_SUCCESS;
}
@@ -443,30 +443,15 @@ mmwrite(Relation reln, BlockNumber blocknum, char *buffer)
}
/*
- * mmflush() -- Synchronously write a block to stable storage.
- *
- * For main-memory relations, this is exactly equivalent to mmwrite().
- */
-int
-mmflush(Relation reln, BlockNumber blocknum, char *buffer)
-{
- return mmwrite(reln, blocknum, buffer);
-}
-
-/*
* mmblindwrt() -- Write a block to stable storage blind.
*
- * We have to be able to do this using only the name and OID of
- * the database and relation in which the block belongs.
+ * We have to be able to do this using only the rnode of the relation
+ * in which the block belongs. Otherwise this is much like mmwrite().
*/
int
-mmblindwrt(char *dbstr,
- char *relstr,
- Oid dbid,
- Oid relid,
+mmblindwrt(RelFileNode rnode,
BlockNumber blkno,
- char *buffer,
- bool dofsync)
+ char *buffer)
{
return SM_FAIL;
}
@@ -512,7 +497,7 @@ mmnblocks(Relation reln)
* Returns SM_SUCCESS or SM_FAIL with errno set as appropriate.
*/
int
-mmcommit()
+mmcommit(void)
{
return SM_SUCCESS;
}
@@ -522,7 +507,7 @@ mmcommit()
*/
int
-mmabort()
+mmabort(void)
{
return SM_SUCCESS;
}
@@ -536,7 +521,7 @@ mmabort()
* manager will use.
*/
int
-MMShmemSize()
+MMShmemSize(void)
{
int size = 0;