^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * fs/cifs/cifsproto.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (c) International Business Machines Corp., 2002,2008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Author(s): Steve French (sfrench@us.ibm.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * This library is free software; you can redistribute it and/or modify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * it under the terms of the GNU Lesser General Public License as published
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * by the Free Software Foundation; either version 2.1 of the License, or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * (at your option) any later version.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * This library is distributed in the hope that it will be useful,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * but WITHOUT ANY WARRANTY; without even the implied warranty of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * the GNU Lesser General Public License for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * You should have received a copy of the GNU Lesser General Public License
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * along with this library; if not, write to the Free Software
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #ifndef _CIFSPROTO_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define _CIFSPROTO_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <linux/nls.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include "trace.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #ifdef CONFIG_CIFS_DFS_UPCALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #include "dfs_cache.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct statfs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) struct smb_vol;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) struct smb_rqst;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) *****************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * All Prototypes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) *****************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) extern struct smb_hdr *cifs_buf_get(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) extern void cifs_buf_release(void *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) extern struct smb_hdr *cifs_small_buf_get(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) extern void cifs_small_buf_release(void *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) extern void free_rsp_buf(int, void *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) unsigned int /* length */);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) extern unsigned int _get_xid(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) extern void _free_xid(unsigned int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #define get_xid() \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) ({ \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) unsigned int __xid = _get_xid(); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) cifs_dbg(FYI, "VFS: in %s as Xid: %u with uid: %d\n", \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) __func__, __xid, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) from_kuid(&init_user_ns, current_fsuid())); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) trace_smb3_enter(__xid, __func__); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) __xid; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #define free_xid(curr_xid) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) do { \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) _free_xid(curr_xid); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) cifs_dbg(FYI, "VFS: leaving %s (xid = %u) rc = %d\n", \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) __func__, curr_xid, (int)rc); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) if (rc) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) trace_smb3_exit_err(curr_xid, __func__, (int)rc); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) else \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) trace_smb3_exit_done(curr_xid, __func__); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) } while (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) extern int init_cifs_idmap(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) extern void exit_cifs_idmap(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) extern int init_cifs_spnego(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) extern void exit_cifs_spnego(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) extern char *build_path_from_dentry(struct dentry *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) extern char *build_path_from_dentry_optional_prefix(struct dentry *direntry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) bool prefix);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) extern char *cifs_build_path_to_root(struct smb_vol *vol,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) struct cifs_sb_info *cifs_sb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) int add_treename);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) extern char *build_wildcard_path_from_dentry(struct dentry *direntry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) extern char *cifs_compose_mount_options(const char *sb_mountdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) const char *fullpath, const struct dfs_info3_param *ref,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) char **devname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) /* extern void renew_parental_timestamps(struct dentry *direntry);*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) struct TCP_Server_Info *server);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) extern void DeleteMidQEntry(struct mid_q_entry *midEntry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) extern void cifs_delete_mid(struct mid_q_entry *mid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) extern void cifs_mid_q_entry_release(struct mid_q_entry *midEntry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) extern void cifs_wake_up_task(struct mid_q_entry *mid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) extern int cifs_handle_standard(struct TCP_Server_Info *server,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) struct mid_q_entry *mid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) extern bool cifs_match_ipaddr(struct sockaddr *srcaddr, struct sockaddr *rhs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) extern int cifs_discard_remaining_data(struct TCP_Server_Info *server);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) extern int cifs_call_async(struct TCP_Server_Info *server,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) struct smb_rqst *rqst,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) mid_receive_t *receive, mid_callback_t *callback,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) mid_handle_t *handle, void *cbdata, const int flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) const struct cifs_credits *exist_credits);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) extern struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) extern int cifs_send_recv(const unsigned int xid, struct cifs_ses *ses,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) struct TCP_Server_Info *server,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) struct smb_rqst *rqst, int *resp_buf_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) const int flags, struct kvec *resp_iov);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) extern int compound_send_recv(const unsigned int xid, struct cifs_ses *ses,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) struct TCP_Server_Info *server,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) const int flags, const int num_rqst,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) struct smb_rqst *rqst, int *resp_buf_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) struct kvec *resp_iov);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) extern int SendReceive(const unsigned int /* xid */ , struct cifs_ses *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) struct smb_hdr * /* input */ ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) struct smb_hdr * /* out */ ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) int * /* bytes returned */ , const int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) extern int SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) char *in_buf, int flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) extern struct mid_q_entry *cifs_setup_request(struct cifs_ses *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) struct TCP_Server_Info *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) struct smb_rqst *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) extern struct mid_q_entry *cifs_setup_async_request(struct TCP_Server_Info *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) struct smb_rqst *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) extern int cifs_check_receive(struct mid_q_entry *mid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) struct TCP_Server_Info *server, bool log_error);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) extern int cifs_wait_mtu_credits(struct TCP_Server_Info *server,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) unsigned int size, unsigned int *num,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) struct cifs_credits *credits);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) struct kvec *, int /* nvec to send */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) int * /* type of buf returned */, const int flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) struct kvec * /* resp vec */);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) extern int SendReceiveBlockingLock(const unsigned int xid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) struct cifs_tcon *ptcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) struct smb_hdr *in_buf ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) struct smb_hdr *out_buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) int *bytes_returned);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) extern int cifs_reconnect(struct TCP_Server_Info *server);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) extern int checkSMB(char *buf, unsigned int len, struct TCP_Server_Info *srvr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) extern bool is_valid_oplock_break(char *, struct TCP_Server_Info *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) extern bool backup_cred(struct cifs_sb_info *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) extern void cifs_update_eof(struct cifsInodeInfo *cifsi, loff_t offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) unsigned int bytes_written);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) extern int cifs_get_writable_file(struct cifsInodeInfo *cifs_inode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) int flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) struct cifsFileInfo **ret_file);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) extern int cifs_get_writable_path(struct cifs_tcon *tcon, const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) int flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) struct cifsFileInfo **ret_file);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) extern int cifs_get_readable_path(struct cifs_tcon *tcon, const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) struct cifsFileInfo **ret_file);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) extern unsigned int smbCalcSize(void *buf, struct TCP_Server_Info *server);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) extern int decode_negTokenInit(unsigned char *security_blob, int length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) struct TCP_Server_Info *server);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) extern int cifs_convert_address(struct sockaddr *dst, const char *src, int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) extern void cifs_set_port(struct sockaddr *addr, const unsigned short int port);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) extern int map_smb_to_linux_error(char *buf, bool logErr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) extern int map_and_check_smb_error(struct mid_q_entry *mid, bool logErr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) extern void header_assemble(struct smb_hdr *, char /* command */ ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) const struct cifs_tcon *, int /* length of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) fixed section (word count) in two byte units */);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) extern int small_smb_init_no_tc(const int smb_cmd, const int wct,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) struct cifs_ses *ses,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) void **request_buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) extern enum securityEnum select_sectype(struct TCP_Server_Info *server,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) enum securityEnum requested);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) extern int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) const struct nls_table *nls_cp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) extern struct timespec64 cifs_NTtimeToUnix(__le64 utc_nanoseconds_since_1601);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) extern u64 cifs_UnixTimeToNT(struct timespec64);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) extern struct timespec64 cnvrtDosUnixTm(__le16 le_date, __le16 le_time,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) int offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) extern void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) extern int cifs_get_writer(struct cifsInodeInfo *cinode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) extern void cifs_put_writer(struct cifsInodeInfo *cinode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) extern void cifs_done_oplock_break(struct cifsInodeInfo *cinode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) extern int cifs_unlock_range(struct cifsFileInfo *cfile,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) struct file_lock *flock, const unsigned int xid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) extern int cifs_push_mandatory_locks(struct cifsFileInfo *cfile);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) extern void cifs_down_write(struct rw_semaphore *sem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) extern struct cifsFileInfo *cifs_new_fileinfo(struct cifs_fid *fid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) struct file *file,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) struct tcon_link *tlink,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) __u32 oplock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) extern int cifs_posix_open(char *full_path, struct inode **inode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) struct super_block *sb, int mode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) unsigned int f_flags, __u32 *oplock, __u16 *netfid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) unsigned int xid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) FILE_UNIX_BASIC_INFO *info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) struct cifs_sb_info *cifs_sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) extern void cifs_dir_info_to_fattr(struct cifs_fattr *, FILE_DIRECTORY_INFO *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) struct cifs_sb_info *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) extern void cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) extern struct inode *cifs_iget(struct super_block *sb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) struct cifs_fattr *fattr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) extern int cifs_get_inode_info(struct inode **inode, const char *full_path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) FILE_ALL_INFO *data, struct super_block *sb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) int xid, const struct cifs_fid *fid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) extern int smb311_posix_get_inode_info(struct inode **pinode, const char *search_path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) struct super_block *sb, unsigned int xid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) extern int cifs_get_inode_info_unix(struct inode **pinode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) const unsigned char *search_path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) struct super_block *sb, unsigned int xid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) extern int cifs_set_file_info(struct inode *inode, struct iattr *attrs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) unsigned int xid, char *full_path, __u32 dosattr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) extern int cifs_rename_pending_delete(const char *full_path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) struct dentry *dentry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) const unsigned int xid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) extern int sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) struct cifs_fattr *fattr, uint sidtype);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) struct cifs_fattr *fattr, struct inode *inode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) bool get_mode_from_special_sid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) const char *path, const struct cifs_fid *pfid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) extern int id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) kuid_t, kgid_t);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) extern struct cifs_ntsd *get_cifs_acl(struct cifs_sb_info *, struct inode *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) const char *, u32 *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) extern struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) const struct cifs_fid *, u32 *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) extern int set_cifs_acl(struct cifs_ntsd *, __u32, struct inode *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) const char *, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) extern unsigned int setup_authusers_ACE(struct cifs_ace *pace);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) extern unsigned int setup_special_mode_ACE(struct cifs_ace *pace, __u64 nmode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) extern unsigned int setup_special_user_owner_ACE(struct cifs_ace *pace);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) extern void dequeue_mid(struct mid_q_entry *mid, bool malformed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) extern int cifs_read_from_socket(struct TCP_Server_Info *server, char *buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) unsigned int to_read);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) extern int cifs_read_page_from_socket(struct TCP_Server_Info *server,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) struct page *page,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) unsigned int page_offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) unsigned int to_read);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) extern int cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) struct cifs_sb_info *cifs_sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) extern int cifs_match_super(struct super_block *, void *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) extern void cifs_cleanup_volume_info(struct smb_vol *pvolume_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) extern struct smb_vol *cifs_get_volume_info(char *mount_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) const char *devname, bool is_smb3);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) extern int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *vol);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) extern void cifs_umount(struct cifs_sb_info *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) extern void cifs_mark_open_files_invalid(struct cifs_tcon *tcon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) extern void cifs_reopen_persistent_handles(struct cifs_tcon *tcon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) extern bool cifs_find_lock_conflict(struct cifsFileInfo *cfile, __u64 offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) __u64 length, __u8 type, __u16 flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) struct cifsLockInfo **conf_lock,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) int rw_check);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) extern void cifs_add_pending_open(struct cifs_fid *fid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) struct tcon_link *tlink,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) struct cifs_pending_open *open);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) extern void cifs_add_pending_open_locked(struct cifs_fid *fid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) struct tcon_link *tlink,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) struct cifs_pending_open *open);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) extern void cifs_del_pending_open(struct cifs_pending_open *open);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) extern struct TCP_Server_Info *cifs_get_tcp_session(struct smb_vol *vol);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) extern void cifs_put_tcp_session(struct TCP_Server_Info *server,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) int from_reconnect);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) extern void cifs_put_tcon(struct cifs_tcon *tcon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) #if IS_ENABLED(CONFIG_CIFS_DFS_UPCALL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) extern void cifs_dfs_release_automount_timer(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) #else /* ! IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) #define cifs_dfs_release_automount_timer() do { } while (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) #endif /* ! IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) void cifs_proc_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) void cifs_proc_clean(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) extern void cifs_move_llist(struct list_head *source, struct list_head *dest);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) extern void cifs_free_llist(struct list_head *llist);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) extern void cifs_del_lock_waiters(struct cifsLockInfo *lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) extern int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) const struct nls_table *nlsc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) extern int cifs_negotiate_protocol(const unsigned int xid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) struct cifs_ses *ses);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) extern int cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) struct nls_table *nls_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) extern int cifs_enable_signing(struct TCP_Server_Info *server, bool mnt_sign_required);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) extern int CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) extern int CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) const char *tree, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) const struct nls_table *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) extern int CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) const char *searchName, struct cifs_sb_info *cifs_sb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) __u16 *searchHandle, __u16 search_flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) struct cifs_search_info *psrch_inf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) bool msearch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) extern int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) __u16 searchHandle, __u16 search_flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) struct cifs_search_info *psrch_inf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) extern int CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) const __u16 search_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) extern int CIFSSMBQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) u16 netfid, FILE_ALL_INFO *pFindData);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) extern int CIFSSMBQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) const char *search_Name, FILE_ALL_INFO *data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) int legacy /* whether to use old info level */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) const struct nls_table *nls_codepage, int remap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) extern int SMBQueryInformation(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) const char *search_name, FILE_ALL_INFO *data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) const struct nls_table *nls_codepage, int remap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) extern int CIFSSMBUnixQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) u16 netfid, FILE_UNIX_BASIC_INFO *pFindData);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) extern int CIFSSMBUnixQPathInfo(const unsigned int xid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) const unsigned char *searchName,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) FILE_UNIX_BASIC_INFO *pFindData,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) const struct nls_table *nls_codepage, int remap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) extern int CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) const char *search_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) struct dfs_info3_param **target_nodes,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) unsigned int *num_of_nodes,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) const struct nls_table *nls_codepage, int remap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) extern int parse_dfs_referrals(struct get_dfs_referral_rsp *rsp, u32 rsp_size,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) unsigned int *num_of_nodes,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) struct dfs_info3_param **target_nodes,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) const struct nls_table *nls_codepage, int remap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) const char *searchName, bool is_unicode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) extern void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) struct cifs_sb_info *cifs_sb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) struct smb_vol *vol);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) extern int CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) struct kstatfs *FSData);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) extern int SMBOldQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) struct kstatfs *FSData);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) extern int CIFSSMBSetFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) __u64 cap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) extern int CIFSSMBQFSAttributeInfo(const unsigned int xid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) struct cifs_tcon *tcon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) extern int CIFSSMBQFSDeviceInfo(const unsigned int xid, struct cifs_tcon *tcon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) extern int CIFSSMBQFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) extern int CIFSSMBQFSPosixInfo(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) struct kstatfs *FSData);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) extern int CIFSSMBSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) const char *fileName, const FILE_BASIC_INFO *data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) const struct nls_table *nls_codepage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) struct cifs_sb_info *cifs_sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) extern int CIFSSMBSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) const FILE_BASIC_INFO *data, __u16 fid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) __u32 pid_of_opener);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) extern int CIFSSMBSetFileDisposition(const unsigned int xid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) bool delete_file, __u16 fid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) __u32 pid_of_opener);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) #if 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) extern int CIFSSMBSetAttrLegacy(unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) char *fileName, __u16 dos_attributes,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) const struct nls_table *nls_codepage);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) #endif /* possibly unneeded function */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) extern int CIFSSMBSetEOF(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) const char *file_name, __u64 size,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) struct cifs_sb_info *cifs_sb, bool set_allocation);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) extern int CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) struct cifsFileInfo *cfile, __u64 size,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) bool set_allocation);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) struct cifs_unix_set_info_args {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) __u64 ctime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) __u64 atime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) __u64 mtime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) __u64 mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) kuid_t uid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) kgid_t gid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) dev_t device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) extern int CIFSSMBUnixSetFileInfo(const unsigned int xid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) const struct cifs_unix_set_info_args *args,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) u16 fid, u32 pid_of_opener);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) extern int CIFSSMBUnixSetPathInfo(const unsigned int xid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) struct cifs_tcon *tcon, const char *file_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) const struct cifs_unix_set_info_args *args,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) const struct nls_table *nls_codepage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) int remap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) extern int CIFSSMBMkDir(const unsigned int xid, struct inode *inode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) umode_t mode, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) const char *name, struct cifs_sb_info *cifs_sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) extern int CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) const char *name, struct cifs_sb_info *cifs_sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) extern int CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) const char *name, __u16 type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) const struct nls_table *nls_codepage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) int remap_special_chars);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) extern int CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) const char *name, struct cifs_sb_info *cifs_sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) extern int CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) const char *from_name, const char *to_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) struct cifs_sb_info *cifs_sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) extern int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) int netfid, const char *target_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) const struct nls_table *nls_codepage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) int remap_special_chars);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) extern int CIFSCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) const char *from_name, const char *to_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) struct cifs_sb_info *cifs_sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) extern int CIFSUnixCreateHardLink(const unsigned int xid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) const char *fromName, const char *toName,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) const struct nls_table *nls_codepage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) int remap_special_chars);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) extern int CIFSUnixCreateSymLink(const unsigned int xid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) const char *fromName, const char *toName,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) const struct nls_table *nls_codepage, int remap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) extern int CIFSSMBUnixQuerySymLink(const unsigned int xid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) const unsigned char *searchName, char **syminfo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) const struct nls_table *nls_codepage, int remap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) extern int CIFSSMBQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) __u16 fid, char **symlinkinfo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) const struct nls_table *nls_codepage);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) extern int CIFSSMB_set_compression(const unsigned int xid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) struct cifs_tcon *tcon, __u16 fid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) extern int CIFS_open(const unsigned int xid, struct cifs_open_parms *oparms,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) int *oplock, FILE_ALL_INFO *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) extern int SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) const char *fileName, const int disposition,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) const int access_flags, const int omode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) __u16 *netfid, int *pOplock, FILE_ALL_INFO *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) const struct nls_table *nls_codepage, int remap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) extern int CIFSPOSIXCreate(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) u32 posix_flags, __u64 mode, __u16 *netfid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) FILE_UNIX_BASIC_INFO *pRetData,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) __u32 *pOplock, const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) const struct nls_table *nls_codepage, int remap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) extern int CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) const int smb_file_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) extern int CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) const int smb_file_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) extern int CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) unsigned int *nbytes, char **buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) int *return_buf_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) extern int CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) unsigned int *nbytes, const char *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) extern int CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) unsigned int *nbytes, struct kvec *iov, const int nvec);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) extern int CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) const char *search_name, __u64 *inode_number,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) const struct nls_table *nls_codepage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) int remap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) extern int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) const __u16 netfid, const __u8 lock_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) const __u32 num_unlock, const __u32 num_lock,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) LOCKING_ANDX_RANGE *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) extern int CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) const __u16 netfid, const __u32 netpid, const __u64 len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) const __u64 offset, const __u32 numUnlock,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) const __u32 numLock, const __u8 lockType,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) const bool waitFlag, const __u8 oplock_level);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) extern int CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) const __u16 smb_file_id, const __u32 netpid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) const loff_t start_offset, const __u64 len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) struct file_lock *, const __u16 lock_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) const bool waitFlag);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) extern int CIFSSMBTDis(const unsigned int xid, struct cifs_tcon *tcon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) extern int CIFSSMBEcho(struct TCP_Server_Info *server);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) extern int CIFSSMBLogoff(const unsigned int xid, struct cifs_ses *ses);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) extern struct cifs_ses *sesInfoAlloc(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) extern void sesInfoFree(struct cifs_ses *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) extern struct cifs_tcon *tconInfoAlloc(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) extern void tconInfoFree(struct cifs_tcon *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) extern int cifs_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) __u32 *pexpected_response_sequence_number);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) extern int cifs_sign_smbv(struct kvec *iov, int n_vec, struct TCP_Server_Info *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) __u32 *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) extern int cifs_sign_smb(struct smb_hdr *, struct TCP_Server_Info *, __u32 *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) extern int cifs_verify_signature(struct smb_rqst *rqst,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) struct TCP_Server_Info *server,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) __u32 expected_sequence_number);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) extern int SMBNTencrypt(unsigned char *, unsigned char *, unsigned char *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) const struct nls_table *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) extern int setup_ntlm_response(struct cifs_ses *, const struct nls_table *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) extern int setup_ntlmv2_rsp(struct cifs_ses *, const struct nls_table *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) extern void cifs_crypto_secmech_release(struct TCP_Server_Info *server);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) extern int calc_seckey(struct cifs_ses *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) extern int generate_smb30signingkey(struct cifs_ses *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) extern int generate_smb311signingkey(struct cifs_ses *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) #ifdef CONFIG_CIFS_WEAK_PW_HASH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) extern int calc_lanman_hash(const char *password, const char *cryptkey,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) bool encrypt, char *lnm_session_key);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) #endif /* CIFS_WEAK_PW_HASH */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) #ifdef CONFIG_CIFS_DNOTIFY_EXPERIMENTAL /* unused temporarily */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) extern int CIFSSMBNotify(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) const int notify_subdirs, const __u16 netfid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) __u32 filter, struct file *file, int multishot,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) const struct nls_table *nls_codepage);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) #endif /* was needed for dnotify, and will be needed for inotify when VFS fix */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) extern int CIFSSMBCopy(unsigned int xid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) struct cifs_tcon *source_tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) const char *fromName,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) const __u16 target_tid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) const char *toName, const int flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) const struct nls_table *nls_codepage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) int remap_special_chars);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) extern ssize_t CIFSSMBQAllEAs(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) const unsigned char *searchName,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) const unsigned char *ea_name, char *EAData,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) size_t bufsize, struct cifs_sb_info *cifs_sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) extern int CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) const char *fileName, const char *ea_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) const void *ea_value, const __u16 ea_value_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) const struct nls_table *nls_codepage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) struct cifs_sb_info *cifs_sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) extern int CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) __u16 fid, struct cifs_ntsd **acl_inf, __u32 *buflen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) extern int CIFSSMBSetCIFSACL(const unsigned int, struct cifs_tcon *, __u16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) struct cifs_ntsd *, __u32, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) extern int CIFSSMBGetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) const unsigned char *searchName,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) char *acl_inf, const int buflen, const int acl_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) const struct nls_table *nls_codepage, int remap_special_chars);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) extern int CIFSSMBSetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) const unsigned char *fileName,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) const char *local_acl, const int buflen, const int acl_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) const struct nls_table *nls_codepage, int remap_special_chars);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) extern int CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) const int netfid, __u64 *pExtAttrBits, __u64 *pMask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) extern bool couldbe_mf_symlink(const struct cifs_fattr *fattr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) extern int check_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) struct cifs_sb_info *cifs_sb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) struct cifs_fattr *fattr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) const unsigned char *path);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) extern int mdfour(unsigned char *, unsigned char *, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) extern int E_md4hash(const unsigned char *passwd, unsigned char *p16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) const struct nls_table *codepage);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) extern int SMBencrypt(unsigned char *passwd, const unsigned char *c8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) unsigned char *p24);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) extern int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) const char *devname, bool is_smb3);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) extern void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) cifs_cleanup_volume_info_contents(struct smb_vol *volume_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) extern struct TCP_Server_Info *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) cifs_find_tcp_session(struct smb_vol *vol);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) extern void cifs_put_smb_ses(struct cifs_ses *ses);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) extern struct cifs_ses *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) void cifs_readdata_release(struct kref *refcount);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) int cifs_async_readv(struct cifs_readdata *rdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) int cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) int cifs_async_writev(struct cifs_writedata *wdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) void (*release)(struct kref *kref));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) void cifs_writev_complete(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) struct cifs_writedata *cifs_writedata_alloc(unsigned int nr_pages,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) work_func_t complete);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) struct cifs_writedata *cifs_writedata_direct_alloc(struct page **pages,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) work_func_t complete);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) void cifs_writedata_release(struct kref *refcount);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) int cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) struct cifs_sb_info *cifs_sb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) const unsigned char *path, char *pbuf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) unsigned int *pbytes_read);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) int cifs_create_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) struct cifs_sb_info *cifs_sb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) const unsigned char *path, char *pbuf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) unsigned int *pbytes_written);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) int __cifs_calc_signature(struct smb_rqst *rqst,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) struct TCP_Server_Info *server, char *signature,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) struct shash_desc *shash);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) enum securityEnum cifs_select_sectype(struct TCP_Server_Info *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) enum securityEnum);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) struct cifs_aio_ctx *cifs_aio_ctx_alloc(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) void cifs_aio_ctx_release(struct kref *refcount);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) int setup_aio_ctx_iter(struct cifs_aio_ctx *ctx, struct iov_iter *iter, int rw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597) void smb2_cached_lease_break(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) int cifs_alloc_hash(const char *name, struct crypto_shash **shash,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) struct sdesc **sdesc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) void cifs_free_hash(struct crypto_shash **shash, struct sdesc **sdesc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) extern void rqst_page_get_length(struct smb_rqst *rqst, unsigned int page,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) unsigned int *len, unsigned int *offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) struct cifs_chan *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) cifs_ses_find_chan(struct cifs_ses *ses, struct TCP_Server_Info *server);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) int cifs_try_adding_channels(struct cifs_ses *ses);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) int cifs_ses_add_channel(struct cifs_ses *ses,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609) struct cifs_server_iface *iface);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) bool is_server_using_iface(struct TCP_Server_Info *server,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) struct cifs_server_iface *iface);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) bool is_ses_using_iface(struct cifs_ses *ses, struct cifs_server_iface *iface);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) void extract_unc_hostname(const char *unc, const char **h, size_t *len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) int copy_path_name(char *dst, const char *src);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) int smb2_parse_query_directory(struct cifs_tcon *tcon, struct kvec *rsp_iov,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) int resp_buftype,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) struct cifs_search_info *srch_inf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) struct super_block *cifs_get_tcp_super(struct TCP_Server_Info *server);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) void cifs_put_tcp_super(struct super_block *sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) int update_super_prepath(struct cifs_tcon *tcon, char *prefix);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624) #ifdef CONFIG_CIFS_DFS_UPCALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) static inline int get_dfs_path(const unsigned int xid, struct cifs_ses *ses,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) const char *old_path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) const struct nls_table *nls_codepage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) struct dfs_info3_param *referral, int remap)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630) return dfs_cache_find(xid, ses, nls_codepage, remap, old_path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) referral, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) int match_target_ip(struct TCP_Server_Info *server,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635) const char *share, size_t share_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) bool *result);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) static inline int cifs_create_options(struct cifs_sb_info *cifs_sb, int options)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641) if (cifs_sb && (backup_cred(cifs_sb)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) return options | CREATE_OPEN_BACKUP_INTENT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644) return options;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647) #endif /* _CIFSPROTO_H */