linux/fs/smb/client/cifsglob.h

/* SPDX-License-Identifier: LGPL-2.1 */
/*
 *
 *   Copyright (C) International Business Machines  Corp., 2002,2008
 *   Author(s): Steve French ([email protected])
 *              Jeremy Allison ([email protected])
 *
 */
#ifndef _CIFS_GLOB_H
#define _CIFS_GLOB_H

#include <linux/in.h>
#include <linux/in6.h>
#include <linux/inet.h>
#include <linux/slab.h>
#include <linux/scatterlist.h>
#include <linux/mm.h>
#include <linux/mempool.h>
#include <linux/workqueue.h>
#include <linux/utsname.h>
#include <linux/sched/mm.h>
#include <linux/netfs.h>
#include "cifs_fs_sb.h"
#include "cifsacl.h"
#include <crypto/internal/hash.h>
#include <uapi/linux/cifs/cifs_mount.h>
#include "../common/smb2pdu.h"
#include "smb2pdu.h"
#include <linux/filelock.h>

#define SMB_PATH_MAX
#define CIFS_PORT
#define RFC1001_PORT

/*
 * The sizes of various internal tables and strings
 */
#define MAX_UID_INFO
#define MAX_SES_INFO
#define MAX_TCON_INFO

#define MAX_TREE_SIZE

#define CIFS_MIN_RCV_POOL

#define MAX_REOPEN_ATT
/*
 * default attribute cache timeout (jiffies)
 */
#define CIFS_DEF_ACTIMEO

/*
 * max sleep time before retry to server
 */
#define CIFS_MAX_SLEEP

/*
 * max attribute cache timeout (jiffies) - 2^30
 */
#define CIFS_MAX_ACTIMEO

/*
 * Max persistent and resilient handle timeout (milliseconds).
 * Windows durable max was 960000 (16 minutes)
 */
#define SMB3_MAX_HANDLE_TIMEOUT

/*
 * MAX_REQ is the maximum number of requests that WE will send
 * on one socket concurrently.
 */
#define CIFS_MAX_REQ

#define RFC1001_NAME_LEN
#define RFC1001_NAME_LEN_WITH_NULL

/* maximum length of ip addr as a string (including ipv6 and sctp) */
#define SERVER_NAME_LENGTH
#define SERVER_NAME_LEN_WITH_NULL

/* echo interval in seconds */
#define SMB_ECHO_INTERVAL_MIN
#define SMB_ECHO_INTERVAL_MAX
#define SMB_ECHO_INTERVAL_DEFAULT

/* smb multichannel query server interfaces interval in seconds */
#define SMB_INTERFACE_POLL_INTERVAL

/* maximum number of PDUs in one compound */
#define MAX_COMPOUND

/*
 * Default number of credits to keep available for SMB3.
 * This value is chosen somewhat arbitrarily. The Windows client
 * defaults to 128 credits, the Windows server allows clients up to
 * 512 credits (or 8K for later versions), and the NetApp server
 * does not limit clients at all.  Choose a high enough default value
 * such that the client shouldn't limit performance, but allow mount
 * to override (until you approach 64K, where we limit credits to 65000
 * to reduce possibility of seeing more server credit overflow bugs.
 */
#define SMB2_MAX_CREDITS_AVAILABLE

#include "cifspdu.h"

#ifndef XATTR_DOS_ATTRIB
#define XATTR_DOS_ATTRIB
#endif

#define CIFS_MAX_WORKSTATION_LEN

#define CIFS_DFS_ROOT_SES(ses)

/*
 * CIFS vfs client Status information (based on what we know.)
 */

/* associated with each connection */
enum statusEnum {};

/* associated with each smb session */
enum ses_status_enum {};

/* associated with each tree connection to the server */
enum tid_status_enum {};

enum securityEnum {};

enum cifs_reparse_type {};

static inline const char *cifs_reparse_type_str(enum cifs_reparse_type type)
{}

struct session_key {};

/* crypto hashing related structure/fields, not specific to a sec mech */
struct cifs_secmech {};

/* per smb session structure/fields */
struct ntlmssp_auth {};

struct cifs_cred {};

struct cifs_open_info_data {};

/*
 *****************************************************************
 * Except the CIFS PDUs themselves all the
 * globally interesting structs should go here
 *****************************************************************
 */

