summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.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/reply.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/reply.c')
-rw-r--r--source3/smbd/reply.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index e96c3dc01f..9050006653 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2786,8 +2786,7 @@ int reply_writebraw(connection_struct *conn, char *inbuf,char *outbuf, int size,
SSVAL(outbuf,smb_vwv0,total_written);
- if ((lp_syncalways(SNUM(conn)) || write_through) && lp_strict_sync(SNUM(conn)))
- sync_file(conn,fsp);
+ sync_file(conn, fsp, write_through);
DEBUG(3,("writebraw2 fnum=%d start=%.0f num=%d wrote=%d\n",
fsp->fnum, (double)startpos, (int)numtowrite,(int)total_written));
@@ -2852,8 +2851,7 @@ int reply_writeunlock(connection_struct *conn, char *inbuf,char *outbuf,
nwritten = write_file(fsp,data,startpos,numtowrite);
}
- if (lp_syncalways(SNUM(conn)))
- sync_file(conn,fsp);
+ sync_file(conn, fsp, False /* write through */);
if(((nwritten == 0) && (numtowrite != 0))||(nwritten < 0)) {
END_PROFILE(SMBwriteunlock);
@@ -2940,8 +2938,7 @@ int reply_write(connection_struct *conn, char *inbuf,char *outbuf,int size,int d
} else
nwritten = write_file(fsp,data,startpos,numtowrite);
- if (lp_syncalways(SNUM(conn)))
- sync_file(conn,fsp);
+ sync_file(conn, fsp, False);
if(((nwritten == 0) && (numtowrite != 0))||(nwritten < 0)) {
END_PROFILE(SMBwrite);
@@ -3068,8 +3065,7 @@ int reply_write_and_X(connection_struct *conn, char *inbuf,char *outbuf,int leng
DEBUG(3,("writeX fnum=%d num=%d wrote=%d\n",
fsp->fnum, (int)numtowrite, (int)nwritten));
- if (lp_syncalways(SNUM(conn)) || write_through)
- sync_file(conn,fsp);
+ sync_file(conn, fsp, write_through);
END_PROFILE(SMBwriteX);
return chain_reply(inbuf,outbuf,length,bufsize);
@@ -3166,7 +3162,7 @@ int reply_flush(connection_struct *conn, char *inbuf,char *outbuf, int size, int
if (!fsp) {
file_sync_all(conn);
} else {
- sync_file(conn,fsp);
+ sync_file(conn,fsp, True);
}
DEBUG(3,("flush\n"));
@@ -5433,8 +5429,7 @@ int reply_writebmpx(connection_struct *conn, char *inbuf,char *outbuf, int size,
nwritten = write_file(fsp,data,startpos,numtowrite);
- if(lp_syncalways(SNUM(conn)) || write_through)
- sync_file(conn,fsp);
+ sync_file(conn, fsp, write_through);
if(nwritten < (ssize_t)numtowrite) {
END_PROFILE(SMBwriteBmpx);
@@ -5546,8 +5541,7 @@ int reply_writebs(connection_struct *conn, char *inbuf,char *outbuf, int dum_siz
nwritten = write_file(fsp,data,startpos,numtowrite);
- if(lp_syncalways(SNUM(conn)) || write_through)
- sync_file(conn,fsp);
+ sync_file(conn, fsp, write_through);
if (nwritten < (ssize_t)numtowrite) {
if(write_through) {