summaryrefslogtreecommitdiff
path: root/source3/smbd/fileio.c
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2005-09-03 07:19:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:03:30 -0500
commit93954d6390370331731bda5fcf251dc0a796c744 (patch)
tree809cb1d0377237d21df08dbc7a25c56d9fbc175a /source3/smbd/fileio.c
parent3c82e4cd444d34e0a0ca24fec2e70bad6d9ee6b4 (diff)
downloadsamba-93954d6390370331731bda5fcf251dc0a796c744.tar.gz
samba-93954d6390370331731bda5fcf251dc0a796c744.tar.bz2
samba-93954d6390370331731bda5fcf251dc0a796c744.zip
r9985: Move the all the strict sync logic into file_sync().
(This used to be commit cc680bbe22b8bfc5a1900f11c2cbaeca3a9f9922)
Diffstat (limited to 'source3/smbd/fileio.c')
-rw-r--r--source3/smbd/fileio.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 76189d114b..375bfbe7cf 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -834,15 +834,18 @@ ssize_t flush_write_cache(files_struct *fsp, enum flush_reason_enum reason)
sync a file
********************************************************************/
-void sync_file(connection_struct *conn, files_struct *fsp)
+void sync_file(connection_struct *conn, files_struct *fsp, BOOL write_through)
{
- if(lp_strict_sync(SNUM(conn)) && fsp->fh->fd != -1) {
+ if (fsp->fh->fd == -1)
+ return;
+
+ if (lp_strict_sync(SNUM(conn)) &&
+ (lp_syncalways(SNUM(conn)) || write_through)) {
flush_write_cache(fsp, SYNC_FLUSH);
SMB_VFS_FSYNC(fsp,fsp->fh->fd);
}
}
-
/************************************************************
Perform a stat whether a valid fd or not.
************************************************************/