/*
 * A smb_rqst represents a complete request to be issued to a server. It's
 * formed by a kvec array, followed by an array of pages. Page data is assumed
 * to start at the beginning of the first page.
 */
struct smb_rqst {};

struct mid_q_entry;
struct TCP_Server_Info;
struct cifsFileInfo;
struct cifs_ses;
struct cifs_tcon;
struct dfs_info3_param;
struct cifs_fattr;
struct smb3_fs_context;
struct cifs_fid;
struct cifs_io_subrequest;
struct cifs_io_parms;
struct cifs_search_info;
struct cifsInodeInfo;
struct cifs_open_parms;
struct cifs_credits;

struct smb_version_operations {};

struct smb_version_values {};

#define HEADER_SIZE(server)
#define MAX_HEADER_SIZE(server)
#define HEADER_PREAMBLE_SIZE(server)
#define MID_HEADER_SIZE(server)

/**
 * CIFS superblock mount flags (mnt_cifs_flags) to consider when
 * trying to reuse existing superblock for a new mount
 */
#define CIFS_MOUNT_MASK

/**
 * Generic VFS superblock mount flags (s_flags) to consider when
 * trying to reuse existing superblock for a new mount
 */
#define CIFS_MS_MASK

struct cifs_mnt_data {};

static inline unsigned int
get_rfc1002_length(void *buf)
{}

static inline void
inc_rfc1001_len(void *buf, int count)
{}

struct TCP_Server_Info {};

static inline bool is_smb1(struct TCP_Server_Info *server)
{}

static inline void cifs_server_lock(struct TCP_Server_Info *server)
{}

static inline void cifs_server_unlock(struct TCP_Server_Info *server)
{}

struct cifs_credits {};

static inline unsigned int
in_flight(struct TCP_Server_Info *server)
{}

static inline bool
has_credits(struct TCP_Server_Info *server, int *credits, int num_credits)
{}

static inline void
add_credits(struct TCP_Server_Info *server, struct cifs_credits *credits,
	    const int optype)
{}

static inline void
add_credits_and_wake_if(struct TCP_Server_Info *server,
			struct cifs_credits *credits, const int optype)
{}

static inline void
set_credits(struct TCP_Server_Info *server, const int val)
{}

static inline int
adjust_credits(struct TCP_Server_Info *server, struct cifs_io_subrequest *subreq,
	       unsigned int /* enum smb3_rw_credits_trace */ trace)
{}

static inline __le64
get_next_mid64(struct TCP_Server_Info *server)
{}

static inline __le16
get_next_mid(struct TCP_Server_Info *server)
{}

static inline void
revert_current_mid(struct TCP_Server_Info *server, const unsigned int val)
{}

static inline void
revert_current_mid_from_hdr(struct TCP_Server_Info *server,
			    const struct smb2_hdr *shdr)
{}

static inline __u16
get_mid(const struct smb_hdr *smb)
{}

static inline bool
compare_mid(__u16 mid, const struct smb_hdr *smb)
{}

/*
 * When the server supports very large reads and writes via POSIX extensions,
 * we can allow up to 2^24-1, minus the size of a READ/WRITE_AND_X header, not
 * including the RFC1001 length.
 *
 * Note that this might make for "interesting" allocation problems during
 * writeback however as we have to allocate an array of pointers for the
 * pages. A 16M write means ~32kb page array with PAGE_SIZE == 4096.
 *
 * For reads, there is a similar problem as we need to allocate an array
 * of kvecs to handle the receive, though that should only need to be done
 * once.
 */
#define CIFS_MAX_WSIZE
#define CIFS_MAX_RSIZE

/*
 * When the server doesn't allow large posix writes, only allow a rsize/wsize
 * of 2^17-1 minus the size of the call header. That allows for a read or
 * write up to the maximum size described by RFC1002.
 */
#define CIFS_MAX_RFC1002_WSIZE
#define CIFS_MAX_RFC1002_RSIZE

#define CIFS_DEFAULT_IOSIZE

/*
 * Windows only supports a max of 60kb reads and 65535 byte writes. Default to
 * those values when posix extensions aren't in force. In actuality here, we
 * use 65536 to allow for a write that is a multiple of 4k. Most servers seem
 * to be ok with the extra byte even though Windows doesn't send writes that
 * are that large.
 *
 * Citation:
 *
 * https://blogs.msdn.com/b/openspecification/archive/2009/04/10/smb-maximum-transmit-buffer-size-and-performance-tuning.aspx
 */
