smb_close.c revision bbf6f00c25b6a2bed23c35eac6d62998ecdb338c
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Common Development and Distribution License (the "License").
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You may not use this file except in compliance with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER END
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Close a file by fid. All locks or other resources held by the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * requesting process on the file should be released by the server.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The requesting process can no longer use the fid for further
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file access requests.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If LastWriteTime is non-zero, it should be used to set the file
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * timestamp. Otherwise, file system should set the timestamp.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Failure to set the timestamp, even if requested by the client,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * should not result in an error response from the server.
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb rc = smbsr_decode_vwv(sr, "wl", &sr->smb_fid, &sr->arg.timestamp);
dc20a3024900c47dd2ee44b9707e6df38f7d62a5as smbsr_error(sr, NT_STATUS_INVALID_HANDLE, ERRDOS, ERRbadfid);
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego smb_ofile_close(sr->fid_ofile, sr->arg.timestamp);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Close the file represented by fid and then disconnect the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * associated tree.
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb rc = smbsr_decode_vwv(sr, "wl", &sr->smb_fid, &sr->arg.timestamp);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb DTRACE_SMB_1(op__CloseAndTreeDisconnect__start, smb_request_t *, sr);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb DTRACE_SMB_1(op__CloseAndTreeDisconnect__done, smb_request_t *, sr);
dc20a3024900c47dd2ee44b9707e6df38f7d62a5as smbsr_error(sr, NT_STATUS_INVALID_HANDLE, ERRDOS, ERRbadfid);
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego smb_ofile_close(sr->fid_ofile, sr->arg.timestamp);