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