diff options
author | James Peach <jpeach@samba.org> | 2005-09-03 07:19:28 +0000 |
---|---|---|
committer | James Peach <jpeach@samba.org> | 2005-09-03 07:19:28 +0000 |
commit | 016d1669f46f4ce785d3e989c6d87eff2b22acad (patch) | |
tree | efff4136de29936be91bb414edb8cd7b1a4064e2 /source/smbd/fileio.c | |
parent | c575e198862a6b3aad677488c486a1922f98ff07 (diff) | |
download | samba-016d1669f46f4ce785d3e989c6d87eff2b22acad.tar.gz samba-016d1669f46f4ce785d3e989c6d87eff2b22acad.tar.xz samba-016d1669f46f4ce785d3e989c6d87eff2b22acad.zip |
r9985: Move the all the strict sync logic into file_sync().
Diffstat (limited to 'source/smbd/fileio.c')
-rw-r--r-- | source/smbd/fileio.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/smbd/fileio.c b/source/smbd/fileio.c index 76189d114bb..375bfbe7cf3 100644 --- a/source/smbd/fileio.c +++ b/source/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. ************************************************************/ |