#define CIFS_DEFAULT_NON_POSIX_RSIZE
#define CIFS_DEFAULT_NON_POSIX_WSIZE

/*
 * Macros to allow the TCP_Server_Info->net field and related code to drop out
 * when CONFIG_NET_NS isn't set.
 */

#ifdef CONFIG_NET_NS

static inline struct net *cifs_net_ns(struct TCP_Server_Info *srv)
{}

static inline void cifs_set_net_ns(struct TCP_Server_Info *srv, struct net *net)
{}

#else

static inline struct net *cifs_net_ns(struct TCP_Server_Info *srv)
{
	return &init_net;
}

static inline void cifs_set_net_ns(struct TCP_Server_Info *srv, struct net *net)
{
}

#endif

struct cifs_server_iface {};

/* release iface when last ref is dropped */
static inline void
release_iface(struct kref *ref)
{}

struct cifs_chan {};

#define CIFS_SES_FLAG_SCALE_CHANNELS

/*
 * Session structure.  One of these for each uid session with a particular host
 */
struct cifs_ses {};

static inline bool
cap_unix(struct cifs_ses *ses)
{}

/*
 * common struct for holding inode info when searching for or updating an
 * inode with new info
 */

#define CIFS_FATTR_JUNCTION
#define CIFS_FATTR_DELETE_PENDING
#define CIFS_FATTR_NEED_REVAL
#define CIFS_FATTR_INO_COLLISION
#define CIFS_FATTR_UNKNOWN_NLINK
#define CIFS_FATTR_FAKE_ROOT_INO

struct cifs_fattr {};

/*
 * there is one of these for each connection to a resource on a particular
 * session
 */
struct cifs_tcon {};

/*
 * This is a refcounted and timestamped container for a tcon pointer. The
 * container holds a tcon reference. It is considered safe to free one of
 * these when the tl_count goes to 0. The tl_time is the time of the last
 * "get" on the container.
 */
struct tcon_link {};

extern struct tcon_link *cifs_sb_tlink(struct cifs_sb_info *cifs_sb);
extern void smb3_free_compound_rqst(int num_rqst, struct smb_rqst *rqst);

static inline struct cifs_tcon *
tlink_tcon(struct tcon_link *tlink)
{}

static inline struct tcon_link *
cifs_sb_master_tlink(struct cifs_sb_info *cifs_sb)
{}

extern void cifs_put_tlink(struct tcon_link *tlink);

static inline struct tcon_link *
cifs_get_tlink(struct tcon_link *tlink)
{}

/* This function is always expected to succeed */
extern struct cifs_tcon *cifs_sb_master_tcon(struct cifs_sb_info *cifs_sb);

#define CIFS_OPLOCK_NO_CHANGE

struct cifs_pending_open {};

struct cifs_deferred_close {};

/*
 * This info hangs off the cifsFileInfo structure, pointed to by llist.
 * This is used to track byte stream locks on the file
 */
struct cifsLockInfo {};

/*
 * One of these for each open instance of a file
 */
struct cifs_search_info {};

#define ACL_NO_MODE
struct cifs_open_parms {};

struct cifs_fid {};

struct cifs_fid_locks {};

struct cifsFileInfo {};

struct cifs_io_parms {};

struct cifs_io_request {};

/* asynchronous read support */
struct cifs_io_subrequest {};

/*
 * Take a reference on the file private data. Must be called with
 * cfile->file_info_lock held.
 */
static inline void
cifsFileInfo_get_locked(struct cifsFileInfo *cifs_file)
{}

struct cifsFileInfo *cifsFileInfo_get(struct cifsFileInfo *cifs_file);
void _cifsFileInfo_put(struct cifsFileInfo *cifs_file, bool wait_oplock_hdlr,
		       bool offload);
void cifsFileInfo_put(struct cifsFileInfo *cifs_file);

#define CIFS_CACHE_READ_FLG
#define CIFS_CACHE_HANDLE_FLG
#define CIFS_CACHE_RH_FLG
#define CIFS_CACHE_WRITE_FLG
#define CIFS_CACHE_RW_FLG
#define CIFS_CACHE_RHW_FLG

