diff options
Diffstat (limited to 'source4/ntvfs')
-rw-r--r-- | source4/ntvfs/nbench/vfs_nbench.c | 13 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_flush.c | 22 | ||||
-rw-r--r-- | source4/ntvfs/simple/vfs_simple.c | 18 |
3 files changed, 40 insertions, 13 deletions
diff --git a/source4/ntvfs/nbench/vfs_nbench.c b/source4/ntvfs/nbench/vfs_nbench.c index 77de979153..963d422cf0 100644 --- a/source4/ntvfs/nbench/vfs_nbench.c +++ b/source4/ntvfs/nbench/vfs_nbench.c @@ -534,10 +534,19 @@ static NTSTATUS nbench_seek(struct ntvfs_module_context *ntvfs, static void nbench_flush_send(struct ntvfs_request *req) { union smb_flush *io = req->async_states->private_data; + uint16_t fnum; + + switch (io->generic.level) { + case RAW_FLUSH_FLUSH: + fnum = io->flush.in.file.fnum; + break; + case RAW_FLUSH_ALL: + fnum = 0xFFFF; + break; + } nbench_log(req, "Flush %d %s\n", - io->flush.in.file.fnum, - get_nt_error_c_code(req->async_states->status)); + fnum, get_nt_error_c_code(req->async_states->status)); PASS_THRU_REP_POST(req); } diff --git a/source4/ntvfs/posix/pvfs_flush.c b/source4/ntvfs/posix/pvfs_flush.c index d21f257201..c1d8820c43 100644 --- a/source4/ntvfs/posix/pvfs_flush.c +++ b/source4/ntvfs/posix/pvfs_flush.c @@ -46,23 +46,27 @@ NTSTATUS pvfs_flush(struct ntvfs_module_context *ntvfs, struct pvfs_state *pvfs = ntvfs->private_data; struct pvfs_file *f; - if (io->flush.in.file.fnum != 0xFFFF) { + switch (io->generic.level) { + case RAW_FLUSH_FLUSH: f = pvfs_find_fd(pvfs, req, io->flush.in.file.fnum); if (!f) { return NT_STATUS_INVALID_HANDLE; } pvfs_flush_file(pvfs, f); return NT_STATUS_OK; - } - if (!(pvfs->flags & PVFS_FLAG_STRICT_SYNC)) { - return NT_STATUS_OK; - } + case RAW_FLUSH_ALL: + if (!(pvfs->flags & PVFS_FLAG_STRICT_SYNC)) { + return NT_STATUS_OK; + } - /* they are asking to flush all open files */ - for (f=pvfs->files.list;f;f=f->next) { - pvfs_flush_file(pvfs, f); + /* they are asking to flush all open files */ + for (f=pvfs->files.list;f;f=f->next) { + pvfs_flush_file(pvfs, f); + } + + return NT_STATUS_OK; } - return NT_STATUS_OK; + return NT_STATUS_INVALID_LEVEL; } diff --git a/source4/ntvfs/simple/vfs_simple.c b/source4/ntvfs/simple/vfs_simple.c index 35c18e3f1c..1698f57aee 100644 --- a/source4/ntvfs/simple/vfs_simple.c +++ b/source4/ntvfs/simple/vfs_simple.c @@ -549,8 +549,22 @@ static NTSTATUS svfs_flush(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_flush *io) { - fsync(io->flush.in.file.fnum); - return NT_STATUS_OK; + struct svfs_private *private = ntvfs->private_data; + struct svfs_file *f; + + switch (io->generic.level) { + case RAW_FLUSH_FLUSH: + fsync(io->flush.in.file.fnum); + return NT_STATUS_OK; + + case RAW_FLUSH_ALL: + for (f=private->open_files;f;f=f->next) { + fsync(f->fd); + } + return NT_STATUS_OK; + } + + return NT_STATUS_INVALID_LEVEL; } /* |