smb_nt_cancel.c revision ccc71be50bb49efb4e31004c77fb3e065e9c0596
2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
2N/A */
2N/A
2N/A/*
2N/A * SMB: nt_cancel
2N/A *
2N/A * This SMB allows a client to cancel a request currently pending at the
2N/A * server.
2N/A *
2N/A * Client Request Description
2N/A * ================================== =================================
2N/A *
2N/A * UCHAR WordCount; No words are sent (== 0)
2N/A * USHORT ByteCount; No bytes (==0)
2N/A *
2N/A * The Sid, Uid, Pid, Tid, and Mid fields of the SMB are used to locate an
2N/A * pending server request from this session. If a pending request is
2N/A * found, it is "hurried along" which may result in success or failure of
2N/A * the original request. No other response is generated for this SMB.
2N/A */
2N/A
2N/A#include <smbsrv/smb_kproto.h>
2N/A
2N/Asmb_sdrc_t
2N/Asmb_pre_nt_cancel(smb_request_t *sr)
2N/A{
2N/A DTRACE_SMB_1(op__NtCancel__start, smb_request_t *, sr);
2N/A return (SDRC_SUCCESS);
2N/A}
2N/A
2N/Avoid
2N/Asmb_post_nt_cancel(smb_request_t *sr)
2N/A{
DTRACE_SMB_1(op__NtCancel__done, smb_request_t *, sr);
}
smb_sdrc_t
smb_com_nt_cancel(smb_request_t *sr)
{
struct smb_request *req;
struct smb_session *session;
session = sr->session;
smb_slist_enter(&session->s_req_list);
req = smb_slist_head(&session->s_req_list);
while (req) {
ASSERT(req->sr_magic == SMB_REQ_MAGIC);
if ((req != sr) &&
(req->smb_uid == sr->smb_uid) &&
(req->smb_pid == sr->smb_pid) &&
(req->smb_tid == sr->smb_tid) &&
(req->smb_mid == sr->smb_mid)) {
smb_request_cancel(req);
}
req = smb_slist_next(&session->s_req_list, req);
}
smb_slist_exit(&session->s_req_list);
return (SDRC_NO_REPLY);
}