#define CIFS_CACHE_READ(cinode)
#define CIFS_CACHE_HANDLE(cinode)
#define CIFS_CACHE_WRITE(cinode)

/*
 * One of these for each file inode
 */

struct cifsInodeInfo {};

static inline struct cifsInodeInfo *
CIFS_I(struct inode *inode)
{}

static inline struct cifs_sb_info *
CIFS_SB(struct super_block *sb)
{}

static inline struct cifs_sb_info *
CIFS_FILE_SB(struct file *file)
{}

static inline char CIFS_DIR_SEP(const struct cifs_sb_info *cifs_sb)
{}

static inline void
convert_delimiter(char *path, char delim)
{}

#define cifs_stats_inc

static inline void cifs_stats_bytes_written(struct cifs_tcon *tcon,
					    unsigned int bytes)
{}

static inline void cifs_stats_bytes_read(struct cifs_tcon *tcon,
					 unsigned int bytes)
{}


/*
 * This is the prototype for the mid receive function. This function is for
 * receiving the rest of the SMB frame, starting with the WordCount (which is
 * just after the MID in struct smb_hdr). Note:
 *
 * - This will be called by cifsd, with no locks held.
 * - The mid will still be on the pending_mid_q.
 * - mid->resp_buf will point to the current buffer.
 *
 * Returns zero on a successful receive, or an error. The receive state in
 * the TCP_Server_Info will also be updated.
 */
mid_receive_t;

/*
 * This is the prototype for the mid callback function. This is called once the
 * mid has been received off of the socket. When creating one, take special
 * care to avoid deadlocks. Things to bear in mind:
 *
 * - it will be called by cifsd, with no locks held
 * - the mid will be removed from any lists
 */
mid_callback_t;

/*
 * This is the protopyte for mid handle function. This is called once the mid
 * has been recognized after decryption of the message.
 */
mid_handle_t;

/* one of these for every pending CIFS request to the server */
struct mid_q_entry {};

struct close_cancelled_open {};

/*	Make code in transport.c a little cleaner by moving
	update of optional stats into function below */
static inline void cifs_in_send_inc(struct TCP_Server_Info *server)
{}

static inline void cifs_in_send_dec(struct TCP_Server_Info *server)
{}

static inline void cifs_num_waiters_inc(struct TCP_Server_Info *server)
{}

static inline void cifs_num_waiters_dec(struct TCP_Server_Info *server)
{}

#ifdef CONFIG_CIFS_STATS2
static inline void cifs_save_when_sent(struct mid_q_entry *mid)
{}
#else
static inline void cifs_save_when_sent(struct mid_q_entry *mid)
{
}
#endif

/* for pending dnotify requests */
struct dir_notify_req {};

struct dfs_info3_param {};

struct file_list {};

struct cifs_mount_ctx {};

static inline void __free_dfs_info_param(struct dfs_info3_param *param)
{}

static inline void free_dfs_info_param(struct dfs_info3_param *param)
{}

static inline void zfree_dfs_info_param(struct dfs_info3_param *param)
{}

static inline void free_dfs_info_array(struct dfs_info3_param *param,
				       int number_of_items)
{}

static inline bool is_interrupt_error(int error)
{}

static inline bool is_retryable_error(int error)
{}

static inline bool is_replayable_error(int error)
{}


/* cifs_get_writable_file() flags */
#define FIND_WR_ANY
#define FIND_WR_FSUID_ONLY
#define FIND_WR_WITH_DELETE

#define MID_FREE
#define MID_REQUEST_ALLOCATED
#define MID_REQUEST_SUBMITTED
#define MID_RESPONSE_RECEIVED
#define MID_RETRY_NEEDED
#define MID_RESPONSE_MALFORMED
#define MID_SHUTDOWN
#define MID_RESPONSE_READY

/* Flags */
#define MID_WAIT_CANCELLED
#define MID_DELETED

/* Types of response buffer returned from SendReceive2 */
#define CIFS_NO_BUFFER
#define CIFS_SMALL_BUFFER
#define CIFS_LARGE_BUFFER
#define CIFS_IOVEC

