*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/xlog_bufmgr.c,v 1.2 2000/11/08 22:09:59 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/xlog_bufmgr.c,v 1.3 2000/11/10 03:53:44 vadim Exp $
*
*-------------------------------------------------------------------------
*/
BufmgrCommit(void)
{
LocalBufferSync();
+ /*
+ * All files created in current transaction will be fsync-ed
+ */
smgrcommit();
}
* 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:
*
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
*/
else
return 0;
}
+#endif
/*
* BasicOpenFile --- same as open(2) except can free other FDs if needed
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;
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.78 2000/11/08 22:10:00 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.79 2000/11/10 03:53:45 vadim Exp $
*
*-------------------------------------------------------------------------
*/
elog(DEBUG, "mdblindwrt: write() failed: %m");
status = SM_FAIL;
}
+#ifndef XLOG
else if (dofsync &&
pg_fsync(fd) < 0)
{
elog(DEBUG, "mdblindwrt: fsync() failed: %m");
status = SM_FAIL;
}
+#endif
if (close(fd) < 0)
{
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: fd.h,v 1.22 2000/06/02 03:58:31 tgl Exp $
+ * $Id: fd.h,v 1.23 2000/11/10 03:53:45 vadim Exp $
*
*-------------------------------------------------------------------------
*/
/* Miscellaneous support routines */
extern void closeAllVfds(void);
extern void AtEOXact_Files(void);
+
+#ifdef XLOG
+#define pg_fsync(fd) fsync(fd)
+#else
extern int pg_fsync(int fd);
+#endif
#endif /* FD_H */