summaryrefslogblamecommitdiffstats
path: root/fs/cifs/smb2ops.c
blob: 09530f41612306a7a69753e6b3e589b56f1fe79a (plain) (tree)



















                                                                            












                                                 

                                                  


                                            



                                               
                              
  
/*
 *  SMB2 version specific operations
 *
 *  Copyright (c) 2012, Jeff Layton <jlayton@redhat.com>
 *
 *  This library is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License v2 as published
 *  by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 *  the GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#include "cifsglob.h"
#include "smb2pdu.h"
#include "smb2proto.h"

static __u64
smb2_get_next_mid(struct TCP_Server_Info *server)
{
	__u64 mid;
	/* for SMB2 we need the current value */
	spin_lock(&GlobalMid_Lock);
	mid = server->CurrentMid++;
	spin_unlock(&GlobalMid_Lock);
	return mid;
}

struct smb_version_operations smb21_operations = {
	.setup_request = smb2_setup_request,
	.check_receive = smb2_check_receive,
	.get_next_mid = smb2_get_next_mid,
};

struct smb_version_values smb21_values = {
	.version_string = SMB21_VERSION_STRING,
	.lock_cmd = SMB2_LOCK,
};