/* Type of Request to SendReceive2 */
#define CIFS_BLOCKING_OP
#define CIFS_NON_BLOCKING
#define CIFS_TIMEOUT_MASK
#define CIFS_LOG_ERROR
#define CIFS_LARGE_BUF_OP
#define CIFS_NO_RSP_BUF

/* Type of request operation */
#define CIFS_ECHO_OP
#define CIFS_OBREAK_OP
#define CIFS_NEG_OP
#define CIFS_CP_CREATE_CLOSE_OP
/* Lower bitmask values are reserved by others below. */
#define CIFS_SESS_OP
#define CIFS_OP_MASK

#define CIFS_HAS_CREDITS
#define CIFS_TRANSFORM_REQ
#define CIFS_NO_SRV_RSP

/* Security Flags: indicate type of session setup needed */
#define CIFSSEC_MAY_SIGN
#define CIFSSEC_MAY_NTLMV2
#define CIFSSEC_MAY_KRB5
#define CIFSSEC_MAY_SEAL
#define CIFSSEC_MAY_NTLMSSP

#define CIFSSEC_MUST_SIGN
/* note that only one of the following can be set so the
result of setting MUST flags more than once will be to
require use of the stronger protocol */
#define CIFSSEC_MUST_NTLMV2
#define CIFSSEC_MUST_KRB5
#ifdef CONFIG_CIFS_UPCALL
#define CIFSSEC_MASK
#else
#define CIFSSEC_MASK
#endif /* UPCALL */
#define CIFSSEC_MUST_SEAL
#define CIFSSEC_MUST_NTLMSSP

#define CIFSSEC_DEF
#define CIFSSEC_MAX
#define CIFSSEC_AUTH_MASK
/*
 *****************************************************************
 * All constants go here
 *****************************************************************
 */

#define UID_HASH

/*
 * Note that ONE module should define _DECLARE_GLOBALS_HERE to cause the
 * following to be declared.
 */

/****************************************************************************
 * Here are all the locks (spinlock, mutex, semaphore) in cifs.ko, arranged according
 * to the locking order. i.e. if two locks are to be held together, the lock that
 * appears higher in this list needs to be taken before the other.
 *
 * If you hold a lock that is lower in this list, and you need to take a higher lock
 * (or if you think that one of the functions that you're calling may need to), first
 * drop the lock you hold, pick up the higher lock, then the lower one. This will
 * ensure that locks are picked up only in one direction in the below table
 * (top to bottom).
 *
 * Also, if you expect a function to be called with a lock held, explicitly document
 * this in the comments on top of your function definition.
 *
 * And also, try to keep the critical sections (lock hold time) to be as minimal as
 * possible. Blocking / calling other functions with a lock held always increase
 * the risk of a possible deadlock.
 *
 * Following this rule will avoid unnecessary deadlocks, which can get really hard to
 * debug. Also, any new lock that you introduce, please add to this list in the correct
 * order.
 *
 * Please populate this list whenever you introduce new locks in your changes. Or in
 * case I've missed some existing locks. Please ensure that it's added in the list
 * based on the locking order expected.
 *
 * =====================================================================================
 * Lock				Protects			Initialization fn
 * =====================================================================================
 * vol_list_lock
 * vol_info->ctx_lock		vol_info->ctx
 * cifs_sb_info->tlink_tree_lock	cifs_sb_info->tlink_tree	cifs_setup_cifs_sb
 * TCP_Server_Info->		TCP_Server_Info			cifs_get_tcp_session
 * reconnect_mutex
 * TCP_Server_Info->srv_mutex	TCP_Server_Info			cifs_get_tcp_session
 * cifs_ses->session_mutex		cifs_ses		sesInfoAlloc
 *				cifs_tcon
 * cifs_tcon->open_file_lock	cifs_tcon->openFileList		tconInfoAlloc
 *				cifs_tcon->pending_opens
 * cifs_tcon->stat_lock		cifs_tcon->bytes_read		tconInfoAlloc
 *				cifs_tcon->bytes_written
 * cifs_tcp_ses_lock		cifs_tcp_ses_list		sesInfoAlloc
 * GlobalMid_Lock		GlobalMaxActiveXid		init_cifs
 *				GlobalCurrentXid
 *				GlobalTotalActiveXid
 * TCP_Server_Info->srv_lock	(anything in struct not protected by another lock and can change)
 * TCP_Server_Info->mid_lock	TCP_Server_Info->pending_mid_q	cifs_get_tcp_session
 *				->CurrentMid
 *				(any changes in mid_q_entry fields)
 * TCP_Server_Info->req_lock	TCP_Server_Info->in_flight	cifs_get_tcp_session
 *				->credits
 *				->echo_credits
 *				->oplock_credits
 *				->reconnect_instance
 * cifs_ses->ses_lock		(anything that is not protected by another lock and can change)
 * cifs_ses->iface_lock		cifs_ses->iface_list		sesInfoAlloc
 *				->iface_count
 *				->iface_last_update
 * cifs_ses->chan_lock		cifs_ses->chans
 *				->chans_need_reconnect
 *				->chans_in_reconnect
 * cifs_tcon->tc_lock		(anything that is not protected by another lock and can change)
 * inode->i_rwsem, taken by fs/netfs/locking.c e.g. should be taken before cifsInodeInfo locks
 * cifsInodeInfo->open_file_lock	cifsInodeInfo->openFileList	cifs_alloc_inode
 * cifsInodeInfo->writers_lock	cifsInodeInfo->writers		cifsInodeInfo_alloc
 * cifsInodeInfo->lock_sem	cifsInodeInfo->llist		cifs_init_once
 *				->can_cache_brlcks
 * cifsInodeInfo->deferred_lock	cifsInodeInfo->deferred_closes	cifsInodeInfo_alloc
 * cached_fid->fid_mutex		cifs_tcon->crfid		tcon_info_alloc
 * cifsFileInfo->fh_mutex		cifsFileInfo			cifs_new_fileinfo
 * cifsFileInfo->file_info_lock	cifsFileInfo->count		cifs_new_fileinfo
 *				->invalidHandle			initiate_cifs_search
 *				->oplock_break_cancelled
 ****************************************************************************/

