/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
*/
/*
* Dispatch function for SMB2_WRITE
*/
#include <smbsrv/smb2_kproto.h>
#include <smbsrv/smb_fsops.h>
{
int stability = 0;
int rc = 0;
/*
* SMB2 Write request
*/
"wwlqqqllwwl",
&StructSize, /* w */
&DataOff, /* w */
&Length, /* l */
&Offset, /* q */
&Channel, /* l */
&Remaining, /* l */
&ChanInfoOffset, /* w */
&ChanInfoLength, /* w */
&Flags); /* l */
if (rc)
return (SDRC_ERROR);
if (StructSize != 49)
return (SDRC_ERROR);
if (status) {
return (SDRC_SUCCESS);
}
if (Length > smb2_max_rwsize) {
return (SDRC_SUCCESS);
}
/*
* Skip any padding before the write data.
*/
if (skip < 0) {
return (SDRC_SUCCESS);
}
if (skip > 0) {
}
/* This is automatically free'd. */
return (SDRC_SUCCESS);
}
XferCount = 0;
if (Length == 0)
goto doreply;
case STYPE_DISKTREE:
case STYPE_PRINTQ:
/* Check for conflicting locks. */
if (rc) {
break;
}
}
if ((Flags & SMB2_WRITEFLAG_WRITE_THROUGH) ||
}
if (rc)
break;
break;
case STYPE_IPC:
if (rc == 0)
break;
default:
break;
}
if (rc) {
return (SDRC_SUCCESS);
}
/*
* SMB2 Write reply
*/
17, /* StructSize */ /* w */
0, /* reserved */ /* w */
XferCount, /* l */
0, /* DataRemaining */ /* l */
0); /* Channel Info */ /* l */
if (rc)
return (SDRC_ERROR);
return (SDRC_SUCCESS);
}