summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorBruce Momjian2005-05-20 14:53:26 +0000
committerBruce Momjian2005-05-20 14:53:26 +0000
commit6dc7760ac3c3aeb766f489121f39d26d6f9b8c46 (patch)
tree80ff258fc03e57f9dc823803f17a6b3bc6d602f4 /src/include
parente9b33ed6cdc788ddcc6a7887d203574a5a346172 (diff)
Add support for wal_fsync_writethrough for Darwin, and restructure the
code to better handle writethrough. Chris Campbell
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/xlog.h9
-rw-r--r--src/include/port/darwin.h3
-rw-r--r--src/include/port/win32.h6
-rw-r--r--src/include/storage/fd.h4
4 files changed, 17 insertions, 5 deletions
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
index 27a076c7e0d..ab471738970 100644
--- a/src/include/access/xlog.h
+++ b/src/include/access/xlog.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.60 2005/04/28 21:47:17 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.61 2005/05/20 14:53:26 momjian Exp $
*/
#ifndef XLOG_H
#define XLOG_H
@@ -75,6 +75,13 @@ typedef struct XLogRecord
*/
#define XLOG_NO_TRAN XLR_INFO_MASK
+/* Sync methods */
+#define SYNC_METHOD_FSYNC 0
+#define SYNC_METHOD_FDATASYNC 1
+#define SYNC_METHOD_OPEN 2 /* for O_SYNC and O_DSYNC */
+#define SYNC_METHOD_FSYNC_WRITETHROUGH 3
+extern int sync_method;
+
/*
* List of these structs is used to pass data to XLogInsert().
*
diff --git a/src/include/port/darwin.h b/src/include/port/darwin.h
index 06c559d2ba8..0a802e5abbb 100644
--- a/src/include/port/darwin.h
+++ b/src/include/port/darwin.h
@@ -1 +1,4 @@
#define __darwin__ 1
+
+#define HAVE_FSYNC_WRITETHROUGH
+
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index de2483add01..c551b78ebdf 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.44 2005/03/24 04:36:19 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.45 2005/05/20 14:53:26 momjian Exp $ */
/* undefine and redefine after #include */
#undef mkdir
@@ -16,8 +16,8 @@
#define mkdir(a,b) mkdir(a)
-#define fsync(a) _commit(a)
-#define FSYNC_IS_WRITE_THROUGH
+#define HAVE_FSYNC_WRITETHROUGH
+#define HAVE_FSYNC_WRITETHROUGH_ONLY
#define ftruncate(a,b) chsize(a,b)
#define USES_WINSOCK
diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h
index 74a05d5aae6..20c2c64c898 100644
--- a/src/include/storage/fd.h
+++ b/src/include/storage/fd.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/fd.h,v 1.50 2004/12/31 22:03:42 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/storage/fd.h,v 1.51 2005/05/20 14:53:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -89,6 +89,8 @@ extern void AtEOSubXact_Files(bool isCommit, SubTransactionId mySubid,
SubTransactionId parentSubid);
extern void RemovePgTempFiles(void);
extern int pg_fsync(int fd);
+extern int pg_fsync_no_writethrough(int fd);
+extern int pg_fsync_writethrough(int fd);
extern int pg_fdatasync(int fd);
/* Filename components for OpenTemporaryFile */