#ifdef DECLARE_GLOBALS_HERE
#define GLOBAL_EXTERN
#else
#define GLOBAL_EXTERN
#endif

/*
 * the list of TCP_Server_Info structures, ie each of the sockets
 * connecting our client to a distinct server (ip address), is
 * chained together by cifs_tcp_ses_list. The list of all our SMB
 * sessions (and from that the tree connections) can be found
 * by iterating over cifs_tcp_ses_list
 */
extern struct list_head		cifs_tcp_ses_list;

/*
 * This lock protects the cifs_tcp_ses_list, the list of smb sessions per
 * tcp session, and the list of tcon's per smb session. It also protects
 * the reference counters for the server, smb session, and tcon.
 * generally the locks should be taken in order tcp_ses_lock before
 * tcon->open_file_lock and that before file->file_info_lock since the
 * structure order is cifs_socket-->cifs_ses-->cifs_tcon-->cifs_file
 */
extern spinlock_t		cifs_tcp_ses_lock;

/*
 * Global transaction id (XID) information
 */
extern unsigned int GlobalCurrentXid;	/* protected by GlobalMid_Sem */
extern unsigned int GlobalTotalActiveXid; /* prot by GlobalMid_Sem */
extern unsigned int GlobalMaxActiveXid;	/* prot by GlobalMid_Sem */
extern spinlock_t GlobalMid_Lock; /* protects above & list operations on midQ entries */

/*
 *  Global counters, updated atomically
 */
extern atomic_t sesInfoAllocCount;
extern atomic_t tconInfoAllocCount;
extern atomic_t tcpSesNextId;
extern atomic_t tcpSesAllocCount;
extern atomic_t tcpSesReconnectCount;
extern atomic_t tconInfoReconnectCount;

/* Various Debug counters */
extern atomic_t buf_alloc_count;	/* current number allocated  */
extern atomic_t small_buf_alloc_count;
#ifdef CONFIG_CIFS_STATS2
extern atomic_t total_buf_alloc_count; /* total allocated over all time */
extern atomic_t total_small_buf_alloc_count;
extern unsigned int slow_rsp_threshold; /* number of secs before logging */
#endif

/* Misc globals */
extern bool enable_oplocks; /* enable or disable oplocks */
extern bool lookupCacheEnabled;
extern unsigned int global_secflags;	/* if on, session setup sent
				with more secure ntlmssp2 challenge/resp */
