Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
92875e6f
Commit
92875e6f
authored
Nov 10, 2000
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pg_fsync is fsync in WAL version.
parent
ddeab225
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
4 deletions
+25
-4
src/backend/storage/buffer/xlog_bufmgr.c
src/backend/storage/buffer/xlog_bufmgr.c
+4
-1
src/backend/storage/file/fd.c
src/backend/storage/file/fd.c
+12
-1
src/backend/storage/smgr/md.c
src/backend/storage/smgr/md.c
+3
-1
src/include/storage/fd.h
src/include/storage/fd.h
+6
-1
No files found.
src/backend/storage/buffer/xlog_bufmgr.c
View file @
92875e6f
...
...
@@ -8,7 +8,7 @@
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1065,6 +1065,9 @@ void
BufmgrCommit
(
void
)
{
LocalBufferSync
();
/*
* All files created in current transaction will be fsync-ed
*/
smgrcommit
();
}
...
...
src/backend/storage/file/fd.c
View file @
92875e6f
...
...
@@ -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.6
5 2000/10/28 16:20:56
vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.6
6 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
;
}
...
...
src/backend/storage/smgr/md.c
View file @
92875e6f
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.7
8 2000/11/08 22:10:00 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.7
9 2000/11/10 03:53:45 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -569,12 +569,14 @@ mdblindwrt(RelFileNode rnode,
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
)
{
...
...
src/include/storage/fd.h
View file @
92875e6f
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: fd.h,v 1.2
2 2000/06/02 03:58:31 tgl
Exp $
* $Id: fd.h,v 1.2
3 2000/11/10 03:53:45 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -70,6 +70,11 @@ extern int BasicOpenFile(FileName fileName, int fileFlags, int fileMode);
/* 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 */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment