8e071a5a7da4da17b34f196080663c63ab051f4e
[linux-block.git] / fs / cifs / cifsproto.h
1 /*
2  *   fs/cifs/cifsproto.h
3  *
4  *   Copyright (c) International Business Machines  Corp., 2002,2008
5  *   Author(s): Steve French (sfrench@us.ibm.com)
6  *
7  *   This library is free software; you can redistribute it and/or modify
8  *   it under the terms of the GNU Lesser General Public License as published
9  *   by the Free Software Foundation; either version 2.1 of the License, or
10  *   (at your option) any later version.
11  *
12  *   This library is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
15  *   the GNU Lesser General Public License for more details.
16  *
17  *   You should have received a copy of the GNU Lesser General Public License
18  *   along with this library; if not, write to the Free Software
19  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */
21 #ifndef _CIFSPROTO_H
22 #define _CIFSPROTO_H
23 #include <linux/nls.h>
24
25 struct statfs;
26 struct smb_vol;
27 struct smb_rqst;
28
29 /*
30  *****************************************************************
31  * All Prototypes
32  *****************************************************************
33  */
34
35 extern struct smb_hdr *cifs_buf_get(void);
36 extern void cifs_buf_release(void *);
37 extern struct smb_hdr *cifs_small_buf_get(void);
38 extern void cifs_small_buf_release(void *);
39 extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
40                         unsigned int /* length */);
41 extern unsigned int _get_xid(void);
42 extern void _free_xid(unsigned int);
43 #define get_xid()                                               \
44 ({                                                              \
45         unsigned int __xid = _get_xid();                                \
46         cFYI(1, "CIFS VFS: in %s as Xid: %u with uid: %d",      \
47              __func__, __xid, current_fsuid());                 \
48         __xid;                                                  \
49 })
50
51 #define free_xid(curr_xid)                                      \
52 do {                                                            \
53         _free_xid(curr_xid);                                    \
54         cFYI(1, "CIFS VFS: leaving %s (xid = %u) rc = %d",      \
55              __func__, curr_xid, (int)rc);                      \
56 } while (0)
57 extern int init_cifs_idmap(void);
58 extern void exit_cifs_idmap(void);
59 extern void cifs_destroy_idmaptrees(void);
60 extern char *build_path_from_dentry(struct dentry *);
61 extern char *build_wildcard_path_from_dentry(struct dentry *direntry);
62 extern char *cifs_compose_mount_options(const char *sb_mountdata,
63                 const char *fullpath, const struct dfs_info3_param *ref,
64                 char **devname);
65 /* extern void renew_parental_timestamps(struct dentry *direntry);*/
66 extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer,
67                                         struct TCP_Server_Info *server);
68 extern void DeleteMidQEntry(struct mid_q_entry *midEntry);
69 extern void cifs_delete_mid(struct mid_q_entry *mid);
70 extern void cifs_wake_up_task(struct mid_q_entry *mid);
71 extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
72                            unsigned int nvec, mid_receive_t *receive,
73                            mid_callback_t *callback, void *cbdata,
74                            const int flags);
75 extern int SendReceive(const unsigned int /* xid */ , struct cifs_ses *,
76                         struct smb_hdr * /* input */ ,
77                         struct smb_hdr * /* out */ ,
78                         int * /* bytes returned */ , const int);
79 extern int SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses,
80                             char *in_buf, int flags);
81 extern int cifs_setup_request(struct cifs_ses *, struct kvec *, unsigned int,
82                               struct mid_q_entry **);
83 extern int cifs_setup_async_request(struct TCP_Server_Info *, struct kvec *,
84                                     unsigned int, struct mid_q_entry **);
85 extern int cifs_check_receive(struct mid_q_entry *mid,
86                         struct TCP_Server_Info *server, bool log_error);
87 extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *,
88                         struct kvec *, int /* nvec to send */,
89                         int * /* type of buf returned */ , const int flags);
90 extern int SendReceiveBlockingLock(const unsigned int xid,
91                         struct cifs_tcon *ptcon,
92                         struct smb_hdr *in_buf ,
93                         struct smb_hdr *out_buf,
94                         int *bytes_returned);
95 extern int cifs_reconnect(struct TCP_Server_Info *server);
96 extern int checkSMB(char *buf, unsigned int length);
97 extern bool is_valid_oplock_break(char *, struct TCP_Server_Info *);
98 extern bool backup_cred(struct cifs_sb_info *);
99 extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
100 extern void cifs_update_eof(struct cifsInodeInfo *cifsi, loff_t offset,
101                             unsigned int bytes_written);
102 extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, bool);
103 extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool);
104 extern unsigned int smbCalcSize(void *buf);
105 extern int decode_negTokenInit(unsigned char *security_blob, int length,
106                         struct TCP_Server_Info *server);
107 extern int cifs_convert_address(struct sockaddr *dst, const char *src, int len);
108 extern int cifs_set_port(struct sockaddr *addr, const unsigned short int port);
109 extern int cifs_fill_sockaddr(struct sockaddr *dst, const char *src, int len,
110                                 const unsigned short int port);
111 extern int map_smb_to_linux_error(char *buf, bool logErr);
112 extern void header_assemble(struct smb_hdr *, char /* command */ ,
113                             const struct cifs_tcon *, int /* length of
114                             fixed section (word count) in two byte units */);
115 extern int small_smb_init_no_tc(const int smb_cmd, const int wct,
116                                 struct cifs_ses *ses,
117                                 void **request_buf);
118 extern int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
119                           const struct nls_table *nls_cp);
120 extern struct timespec cifs_NTtimeToUnix(__le64 utc_nanoseconds_since_1601);
121 extern u64 cifs_UnixTimeToNT(struct timespec);
122 extern struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time,
123                                       int offset);
124 extern void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock);
125
126 extern struct cifsFileInfo *cifs_new_fileinfo(struct cifs_fid *fid,
127                                               struct file *file,
128                                               struct tcon_link *tlink,
129                                               __u32 oplock);
130 extern int cifs_posix_open(char *full_path, struct inode **inode,
131                            struct super_block *sb, int mode,
132                            unsigned int f_flags, __u32 *oplock, __u16 *netfid,
133                            unsigned int xid);
134 void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr);
135 extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr,
136                                      FILE_UNIX_BASIC_INFO *info,
137                                      struct cifs_sb_info *cifs_sb);
138 extern void cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr);
139 extern struct inode *cifs_iget(struct super_block *sb,
140                                struct cifs_fattr *fattr);
141
142 extern int cifs_get_inode_info(struct inode **inode, const char *full_path,
143                                FILE_ALL_INFO *data, struct super_block *sb,
144                                int xid, const __u16 *fid);
145 extern int cifs_get_inode_info_unix(struct inode **pinode,
146                         const unsigned char *search_path,
147                         struct super_block *sb, unsigned int xid);
148 extern int cifs_set_file_info(struct inode *inode, struct iattr *attrs,
149                               unsigned int xid, char *full_path, __u32 dosattr);
150 extern int cifs_rename_pending_delete(const char *full_path,
151                                       struct dentry *dentry,
152                                       const unsigned int xid);
153 extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb,
154                               struct cifs_fattr *fattr, struct inode *inode,
155                               const char *path, const __u16 *pfid);
156 extern int id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64,
157                                         uid_t, gid_t);
158 extern struct cifs_ntsd *get_cifs_acl(struct cifs_sb_info *, struct inode *,
159                                         const char *, u32 *);
160 extern int set_cifs_acl(struct cifs_ntsd *, __u32, struct inode *,
161                                 const char *, int);
162
163 extern void dequeue_mid(struct mid_q_entry *mid, bool malformed);
164 extern int cifs_read_from_socket(struct TCP_Server_Info *server, char *buf,
165                      unsigned int to_read);
166 extern int cifs_readv_from_socket(struct TCP_Server_Info *server,
167                 struct kvec *iov_orig, unsigned int nr_segs,
168                 unsigned int to_read);
169 extern void cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
170                                struct cifs_sb_info *cifs_sb);
171 extern int cifs_match_super(struct super_block *, void *);
172 extern void cifs_cleanup_volume_info(struct smb_vol *pvolume_info);
173 extern struct smb_vol *cifs_get_volume_info(char *mount_data,
174                                             const char *devname);
175 extern int cifs_mount(struct cifs_sb_info *, struct smb_vol *);
176 extern void cifs_umount(struct cifs_sb_info *);
177 extern void cifs_mark_open_files_invalid(struct cifs_tcon *tcon);
178
179 #if IS_ENABLED(CONFIG_CIFS_DFS_UPCALL)
180 extern void cifs_dfs_release_automount_timer(void);
181 #else /* ! IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) */
182 #define cifs_dfs_release_automount_timer()      do { } while (0)
183 #endif /* ! IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) */
184
185 void cifs_proc_init(void);
186 void cifs_proc_clean(void);
187
188 extern int cifs_negotiate_protocol(const unsigned int xid,
189                                    struct cifs_ses *ses);
190 extern int cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
191                               struct nls_table *nls_info);
192 extern int CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses);
193
194 extern int CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
195                     const char *tree, struct cifs_tcon *tcon,
196                     const struct nls_table *);
197
198 extern int CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon,
199                 const char *searchName, const struct nls_table *nls_codepage,
200                 __u16 *searchHandle, __u16 search_flags,
201                 struct cifs_search_info *psrch_inf,
202                 int map, const char dirsep);
203
204 extern int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
205                 __u16 searchHandle, __u16 search_flags,
206                 struct cifs_search_info *psrch_inf);
207
208 extern int CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
209                         const __u16 search_handle);
210
211 extern int CIFSSMBQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
212                         u16 netfid, FILE_ALL_INFO *pFindData);
213 extern int CIFSSMBQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
214                             const char *search_Name, FILE_ALL_INFO *data,
215                             int legacy /* whether to use old info level */,
216                             const struct nls_table *nls_codepage, int remap);
217 extern int SMBQueryInformation(const unsigned int xid, struct cifs_tcon *tcon,
218                                const char *search_name, FILE_ALL_INFO *data,
219                                const struct nls_table *nls_codepage, int remap);
220
221 extern int CIFSSMBUnixQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
222                         u16 netfid, FILE_UNIX_BASIC_INFO *pFindData);
223 extern int CIFSSMBUnixQPathInfo(const unsigned int xid,
224                         struct cifs_tcon *tcon,
225                         const unsigned char *searchName,
226                         FILE_UNIX_BASIC_INFO *pFindData,
227                         const struct nls_table *nls_codepage, int remap);
228
229 extern int CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
230                            const char *search_name,
231                            struct dfs_info3_param **target_nodes,
232                            unsigned int *num_of_nodes,
233                            const struct nls_table *nls_codepage, int remap);
234
235 extern int get_dfs_path(const unsigned int xid, struct cifs_ses *ses,
236                         const char *old_path,
237                         const struct nls_table *nls_codepage,
238                         unsigned int *num_referrals,
239                         struct dfs_info3_param **referrals, int remap);
240 extern void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
241                                  struct cifs_sb_info *cifs_sb,
242                                  struct smb_vol *vol);
243 extern int CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
244                         struct kstatfs *FSData);
245 extern int SMBOldQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
246                         struct kstatfs *FSData);
247 extern int CIFSSMBSetFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon,
248                         __u64 cap);
249
250 extern int CIFSSMBQFSAttributeInfo(const unsigned int xid,
251                         struct cifs_tcon *tcon);
252 extern int CIFSSMBQFSDeviceInfo(const unsigned int xid, struct cifs_tcon *tcon);
253 extern int CIFSSMBQFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon);
254 extern int CIFSSMBQFSPosixInfo(const unsigned int xid, struct cifs_tcon *tcon,
255                         struct kstatfs *FSData);
256
257 extern int CIFSSMBSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
258                         const char *fileName, const FILE_BASIC_INFO *data,
259                         const struct nls_table *nls_codepage,
260                         int remap_special_chars);
261 extern int CIFSSMBSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
262                         const FILE_BASIC_INFO *data, __u16 fid,
263                         __u32 pid_of_opener);
264 extern int CIFSSMBSetFileDisposition(const unsigned int xid,
265                                      struct cifs_tcon *tcon,
266                                      bool delete_file, __u16 fid,
267                                      __u32 pid_of_opener);
268 #if 0
269 extern int CIFSSMBSetAttrLegacy(unsigned int xid, struct cifs_tcon *tcon,
270                         char *fileName, __u16 dos_attributes,
271                         const struct nls_table *nls_codepage);
272 #endif /* possibly unneeded function */
273 extern int CIFSSMBSetEOF(const unsigned int xid, struct cifs_tcon *tcon,
274                          const char *file_name, __u64 size,
275                          struct cifs_sb_info *cifs_sb, bool set_allocation);
276 extern int CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon,
277                               struct cifsFileInfo *cfile, __u64 size,
278                               bool set_allocation);
279
280 struct cifs_unix_set_info_args {
281         __u64   ctime;
282         __u64   atime;
283         __u64   mtime;
284         __u64   mode;
285         __u64   uid;
286         __u64   gid;
287         dev_t   device;
288 };
289
290 extern int CIFSSMBUnixSetFileInfo(const unsigned int xid,
291                                   struct cifs_tcon *tcon,
292                                   const struct cifs_unix_set_info_args *args,
293                                   u16 fid, u32 pid_of_opener);
294
295 extern int CIFSSMBUnixSetPathInfo(const unsigned int xid,
296                                   struct cifs_tcon *tcon, const char *file_name,
297                                   const struct cifs_unix_set_info_args *args,
298                                   const struct nls_table *nls_codepage,
299                                   int remap);
300
301 extern int CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon,
302                         const char *name, struct cifs_sb_info *cifs_sb);
303 extern int CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon,
304                         const char *name, struct cifs_sb_info *cifs_sb);
305 extern int CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon,
306                         const char *name, __u16 type,
307                         const struct nls_table *nls_codepage,
308                         int remap_special_chars);
309 extern int CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon,
310                           const char *name, struct cifs_sb_info *cifs_sb);
311 extern int CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon,
312                          const char *from_name, const char *to_name,
313                          struct cifs_sb_info *cifs_sb);
314 extern int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *tcon,
315                                  int netfid, const char *target_name,
316                                  const struct nls_table *nls_codepage,
317                                  int remap_special_chars);
318 extern int CIFSCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
319                               const char *from_name, const char *to_name,
320                               struct cifs_sb_info *cifs_sb);
321 extern int CIFSUnixCreateHardLink(const unsigned int xid,
322                         struct cifs_tcon *tcon,
323                         const char *fromName, const char *toName,
324                         const struct nls_table *nls_codepage,
325                         int remap_special_chars);
326 extern int CIFSUnixCreateSymLink(const unsigned int xid,
327                         struct cifs_tcon *tcon,
328                         const char *fromName, const char *toName,
329                         const struct nls_table *nls_codepage);
330 extern int CIFSSMBUnixQuerySymLink(const unsigned int xid,
331                         struct cifs_tcon *tcon,
332                         const unsigned char *searchName, char **syminfo,
333                         const struct nls_table *nls_codepage);
334 #ifdef CONFIG_CIFS_SYMLINK_EXPERIMENTAL
335 extern int CIFSSMBQueryReparseLinkInfo(const unsigned int xid,
336                         struct cifs_tcon *tcon,
337                         const unsigned char *searchName,
338                         char *symlinkinfo, const int buflen, __u16 fid,
339                         const struct nls_table *nls_codepage);
340 #endif /* temporarily unused until cifs_symlink fixed */
341 extern int CIFSSMBOpen(const unsigned int xid, struct cifs_tcon *tcon,
342                         const char *fileName, const int disposition,
343                         const int access_flags, const int omode,
344                         __u16 *netfid, int *pOplock, FILE_ALL_INFO *,
345                         const struct nls_table *nls_codepage, int remap);
346 extern int SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon,
347                         const char *fileName, const int disposition,
348                         const int access_flags, const int omode,
349                         __u16 *netfid, int *pOplock, FILE_ALL_INFO *,
350                         const struct nls_table *nls_codepage, int remap);
351 extern int CIFSPOSIXCreate(const unsigned int xid, struct cifs_tcon *tcon,
352                         u32 posix_flags, __u64 mode, __u16 *netfid,
353                         FILE_UNIX_BASIC_INFO *pRetData,
354                         __u32 *pOplock, const char *name,
355                         const struct nls_table *nls_codepage, int remap);
356 extern int CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon,
357                         const int smb_file_id);
358
359 extern int CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon,
360                         const int smb_file_id);
361
362 extern int CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
363                         unsigned int *nbytes, char **buf,
364                         int *return_buf_type);
365 extern int CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
366                         unsigned int *nbytes, const char *buf,
367                         const char __user *ubuf, const int long_op);
368 extern int CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
369                         unsigned int *nbytes, struct kvec *iov, const int nvec);
370 extern int CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon,
371                                  const char *search_name, __u64 *inode_number,
372                                  const struct nls_table *nls_codepage,
373                                  int remap);
374
375 extern int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
376                       const __u16 netfid, const __u8 lock_type,
377                       const __u32 num_unlock, const __u32 num_lock,
378                       LOCKING_ANDX_RANGE *buf);
379 extern int CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
380                         const __u16 netfid, const __u32 netpid, const __u64 len,
381                         const __u64 offset, const __u32 numUnlock,
382                         const __u32 numLock, const __u8 lockType,
383                         const bool waitFlag, const __u8 oplock_level);
384 extern int CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
385                         const __u16 smb_file_id, const __u32 netpid,
386                         const loff_t start_offset, const __u64 len,
387                         struct file_lock *, const __u16 lock_type,
388                         const bool waitFlag);
389 extern int CIFSSMBTDis(const unsigned int xid, struct cifs_tcon *tcon);
390 extern int CIFSSMBEcho(struct TCP_Server_Info *server);
391 extern int CIFSSMBLogoff(const unsigned int xid, struct cifs_ses *ses);
392
393 extern struct cifs_ses *sesInfoAlloc(void);
394 extern void sesInfoFree(struct cifs_ses *);
395 extern struct cifs_tcon *tconInfoAlloc(void);
396 extern void tconInfoFree(struct cifs_tcon *);
397
398 extern int cifs_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server,
399                    __u32 *pexpected_response_sequence_number);
400 extern int cifs_sign_smbv(struct kvec *iov, int n_vec, struct TCP_Server_Info *,
401                           __u32 *);
402 extern int cifs_sign_smb(struct smb_hdr *, struct TCP_Server_Info *, __u32 *);
403 extern int cifs_verify_signature(struct smb_rqst *rqst,
404                                  struct TCP_Server_Info *server,
405                                 __u32 expected_sequence_number);
406 extern int SMBNTencrypt(unsigned char *, unsigned char *, unsigned char *,
407                         const struct nls_table *);
408 extern int setup_ntlm_response(struct cifs_ses *, const struct nls_table *);
409 extern int setup_ntlmv2_rsp(struct cifs_ses *, const struct nls_table *);
410 extern int cifs_crypto_shash_allocate(struct TCP_Server_Info *);
411 extern void cifs_crypto_shash_release(struct TCP_Server_Info *);
412 extern int calc_seckey(struct cifs_ses *);
413
414 #ifdef CONFIG_CIFS_WEAK_PW_HASH
415 extern int calc_lanman_hash(const char *password, const char *cryptkey,
416                                 bool encrypt, char *lnm_session_key);
417 #endif /* CIFS_WEAK_PW_HASH */
418 #ifdef CONFIG_CIFS_DNOTIFY_EXPERIMENTAL /* unused temporarily */
419 extern int CIFSSMBNotify(const unsigned int xid, struct cifs_tcon *tcon,
420                         const int notify_subdirs, const __u16 netfid,
421                         __u32 filter, struct file *file, int multishot,
422                         const struct nls_table *nls_codepage);
423 #endif /* was needed for dnotify, and will be needed for inotify when VFS fix */
424 extern int CIFSSMBCopy(unsigned int xid,
425                         struct cifs_tcon *source_tcon,
426                         const char *fromName,
427                         const __u16 target_tid,
428                         const char *toName, const int flags,
429                         const struct nls_table *nls_codepage,
430                         int remap_special_chars);
431 extern ssize_t CIFSSMBQAllEAs(const unsigned int xid, struct cifs_tcon *tcon,
432                         const unsigned char *searchName,
433                         const unsigned char *ea_name, char *EAData,
434                         size_t bufsize, const struct nls_table *nls_codepage,
435                         int remap_special_chars);
436 extern int CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
437                 const char *fileName, const char *ea_name,
438                 const void *ea_value, const __u16 ea_value_len,
439                 const struct nls_table *nls_codepage, int remap_special_chars);
440 extern int CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon,
441                         __u16 fid, struct cifs_ntsd **acl_inf, __u32 *buflen);
442 extern int CIFSSMBSetCIFSACL(const unsigned int, struct cifs_tcon *, __u16,
443                         struct cifs_ntsd *, __u32, int);
444 extern int CIFSSMBGetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
445                 const unsigned char *searchName,
446                 char *acl_inf, const int buflen, const int acl_type,
447                 const struct nls_table *nls_codepage, int remap_special_chars);
448 extern int CIFSSMBSetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
449                 const unsigned char *fileName,
450                 const char *local_acl, const int buflen, const int acl_type,
451                 const struct nls_table *nls_codepage, int remap_special_chars);
452 extern int CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
453                         const int netfid, __u64 *pExtAttrBits, __u64 *pMask);
454 extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb);
455 extern bool CIFSCouldBeMFSymlink(const struct cifs_fattr *fattr);
456 extern int CIFSCheckMFSymlink(struct cifs_fattr *fattr,
457                 const unsigned char *path,
458                 struct cifs_sb_info *cifs_sb, unsigned int xid);
459 extern int mdfour(unsigned char *, unsigned char *, int);
460 extern int E_md4hash(const unsigned char *passwd, unsigned char *p16,
461                         const struct nls_table *codepage);
462 extern int SMBencrypt(unsigned char *passwd, const unsigned char *c8,
463                         unsigned char *p24);
464
465 void cifs_readdata_release(struct kref *refcount);
466 int cifs_async_readv(struct cifs_readdata *rdata);
467 int cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid);
468
469 int cifs_async_writev(struct cifs_writedata *wdata);
470 void cifs_writev_complete(struct work_struct *work);
471 struct cifs_writedata *cifs_writedata_alloc(unsigned int nr_pages,
472                                                 work_func_t complete);
473 void cifs_writedata_release(struct kref *refcount);
474
475 #endif                  /* _CIFSPROTO_H */