extern unsigned int sign_CIFS_PDUs;  /* enable smb packet signing */
extern bool enable_gcm_256; /* allow optional negotiate of strongest signing (aes-gcm-256) */
extern bool require_gcm_256; /* require use of strongest signing (aes-gcm-256) */
extern bool enable_negotiate_signing; /* request use of faster (GMAC) signing if available */
extern bool linuxExtEnabled;/*enable Linux/Unix CIFS extensions*/
extern unsigned int CIFSMaxBufSize;  /* max size not including hdr */
extern unsigned int cifs_min_rcv;    /* min size of big ntwrk buf pool */
extern unsigned int cifs_min_small;  /* min size of small buf pool */
extern unsigned int cifs_max_pending; /* MAX requests at once to server*/
extern unsigned int dir_cache_timeout; /* max time for directory lease caching of dir */
extern bool disable_legacy_dialects;  /* forbid vers=1.0 and vers=2.0 mounts */
extern atomic_t mid_count;

void cifs_oplock_break(struct work_struct *work);
void cifs_queue_oplock_break(struct cifsFileInfo *cfile);
void smb2_deferred_work_close(struct work_struct *work);

extern const struct slow_work_ops cifs_oplock_break_ops;
extern struct workqueue_struct *cifsiod_wq;
extern struct workqueue_struct *decrypt_wq;
extern struct workqueue_struct *fileinfo_put_wq;
extern struct workqueue_struct *cifsoplockd_wq;
extern struct workqueue_struct *deferredclose_wq;
extern struct workqueue_struct *serverclose_wq;
extern __u32 cifs_lock_secret;

extern mempool_t *cifs_sm_req_poolp;
extern mempool_t *cifs_req_poolp;
extern mempool_t *cifs_mid_poolp;
extern mempool_t cifs_io_request_pool;
extern mempool_t cifs_io_subrequest_pool;

/* Operations for different SMB versions */
#define SMB1_VERSION_STRING
#define SMB20_VERSION_STRING
#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
extern struct smb_version_operations smb1_operations;
extern struct smb_version_values smb1_values;
extern struct smb_version_operations smb20_operations;
extern struct smb_version_values smb20_values;
#endif /* CIFS_ALLOW_INSECURE_LEGACY */
#define SMB21_VERSION_STRING
extern struct smb_version_operations smb21_operations;
extern struct smb_version_values smb21_values;
#define SMBDEFAULT_VERSION_STRING
extern struct smb_version_values smbdefault_values;
#define SMB3ANY_VERSION_STRING
extern struct smb_version_values smb3any_values;
#define SMB30_VERSION_STRING
extern struct smb_version_operations smb30_operations;
extern struct smb_version_values smb30_values;
#define SMB302_VERSION_STRING
#define ALT_SMB302_VERSION_STRING
/*extern struct smb_version_operations smb302_operations;*/ /* not needed yet */
extern struct smb_version_values smb302_values;
#define SMB311_VERSION_STRING
#define ALT_SMB311_VERSION_STRING
extern struct smb_version_operations smb311_operations;
extern struct smb_version_values smb311_values;

static inline char *get_security_type_str(enum securityEnum sectype)
{}

static inline bool is_smb1_server(struct TCP_Server_Info *server)
{}

static inline bool is_tcon_dfs(struct cifs_tcon *tcon)
{}

static inline bool cifs_is_referral_server(struct cifs_tcon *tcon,
					   const struct dfs_info3_param *ref)
{}

static inline u64 cifs_flock_len(const struct file_lock *fl)
{}

static inline size_t ntlmssp_workstation_name_size(const struct cifs_ses *ses)
{}

static inline void move_cifs_info_to_smb2(struct smb2_file_all_info *dst, const FILE_ALL_INFO *src)
{}

static inline int cifs_get_num_sgs(const struct smb_rqst *rqst,
				   int num_rqst,
				   const u8 *sig)
{}

/* We can not use the normal sg_set_buf() as we will sometimes pass a
 * stack object as buf.
 */
static inline void cifs_sg_set_buf(struct sg_table *sgtable,
				   const void *buf,
				   unsigned int buflen)
{}

#define CIFS_OPARMS(_cifs_sb, _tcon, _path, _da, _cd, _co, _mode)

struct smb2_compound_vars {};

static inline bool cifs_ses_exiting(struct cifs_ses *ses)
{}

#endif	/* _CIFS_GLOB_H */