aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/file/fd.c
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>2000-11-10 03:53:45 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>2000-11-10 03:53:45 +0000
commit92875e6f4468b4141775518db96e8f7d88ea1e72 (patch)
tree5e143c1a628b9d0927e2e883a62939629a6826b2 /src/backend/storage/file/fd.c
parentddeab225653680c0067d86b3eb4b969126bd68ee (diff)
downloadpostgresql-92875e6f4468b4141775518db96e8f7d88ea1e72.tar.gz
postgresql-92875e6f4468b4141775518db96e8f7d88ea1e72.zip
pg_fsync is fsync in WAL version.
Diffstat (limited to 'src/backend/storage/file/fd.c')
-rw-r--r--src/backend/storage/file/fd.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 84c4e76c09d..76d2fcfd223 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.65 2000/10/28 16:20:56 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.66 2000/11/10 03:53:44 vadim Exp $
*
* NOTES:
*
@@ -192,6 +192,7 @@ static File fileNameOpenFile(FileName fileName, int fileFlags, int fileMode);
static char *filepath(char *filename);
static long pg_nofile(void);
+#ifndef XLOG
/*
* pg_fsync --- same as fsync except does nothing if -F switch was given
*/
@@ -203,6 +204,7 @@ pg_fsync(int fd)
else
return 0;
}
+#endif
/*
* BasicOpenFile --- same as open(2) except can free other FDs if needed
@@ -663,7 +665,16 @@ fileNameOpenFile(FileName fileName,
vfdP->fileFlags = fileFlags & ~(O_TRUNC | O_EXCL);
vfdP->fileMode = fileMode;
vfdP->seekPos = 0;
+#ifdef XLOG
+ /*
+ * Have to fsync file on commit. Alternative way - log
+ * file creation and fsync log before actual file creation.
+ */
+ if (fileFlags & O_CREAT)
+ vfdP->fdstate = FD_DIRTY;
+#else
vfdP->fdstate = 0x0;
+#endif
return file;
}