summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>2000-05-10 01:31:46 +0000
committerHerb Lewis <herb@samba.org>2000-05-10 01:31:46 +0000
commitc88222da0ced7edf90b68e68ec49e0fe35a512fe (patch)
tree884d6635430b8f02baa84f958fecc6fa67167889 /source3/smbd
parente522de480891b9d72ba4cd2d4c8decb6909809a9 (diff)
downloadsamba-c88222da0ced7edf90b68e68ec49e0fe35a512fe.tar.gz
samba-c88222da0ced7edf90b68e68ec49e0fe35a512fe.tar.bz2
samba-c88222da0ced7edf90b68e68ec49e0fe35a512fe.zip
Fix for misunderstanding of fsync added when vfs layer
was done. Samba was doing fsync's (bleagh). Jeremy. (This used to be commit f9a52cadbf11f7afcef754a59d783964a2edb5bc)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/fileio.c2
-rw-r--r--source3/smbd/files.c2
-rw-r--r--source3/smbd/reply.c14
3 files changed, 9 insertions, 9 deletions
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 6507f56606..79dcd8ab83 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -650,7 +650,7 @@ ssize_t flush_write_cache(files_struct *fsp, enum flush_reason_enum reason)
sync a file
********************************************************************/
-void sys_fsync_file(connection_struct *conn, files_struct *fsp)
+void sync_file(connection_struct *conn, files_struct *fsp)
{
if(lp_strict_sync(SNUM(conn)) && fsp->fd != -1) {
flush_write_cache(fsp, SYNC_FLUSH);
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 5b930f9940..a4837a1a8b 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -283,7 +283,7 @@ void file_sync_all(connection_struct *conn)
for (fsp=Files;fsp;fsp=next) {
next=fsp->next;
if ((conn == fsp->conn) && (fsp->fd != -1)) {
- conn->vfs_ops.fsync(fsp->fd);
+ sync_file(conn,fsp);
}
}
}
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index b09e09bc6d..2072667174 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2352,7 +2352,7 @@ int reply_writebraw(connection_struct *conn, char *inbuf,char *outbuf, int size,
if ((lp_syncalways(SNUM(conn)) || write_through) &&
lp_strict_sync(SNUM(conn)))
- conn->vfs_ops.fsync(fsp->fd);
+ sync_file(conn,fsp);
DEBUG(3,("writebraw2 fnum=%d start=%.0f num=%d wrote=%d\n",
fsp->fnum, (double)startpos, (int)numtowrite,(int)total_written));
@@ -2400,7 +2400,7 @@ int reply_writeunlock(connection_struct *conn, char *inbuf,char *outbuf, int siz
nwritten = write_file(fsp,data,startpos,numtowrite);
if (lp_syncalways(SNUM(conn)))
- conn->vfs_ops.fsync(fsp->fd);
+ sync_file(conn,fsp);
if(((nwritten == 0) && (numtowrite != 0))||(nwritten < 0))
return(UNIXERROR(ERRDOS,ERRnoaccess));
@@ -2455,7 +2455,7 @@ int reply_write(connection_struct *conn, char *inbuf,char *outbuf,int size,int d
nwritten = write_file(fsp,data,startpos,numtowrite);
if (lp_syncalways(SNUM(conn)))
- conn->vfs_ops.fsync(fsp->fd);
+ sync_file(conn,fsp);
if(((nwritten == 0) && (numtowrite != 0))||(nwritten < 0))
return(UNIXERROR(ERRDOS,ERRnoaccess));
@@ -2552,7 +2552,7 @@ int reply_write_and_X(connection_struct *conn, char *inbuf,char *outbuf,int leng
fsp->fnum, (int)numtowrite, (int)nwritten));
if (lp_syncalways(SNUM(conn)) || write_through)
- conn->vfs_ops.fsync(fsp->fd);
+ sync_file(conn,fsp);
return chain_reply(inbuf,outbuf,length,bufsize);
}
@@ -2649,7 +2649,7 @@ int reply_flush(connection_struct *conn, char *inbuf,char *outbuf, int size, int
if (!fsp) {
file_sync_all(conn);
} else {
- conn->vfs_ops.fsync(fsp->fd);
+ sync_file(conn,fsp);
}
DEBUG(3,("flush\n"));
@@ -4246,7 +4246,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)
- conn->vfs_ops.fsync(fsp->fd);
+ sync_file(conn,fsp);
if(nwritten < (ssize_t)numtowrite)
return(UNIXERROR(ERRHRD,ERRdiskfull));
@@ -4347,7 +4347,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)
- conn->vfs_ops.fsync(fsp->fd);
+ sync_file(conn,fsp);
if (nwritten < (ssize_t)numtowrite)
{