#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 …
#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 …
#define CIFS_DEF_ACTIMEO …
#define CIFS_MAX_SLEEP …
#define CIFS_MAX_ACTIMEO …
#define SMB3_MAX_HANDLE_TIMEOUT …
#define CIFS_MAX_REQ …
#define RFC1001_NAME_LEN …
#define RFC1001_NAME_LEN_WITH_NULL …
#define SERVER_NAME_LENGTH …
#define SERVER_NAME_LEN_WITH_NULL …
#define SMB_ECHO_INTERVAL_MIN …
#define SMB_ECHO_INTERVAL_MAX …
#define SMB_ECHO_INTERVAL_DEFAULT …
#define SMB_INTERFACE_POLL_INTERVAL …
#define MAX_COMPOUND …
#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) …
enum statusEnum { … };
enum ses_status_enum { … };
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 { … };
struct cifs_secmech { … };
struct ntlmssp_auth { … };
struct cifs_cred { … };
struct cifs_open_info_data { … };
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) …
#define CIFS_MOUNT_MASK …
#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 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)
{ … }
#define CIFS_MAX_WSIZE …
#define CIFS_MAX_RSIZE …
#define CIFS_MAX_RFC1002_WSIZE …
#define CIFS_MAX_RFC1002_RSIZE …
#define CIFS_DEFAULT_IOSIZE …
#define CIFS_DEFAULT_NON_POSIX_RSIZE …
#define CIFS_DEFAULT_NON_POSIX_WSIZE …
#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 { … };
static inline void
release_iface(struct kref *ref)
{ … }
struct cifs_chan { … };
#define CIFS_SES_FLAG_SCALE_CHANNELS …
struct cifs_ses { … };
static inline bool
cap_unix(struct cifs_ses *ses)
{ … }
#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 { … };
struct cifs_tcon { … };
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)
{ … }
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 { … };
struct cifsLockInfo { … };
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 { … };
struct cifs_io_subrequest { … };
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) …
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)
{ … }
mid_receive_t;
mid_callback_t;
mid_handle_t;
struct mid_q_entry { … };
struct close_cancelled_open { … };
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
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)
{ … }
#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 …
#define MID_WAIT_CANCELLED …
#define MID_DELETED …
#define CIFS_NO_BUFFER …
#define CIFS_SMALL_BUFFER …
#define CIFS_LARGE_BUFFER …
#define CIFS_IOVEC …
#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 …
#define CIFS_ECHO_OP …
#define CIFS_OBREAK_OP …
#define CIFS_NEG_OP …
#define CIFS_CP_CREATE_CLOSE_OP …
#define CIFS_SESS_OP …
#define CIFS_OP_MASK …
#define CIFS_HAS_CREDITS …
#define CIFS_TRANSFORM_REQ …
#define CIFS_NO_SRV_RSP …
#define CIFSSEC_MAY_SIGN …
#define CIFSSEC_MAY_NTLMV2 …
#define CIFSSEC_MAY_KRB5 …
#define CIFSSEC_MAY_SEAL …
#define CIFSSEC_MAY_NTLMSSP …
#define CIFSSEC_MUST_SIGN …
#define CIFSSEC_MUST_NTLMV2 …
#define CIFSSEC_MUST_KRB5 …
#ifdef CONFIG_CIFS_UPCALL
#define CIFSSEC_MASK …
#else
#define CIFSSEC_MASK …
#endif
#define CIFSSEC_MUST_SEAL …
#define CIFSSEC_MUST_NTLMSSP …
#define CIFSSEC_DEF …
#define CIFSSEC_MAX …
#define CIFSSEC_AUTH_MASK …
#define UID_HASH …
#ifdef DECLARE_GLOBALS_HERE
#define GLOBAL_EXTERN
#else
#define GLOBAL_EXTERN …
#endif
extern struct list_head cifs_tcp_ses_list;
extern spinlock_t cifs_tcp_ses_lock;
extern unsigned int GlobalCurrentXid;
extern unsigned int GlobalTotalActiveXid;
extern unsigned int GlobalMaxActiveXid;
extern spinlock_t GlobalMid_Lock;
extern atomic_t sesInfoAllocCount;
extern atomic_t tconInfoAllocCount;
extern atomic_t tcpSesNextId;
extern atomic_t tcpSesAllocCount;
extern atomic_t tcpSesReconnectCount;
extern atomic_t tconInfoReconnectCount;
extern atomic_t buf_alloc_count;
extern atomic_t small_buf_alloc_count;
#ifdef CONFIG_CIFS_STATS2
extern atomic_t total_buf_alloc_count;
extern atomic_t total_small_buf_alloc_count;
extern unsigned int slow_rsp_threshold;
#endif
extern bool enable_oplocks;
extern bool lookupCacheEnabled;
extern unsigned int global_secflags;
extern unsigned int sign_CIFS_PDUs;
extern bool enable_gcm_256;
extern bool require_gcm_256;
extern bool enable_negotiate_signing;
extern bool linuxExtEnabled;
extern unsigned int CIFSMaxBufSize;
extern unsigned int cifs_min_rcv;
extern unsigned int cifs_min_small;
extern unsigned int cifs_max_pending;
extern unsigned int dir_cache_timeout;
extern bool disable_legacy_dialects;
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;
#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
#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_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)
{ … }
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