svn commit: samba r15758 - in branches/SAMBA_4_0/source:
ntvfs/posix smb_server/smb2
metze at samba.org
metze at samba.org
Sat May 20 18:57:32 GMT 2006
Author: metze
Date: 2006-05-20 18:57:32 +0000 (Sat, 20 May 2006)
New Revision: 15758
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15758
Log:
- handle RAW_FLUSH_SMB2 in the posix ntvfs backend
- Implement SMB2 Flush
metze
Modified:
branches/SAMBA_4_0/source/ntvfs/posix/pvfs_flush.c
branches/SAMBA_4_0/source/smb_server/smb2/fileio.c
Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_flush.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_flush.c 2006-05-20 18:56:08 UTC (rev 15757)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_flush.c 2006-05-20 18:57:32 UTC (rev 15758)
@@ -48,7 +48,9 @@
switch (io->generic.level) {
case RAW_FLUSH_FLUSH:
- f = pvfs_find_fd(pvfs, req, io->flush.in.file.ntvfs);
+ case RAW_FLUSH_SMB2:
+ /* TODO: take care of io->smb2.in.unknown */
+ f = pvfs_find_fd(pvfs, req, io->generic.in.file.ntvfs);
if (!f) {
return NT_STATUS_INVALID_HANDLE;
}
Modified: branches/SAMBA_4_0/source/smb_server/smb2/fileio.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/smb2/fileio.c 2006-05-20 18:56:08 UTC (rev 15757)
+++ branches/SAMBA_4_0/source/smb_server/smb2/fileio.c 2006-05-20 18:57:32 UTC (rev 15758)
@@ -117,9 +117,35 @@
SMB2SRV_CALL_NTVFS_BACKEND(ntvfs_close(req->ntvfs, io));
}
+static void smb2srv_flush_send(struct ntvfs_request *ntvfs)
+{
+ struct smb2srv_request *req;
+ union smb_flush *io;
+
+ SMB2SRV_CHECK_ASYNC_STATUS(io, union smb_flush);
+ SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x04, False, 0));
+
+ SSVAL(req->out.body, 0x02, 0);
+
+ smb2srv_send_reply(req);
+}
+
void smb2srv_flush_recv(struct smb2srv_request *req)
{
- smb2srv_send_error(req, NT_STATUS_NOT_IMPLEMENTED);
+ union smb_flush *io;
+ uint16_t _pad;
+
+ SMB2SRV_CHECK_BODY_SIZE(req, 0x18, False);
+ SMB2SRV_TALLOC_IO_PTR(io, union smb_flush);
+ SMB2SRV_SETUP_NTVFS_REQUEST(smb2srv_flush_send, NTVFS_ASYNC_STATE_MAY_ASYNC);
+
+ io->smb2.level = RAW_FLUSH_SMB2;
+ _pad = SVAL(req->in.body, 0x02);
+ io->smb2.in.unknown = IVAL(req->in.body, 0x04);
+ io->smb2.in.file.ntvfs = smb2srv_pull_handle(req, req->in.body, 0x08);
+
+ SMB2SRV_CHECK_FILE_HANDLE(io->smb2.in.file.ntvfs);
+ SMB2SRV_CALL_NTVFS_BACKEND(ntvfs_flush(req->ntvfs, io));
}
void smb2srv_read_recv(struct smb2srv_request *req)
More information about the samba-cvs
mailing list