aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-06-20 03:21:16 -0400
committerSteve French <smfrench@gmail.com>2012-07-24 11:25:08 -0400
commit6d5786a34d98bffb8ad50d8053d1e53231fe0636 (patch)
treeae49860befc52cb18dfb2b86929878a204289601 /fs/cifs
parent2e6e02ab6ddbd539fd7e092973daf057adbd53dc (diff)
CIFS: Rename Get/FreeXid and make them work with unsigned int
Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifs_dfs_ref.c7
-rw-r--r--fs/cifs/cifsacl.c21
-rw-r--r--fs/cifs/cifsfs.c6
-rw-r--r--fs/cifs/cifsproto.h171
-rw-r--r--fs/cifs/cifssmb.c146
-rw-r--r--fs/cifs/connect.c40
-rw-r--r--fs/cifs/dir.c43
-rw-r--r--fs/cifs/file.c133
-rw-r--r--fs/cifs/inode.c87
-rw-r--r--fs/cifs/ioctl.c6
-rw-r--r--fs/cifs/link.c24
-rw-r--r--fs/cifs/misc.c4
-rw-r--r--fs/cifs/readdir.c15
-rw-r--r--fs/cifs/xattr.c24
14 files changed, 375 insertions, 352 deletions
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index 6873bb634a97..ce5cbd717bfc 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -275,7 +275,8 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
275 struct cifs_sb_info *cifs_sb; 275 struct cifs_sb_info *cifs_sb;
276 struct cifs_ses *ses; 276 struct cifs_ses *ses;
277 char *full_path; 277 char *full_path;
278 int xid, i; 278 unsigned int xid;
279 int i;
279 int rc; 280 int rc;
280 struct vfsmount *mnt; 281 struct vfsmount *mnt;
281 struct tcon_link *tlink; 282 struct tcon_link *tlink;
@@ -302,11 +303,11 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
302 } 303 }
303 ses = tlink_tcon(tlink)->ses; 304 ses = tlink_tcon(tlink)->ses;
304 305
305 xid = GetXid(); 306 xid = get_xid();
306 rc = get_dfs_path(xid, ses, full_path + 1, cifs_sb->local_nls, 307 rc = get_dfs_path(xid, ses, full_path + 1, cifs_sb->local_nls,
307 &num_referrals, &referrals, 308 &num_referrals, &referrals,
308 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 309 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
309 FreeXid(xid); 310 free_xid(xid);
310 311
311 cifs_put_tlink(tlink); 312 cifs_put_tlink(tlink);
312 313
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index 1885da4fca82..05f4dc263a23 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -1153,15 +1153,16 @@ static struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
1153 __u16 fid, u32 *pacllen) 1153 __u16 fid, u32 *pacllen)
1154{ 1154{
1155 struct cifs_ntsd *pntsd = NULL; 1155 struct cifs_ntsd *pntsd = NULL;
1156 int xid, rc; 1156 unsigned int xid;
1157 int rc;
1157 struct tcon_link *tlink = cifs_sb_tlink(cifs_sb); 1158 struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
1158 1159
1159 if (IS_ERR(tlink)) 1160 if (IS_ERR(tlink))
1160 return ERR_CAST(tlink); 1161 return ERR_CAST(tlink);
1161 1162
1162 xid = GetXid(); 1163 xid = get_xid();
1163 rc = CIFSSMBGetCIFSACL(xid, tlink_tcon(tlink), fid, &pntsd, pacllen); 1164 rc = CIFSSMBGetCIFSACL(xid, tlink_tcon(tlink), fid, &pntsd, pacllen);
1164 FreeXid(xid); 1165 free_xid(xid);
1165 1166
1166 cifs_put_tlink(tlink); 1167 cifs_put_tlink(tlink);
1167 1168
@@ -1176,7 +1177,8 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
1176{ 1177{
1177 struct cifs_ntsd *pntsd = NULL; 1178 struct cifs_ntsd *pntsd = NULL;
1178 int oplock = 0; 1179 int oplock = 0;
1179 int xid, rc, create_options = 0; 1180 unsigned int xid;
1181 int rc, create_options = 0;
1180 __u16 fid; 1182 __u16 fid;
1181 struct cifs_tcon *tcon; 1183 struct cifs_tcon *tcon;
1182 struct tcon_link *tlink = cifs_sb_tlink(cifs_sb); 1184 struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
@@ -1185,7 +1187,7 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
1185 return ERR_CAST(tlink); 1187 return ERR_CAST(tlink);
1186 1188
1187 tcon = tlink_tcon(tlink); 1189 tcon = tlink_tcon(tlink);
1188 xid = GetXid(); 1190 xid = get_xid();
1189 1191
1190 if (backup_cred(cifs_sb)) 1192 if (backup_cred(cifs_sb))
1191 create_options |= CREATE_OPEN_BACKUP_INTENT; 1193 create_options |= CREATE_OPEN_BACKUP_INTENT;
@@ -1199,7 +1201,7 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
1199 } 1201 }
1200 1202
1201 cifs_put_tlink(tlink); 1203 cifs_put_tlink(tlink);
1202 FreeXid(xid); 1204 free_xid(xid);
1203 1205
1204 cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen); 1206 cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen);
1205 if (rc) 1207 if (rc)
@@ -1230,7 +1232,8 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
1230 struct inode *inode, const char *path, int aclflag) 1232 struct inode *inode, const char *path, int aclflag)
1231{ 1233{
1232 int oplock = 0; 1234 int oplock = 0;
1233 int xid, rc, access_flags, create_options = 0; 1235 unsigned int xid;
1236 int rc, access_flags, create_options = 0;
1234 __u16 fid; 1237 __u16 fid;
1235 struct cifs_tcon *tcon; 1238 struct cifs_tcon *tcon;
1236 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 1239 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
@@ -1240,7 +1243,7 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
1240 return PTR_ERR(tlink); 1243 return PTR_ERR(tlink);
1241 1244
1242 tcon = tlink_tcon(tlink); 1245 tcon = tlink_tcon(tlink);
1243 xid = GetXid(); 1246 xid = get_xid();
1244 1247
1245 if (backup_cred(cifs_sb)) 1248 if (backup_cred(cifs_sb))
1246 create_options |= CREATE_OPEN_BACKUP_INTENT; 1249 create_options |= CREATE_OPEN_BACKUP_INTENT;
@@ -1263,7 +1266,7 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
1263 1266
1264 CIFSSMBClose(xid, tcon, fid); 1267 CIFSSMBClose(xid, tcon, fid);
1265out: 1268out:
1266 FreeXid(xid); 1269 free_xid(xid);
1267 cifs_put_tlink(tlink); 1270 cifs_put_tlink(tlink);
1268 return rc; 1271 return rc;
1269} 1272}
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index a7610cfedf0a..2e9929dc2072 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -158,9 +158,9 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
158 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 158 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
159 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); 159 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
160 int rc = -EOPNOTSUPP; 160 int rc = -EOPNOTSUPP;
161 int xid; 161 unsigned int xid;
162 162
163 xid = GetXid(); 163 xid = get_xid();
164 164
165 buf->f_type = CIFS_MAGIC_NUMBER; 165 buf->f_type = CIFS_MAGIC_NUMBER;
166 166
@@ -197,7 +197,7 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
197 if (rc) 197 if (rc)
198 rc = SMBOldQFSInfo(xid, tcon, buf); 198 rc = SMBOldQFSInfo(xid, tcon, buf);
199 199
200 FreeXid(xid); 200 free_xid(xid);
201 return 0; 201 return 0;
202} 202}
203 203
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 5fbd6b9a64d9..8797e4064662 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -37,20 +37,20 @@ extern struct smb_hdr *cifs_small_buf_get(void);
37extern void cifs_small_buf_release(void *); 37extern void cifs_small_buf_release(void *);
38extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *, 38extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
39 unsigned int /* length */); 39 unsigned int /* length */);
40extern unsigned int _GetXid(void); 40extern unsigned int _get_xid(void);
41extern void _FreeXid(unsigned int); 41extern void _free_xid(unsigned int);
42#define GetXid() \ 42#define get_xid() \
43({ \ 43({ \
44 int __xid = (int)_GetXid(); \ 44 unsigned int __xid = _get_xid(); \
45 cFYI(1, "CIFS VFS: in %s as Xid: %d with uid: %d", \ 45 cFYI(1, "CIFS VFS: in %s as Xid: %u with uid: %d", \
46 __func__, __xid, current_fsuid()); \ 46 __func__, __xid, current_fsuid()); \
47 __xid; \ 47 __xid; \
48}) 48})
49 49
50#define FreeXid(curr_xid) \ 50#define free_xid(curr_xid) \
51do { \ 51do { \
52 _FreeXid(curr_xid); \ 52 _free_xid(curr_xid); \
53 cFYI(1, "CIFS VFS: leaving %s (xid = %d) rc = %d", \ 53 cFYI(1, "CIFS VFS: leaving %s (xid = %u) rc = %d", \
54 __func__, curr_xid, (int)rc); \ 54 __func__, curr_xid, (int)rc); \
55} while (0) 55} while (0)
56extern int init_cifs_idmap(void); 56extern int init_cifs_idmap(void);
@@ -123,10 +123,10 @@ extern void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock);
123extern struct cifsFileInfo *cifs_new_fileinfo(__u16 fileHandle, 123extern struct cifsFileInfo *cifs_new_fileinfo(__u16 fileHandle,
124 struct file *file, struct tcon_link *tlink, 124 struct file *file, struct tcon_link *tlink,
125 __u32 oplock); 125 __u32 oplock);
126extern int cifs_posix_open(char *full_path, struct inode **pinode, 126extern int cifs_posix_open(char *full_path, struct inode **inode,
127 struct super_block *sb, 127 struct super_block *sb, int mode,
128 int mode, unsigned int f_flags, 128 unsigned int f_flags, __u32 *oplock, __u16 *netfid,
129 __u32 *poplock, __u16 *pnetfid, int xid); 129 unsigned int xid);
130void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr); 130void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr);
131extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, 131extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr,
132 FILE_UNIX_BASIC_INFO *info, 132 FILE_UNIX_BASIC_INFO *info,
@@ -139,11 +139,12 @@ extern int cifs_get_file_info(struct file *filp);
139extern int cifs_get_inode_info(struct inode **pinode, 139extern int cifs_get_inode_info(struct inode **pinode,
140 const unsigned char *search_path, 140 const unsigned char *search_path,
141 FILE_ALL_INFO *pfile_info, 141 FILE_ALL_INFO *pfile_info,
142 struct super_block *sb, int xid, const __u16 *pfid); 142 struct super_block *sb, unsigned int xid,
143 const __u16 *pfid);
143extern int cifs_get_file_info_unix(struct file *filp); 144extern int cifs_get_file_info_unix(struct file *filp);
144extern int cifs_get_inode_info_unix(struct inode **pinode, 145extern int cifs_get_inode_info_unix(struct inode **pinode,
145 const unsigned char *search_path, 146 const unsigned char *search_path,
146 struct super_block *sb, int xid); 147 struct super_block *sb, unsigned int xid);
147extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, 148extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb,
148 struct cifs_fattr *fattr, struct inode *inode, 149 struct cifs_fattr *fattr, struct inode *inode,
149 const char *path, const __u16 *pfid); 150 const char *path, const __u16 *pfid);
@@ -188,88 +189,90 @@ extern int CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
188 const char *tree, struct cifs_tcon *tcon, 189 const char *tree, struct cifs_tcon *tcon,
189 const struct nls_table *); 190 const struct nls_table *);
190 191
191extern int CIFSFindFirst(const int xid, struct cifs_tcon *tcon, 192extern int CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon,
192 const char *searchName, const struct nls_table *nls_codepage, 193 const char *searchName, const struct nls_table *nls_codepage,
193 __u16 *searchHandle, __u16 search_flags, 194 __u16 *searchHandle, __u16 search_flags,
194 struct cifs_search_info *psrch_inf, 195 struct cifs_search_info *psrch_inf,
195 int map, const char dirsep); 196 int map, const char dirsep);
196 197
197extern int CIFSFindNext(const int xid, struct cifs_tcon *tcon, 198extern int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
198 __u16 searchHandle, __u16 search_flags, 199 __u16 searchHandle, __u16 search_flags,
199 struct cifs_search_info *psrch_inf); 200 struct cifs_search_info *psrch_inf);
200 201
201extern int CIFSFindClose(const int, struct cifs_tcon *tcon, 202extern int CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
202 const __u16 search_handle); 203 const __u16 search_handle);
203 204
204extern int CIFSSMBQFileInfo(const int xid, struct cifs_tcon *tcon, 205extern int CIFSSMBQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
205 u16 netfid, FILE_ALL_INFO *pFindData); 206 u16 netfid, FILE_ALL_INFO *pFindData);
206extern int CIFSSMBQPathInfo(const int xid, struct cifs_tcon *tcon, 207extern int CIFSSMBQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
207 const unsigned char *searchName, 208 const unsigned char *searchName,
208 FILE_ALL_INFO *findData, 209 FILE_ALL_INFO *findData,
209 int legacy /* whether to use old info level */, 210 int legacy /* whether to use old info level */,
210 const struct nls_table *nls_codepage, int remap); 211 const struct nls_table *nls_codepage, int remap);
211extern int SMBQueryInformation(const int xid, struct cifs_tcon *tcon, 212extern int SMBQueryInformation(const unsigned int xid, struct cifs_tcon *tcon,
212 const unsigned char *searchName, 213 const unsigned char *searchName,
213 FILE_ALL_INFO *findData, 214 FILE_ALL_INFO *findData,
214 const struct nls_table *nls_codepage, int remap); 215 const struct nls_table *nls_codepage, int remap);
215 216
216extern int CIFSSMBUnixQFileInfo(const int xid, struct cifs_tcon *tcon, 217extern int CIFSSMBUnixQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
217 u16 netfid, FILE_UNIX_BASIC_INFO *pFindData); 218 u16 netfid, FILE_UNIX_BASIC_INFO *pFindData);
218extern int CIFSSMBUnixQPathInfo(const int xid, 219extern int CIFSSMBUnixQPathInfo(const unsigned int xid,
219 struct cifs_tcon *tcon, 220 struct cifs_tcon *tcon,
220 const unsigned char *searchName, 221 const unsigned char *searchName,
221 FILE_UNIX_BASIC_INFO *pFindData, 222 FILE_UNIX_BASIC_INFO *pFindData,
222 const struct nls_table *nls_codepage, int remap); 223 const struct nls_table *nls_codepage, int remap);
223 224
224extern int CIFSGetDFSRefer(const int xid, struct cifs_ses *ses, 225extern int CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
225 const unsigned char *searchName, 226 const unsigned char *searchName,
226 struct dfs_info3_param **target_nodes, 227 struct dfs_info3_param **target_nodes,
227 unsigned int *number_of_nodes_in_array, 228 unsigned int *number_of_nodes_in_array,
228 const struct nls_table *nls_codepage, int remap); 229 const struct nls_table *nls_codepage, int remap);
229 230
230extern int get_dfs_path(int xid, struct cifs_ses *pSesInfo, 231extern int get_dfs_path(unsigned int xid, struct cifs_ses *pSesInfo,
231 const char *old_path, 232 const char *old_path,
232 const struct nls_table *nls_codepage, 233 const struct nls_table *nls_codepage,
233 unsigned int *pnum_referrals, 234 unsigned int *pnum_referrals,
234 struct dfs_info3_param **preferrals, 235 struct dfs_info3_param **preferrals,
235 int remap); 236 int remap);
236extern void reset_cifs_unix_caps(int xid, struct cifs_tcon *tcon, 237extern void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
237 struct cifs_sb_info *cifs_sb, 238 struct cifs_sb_info *cifs_sb,
238 struct smb_vol *vol); 239 struct smb_vol *vol);
239extern int CIFSSMBQFSInfo(const int xid, struct cifs_tcon *tcon, 240extern int CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
240 struct kstatfs *FSData); 241 struct kstatfs *FSData);
241extern int SMBOldQFSInfo(const int xid, struct cifs_tcon *tcon, 242extern int SMBOldQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
242 struct kstatfs *FSData); 243 struct kstatfs *FSData);
243extern int CIFSSMBSetFSUnixInfo(const int xid, struct cifs_tcon *tcon, 244extern int CIFSSMBSetFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon,
244 __u64 cap); 245 __u64 cap);
245 246
246extern int CIFSSMBQFSAttributeInfo(const int xid, 247extern int CIFSSMBQFSAttributeInfo(const unsigned int xid,
247 struct cifs_tcon *tcon); 248 struct cifs_tcon *tcon);
248extern int CIFSSMBQFSDeviceInfo(const int xid, struct cifs_tcon *tcon); 249extern int CIFSSMBQFSDeviceInfo(const unsigned int xid, struct cifs_tcon *tcon);
249extern int CIFSSMBQFSUnixInfo(const int xid, struct cifs_tcon *tcon); 250extern int CIFSSMBQFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon);
250extern int CIFSSMBQFSPosixInfo(const int xid, struct cifs_tcon *tcon, 251extern int CIFSSMBQFSPosixInfo(const unsigned int xid, struct cifs_tcon *tcon,
251 struct kstatfs *FSData); 252 struct kstatfs *FSData);
252 253
253extern int CIFSSMBSetPathInfo(const int xid, struct cifs_tcon *tcon, 254extern int CIFSSMBSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
254 const char *fileName, const FILE_BASIC_INFO *data, 255 const char *fileName, const FILE_BASIC_INFO *data,
255 const struct nls_table *nls_codepage, 256 const struct nls_table *nls_codepage,
256 int remap_special_chars); 257 int remap_special_chars);
257extern int CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon, 258extern int CIFSSMBSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
258 const FILE_BASIC_INFO *data, __u16 fid, 259 const FILE_BASIC_INFO *data, __u16 fid,
259 __u32 pid_of_opener); 260 __u32 pid_of_opener);
260extern int CIFSSMBSetFileDisposition(const int xid, struct cifs_tcon *tcon, 261extern int CIFSSMBSetFileDisposition(const unsigned int xid,
261 bool delete_file, __u16 fid, __u32 pid_of_opener); 262 struct cifs_tcon *tcon,
263 bool delete_file, __u16 fid,
264 __u32 pid_of_opener);
262#if 0 265#if 0
263extern int CIFSSMBSetAttrLegacy(int xid, struct cifs_tcon *tcon, 266extern int CIFSSMBSetAttrLegacy(unsigned int xid, struct cifs_tcon *tcon,
264 char *fileName, __u16 dos_attributes, 267 char *fileName, __u16 dos_attributes,
265 const struct nls_table *nls_codepage); 268 const struct nls_table *nls_codepage);
266#endif /* possibly unneeded function */ 269#endif /* possibly unneeded function */
267extern int CIFSSMBSetEOF(const int xid, struct cifs_tcon *tcon, 270extern int CIFSSMBSetEOF(const unsigned int xid, struct cifs_tcon *tcon,
268 const char *fileName, __u64 size, 271 const char *fileName, __u64 size,
269 bool setAllocationSizeFlag, 272 bool setAllocationSizeFlag,
270 const struct nls_table *nls_codepage, 273 const struct nls_table *nls_codepage,
271 int remap_special_chars); 274 int remap_special_chars);
272extern int CIFSSMBSetFileSize(const int xid, struct cifs_tcon *tcon, 275extern int CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon,
273 __u64 size, __u16 fileHandle, __u32 opener_pid, 276 __u64 size, __u16 fileHandle, __u32 opener_pid,
274 bool AllocSizeFlag); 277 bool AllocSizeFlag);
275 278
@@ -283,108 +286,110 @@ struct cifs_unix_set_info_args {
283 dev_t device; 286 dev_t device;
284}; 287};
285 288
286extern int CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon, 289extern int CIFSSMBUnixSetFileInfo(const unsigned int xid,
290 struct cifs_tcon *tcon,
287 const struct cifs_unix_set_info_args *args, 291 const struct cifs_unix_set_info_args *args,
288 u16 fid, u32 pid_of_opener); 292 u16 fid, u32 pid_of_opener);
289 293
290extern int CIFSSMBUnixSetPathInfo(const int xid, struct cifs_tcon *pTcon, 294extern int CIFSSMBUnixSetPathInfo(const unsigned int xid,
291 char *fileName, 295 struct cifs_tcon *tcon, char *file_name,
292 const struct cifs_unix_set_info_args *args, 296 const struct cifs_unix_set_info_args *args,
293 const struct nls_table *nls_codepage, 297 const struct nls_table *nls_codepage,
294 int remap_special_chars); 298 int remap_special_chars);
295 299
296extern int CIFSSMBMkDir(const int xid, struct cifs_tcon *tcon, 300extern int CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon,
297 const char *newName, 301 const char *newName,
298 const struct nls_table *nls_codepage, 302 const struct nls_table *nls_codepage,
299 int remap_special_chars); 303 int remap_special_chars);
300extern int CIFSSMBRmDir(const int xid, struct cifs_tcon *tcon, 304extern int CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon,
301 const char *name, const struct nls_table *nls_codepage, 305 const char *name, const struct nls_table *nls_codepage,
302 int remap_special_chars); 306 int remap_special_chars);
303extern int CIFSPOSIXDelFile(const int xid, struct cifs_tcon *tcon, 307extern int CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon,
304 const char *name, __u16 type, 308 const char *name, __u16 type,
305 const struct nls_table *nls_codepage, 309 const struct nls_table *nls_codepage,
306 int remap_special_chars); 310 int remap_special_chars);
307extern int CIFSSMBDelFile(const int xid, struct cifs_tcon *tcon, 311extern int CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon,
308 const char *name, 312 const char *name,
309 const struct nls_table *nls_codepage, 313 const struct nls_table *nls_codepage,
310 int remap_special_chars); 314 int remap_special_chars);
311extern int CIFSSMBRename(const int xid, struct cifs_tcon *tcon, 315extern int CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon,
312 const char *fromName, const char *toName, 316 const char *fromName, const char *toName,
313 const struct nls_table *nls_codepage, 317 const struct nls_table *nls_codepage,
314 int remap_special_chars); 318 int remap_special_chars);
315extern int CIFSSMBRenameOpenFile(const int xid, struct cifs_tcon *pTcon, 319extern int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *tcon,
316 int netfid, const char *target_name, 320 int netfid, const char *target_name,
317 const struct nls_table *nls_codepage, 321 const struct nls_table *nls_codepage,
318 int remap_special_chars); 322 int remap_special_chars);
319extern int CIFSCreateHardLink(const int xid, 323extern int CIFSCreateHardLink(const unsigned int xid,
320 struct cifs_tcon *tcon, 324 struct cifs_tcon *tcon,
321 const char *fromName, const char *toName, 325 const char *fromName, const char *toName,
322 const struct nls_table *nls_codepage, 326 const struct nls_table *nls_codepage,
323 int remap_special_chars); 327 int remap_special_chars);
324extern int CIFSUnixCreateHardLink(const int xid, 328extern int CIFSUnixCreateHardLink(const unsigned int xid,
325 struct cifs_tcon *tcon, 329 struct cifs_tcon *tcon,
326 const char *fromName, const char *toName, 330 const char *fromName, const char *toName,
327 const struct nls_table *nls_codepage, 331 const struct nls_table *nls_codepage,
328 int remap_special_chars); 332 int remap_special_chars);
329extern int CIFSUnixCreateSymLink(const int xid, 333extern int CIFSUnixCreateSymLink(const unsigned int xid,
330 struct cifs_tcon *tcon, 334 struct cifs_tcon *tcon,
331 const char *fromName, const char *toName, 335 const char *fromName, const char *toName,
332 const struct nls_table *nls_codepage); 336 const struct nls_table *nls_codepage);
333extern int CIFSSMBUnixQuerySymLink(const int xid, 337extern int CIFSSMBUnixQuerySymLink(const unsigned int xid,
334 struct cifs_tcon *tcon, 338 struct cifs_tcon *tcon,
335 const unsigned char *searchName, char **syminfo, 339 const unsigned char *searchName, char **syminfo,
336 const struct nls_table *nls_codepage); 340 const struct nls_table *nls_codepage);
337#ifdef CONFIG_CIFS_SYMLINK_EXPERIMENTAL 341#ifdef CONFIG_CIFS_SYMLINK_EXPERIMENTAL
338extern int CIFSSMBQueryReparseLinkInfo(const int xid, 342extern int CIFSSMBQueryReparseLinkInfo(const unsigned int xid,
339 struct cifs_tcon *tcon, 343 struct cifs_tcon *tcon,
340 const unsigned char *searchName, 344 const unsigned char *searchName,
341 char *symlinkinfo, const int buflen, __u16 fid, 345 char *symlinkinfo, const int buflen, __u16 fid,
342 const struct nls_table *nls_codepage); 346 const struct nls_table *nls_codepage);
343#endif /* temporarily unused until cifs_symlink fixed */ 347#endif /* temporarily unused until cifs_symlink fixed */
344extern int CIFSSMBOpen(const int xid, struct cifs_tcon *tcon, 348extern int CIFSSMBOpen(const unsigned int xid, struct cifs_tcon *tcon,
345 const char *fileName, const int disposition, 349 const char *fileName, const int disposition,
346 const int access_flags, const int omode, 350 const int access_flags, const int omode,
347 __u16 *netfid, int *pOplock, FILE_ALL_INFO *, 351 __u16 *netfid, int *pOplock, FILE_ALL_INFO *,
348 const struct nls_table *nls_codepage, int remap); 352 const struct nls_table *nls_codepage, int remap);
349extern int SMBLegacyOpen(const int xid, struct cifs_tcon *tcon, 353extern int SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon,
350 const char *fileName, const int disposition, 354 const char *fileName, const int disposition,
351 const int access_flags, const int omode, 355 const int access_flags, const int omode,
352 __u16 *netfid, int *pOplock, FILE_ALL_INFO *, 356 __u16 *netfid, int *pOplock, FILE_ALL_INFO *,
353 const struct nls_table *nls_codepage, int remap); 357 const struct nls_table *nls_codepage, int remap);
354extern int CIFSPOSIXCreate(const int xid, struct cifs_tcon *tcon, 358extern int CIFSPOSIXCreate(const unsigned int xid, struct cifs_tcon *tcon,
355 u32 posix_flags, __u64 mode, __u16 *netfid, 359 u32 posix_flags, __u64 mode, __u16 *netfid,
356 FILE_UNIX_BASIC_INFO *pRetData, 360 FILE_UNIX_BASIC_INFO *pRetData,
357 __u32 *pOplock, const char *name, 361 __u32 *pOplock, const char *name,
358 const struct nls_table *nls_codepage, int remap); 362 const struct nls_table *nls_codepage, int remap);
359extern int CIFSSMBClose(const int xid, struct cifs_tcon *tcon, 363extern int CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon,
360 const int smb_file_id); 364 const int smb_file_id);
361 365
362extern int CIFSSMBFlush(const int xid, struct cifs_tcon *tcon, 366extern int CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon,
363 const int smb_file_id); 367 const int smb_file_id);
364 368
365extern int CIFSSMBRead(const int xid, struct cifs_io_parms *io_parms, 369extern int CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
366 unsigned int *nbytes, char **buf, 370 unsigned int *nbytes, char **buf,
367 int *return_buf_type); 371 int *return_buf_type);
368extern int CIFSSMBWrite(const int xid, struct cifs_io_parms *io_parms, 372extern int CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
369 unsigned int *nbytes, const char *buf, 373 unsigned int *nbytes, const char *buf,
370 const char __user *ubuf, const int long_op); 374 const char __user *ubuf, const int long_op);
371extern int CIFSSMBWrite2(const int xid, struct cifs_io_parms *io_parms, 375extern int CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
372 unsigned int *nbytes, struct kvec *iov, const int nvec, 376 unsigned int *nbytes, struct kvec *iov, const int nvec,
373 const int long_op); 377 const int long_op);
374extern int CIFSGetSrvInodeNumber(const int xid, struct cifs_tcon *tcon, 378extern int CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon,
375 const unsigned char *searchName, __u64 *inode_number, 379 const unsigned char *searchName, __u64 *inode_number,
376 const struct nls_table *nls_codepage, 380 const struct nls_table *nls_codepage,
377 int remap_special_chars); 381 int remap_special_chars);
378 382
379extern int cifs_lockv(const int xid, struct cifs_tcon *tcon, const __u16 netfid, 383extern int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
380 const __u8 lock_type, const __u32 num_unlock, 384 const __u16 netfid, const __u8 lock_type,
381 const __u32 num_lock, LOCKING_ANDX_RANGE *buf); 385 const __u32 num_unlock, const __u32 num_lock,
382extern int CIFSSMBLock(const int xid, struct cifs_tcon *tcon, 386 LOCKING_ANDX_RANGE *buf);
387extern int CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
383 const __u16 netfid, const __u32 netpid, const __u64 len, 388 const __u16 netfid, const __u32 netpid, const __u64 len,
384 const __u64 offset, const __u32 numUnlock, 389 const __u64 offset, const __u32 numUnlock,
385 const __u32 numLock, const __u8 lockType, 390 const __u32 numLock, const __u8 lockType,
386 const bool waitFlag, const __u8 oplock_level); 391 const bool waitFlag, const __u8 oplock_level);
387extern int CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon, 392extern int CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
388 const __u16 smb_file_id, const __u32 netpid, 393 const __u16 smb_file_id, const __u32 netpid,
389 const loff_t start_offset, const __u64 len, 394 const loff_t start_offset, const __u64 len,
390 struct file_lock *, const __u16 lock_type, 395 struct file_lock *, const __u16 lock_type,
@@ -417,46 +422,46 @@ extern int calc_lanman_hash(const char *password, const char *cryptkey,
417 bool encrypt, char *lnm_session_key); 422 bool encrypt, char *lnm_session_key);
418#endif /* CIFS_WEAK_PW_HASH */ 423#endif /* CIFS_WEAK_PW_HASH */
419#ifdef CONFIG_CIFS_DNOTIFY_EXPERIMENTAL /* unused temporarily */ 424#ifdef CONFIG_CIFS_DNOTIFY_EXPERIMENTAL /* unused temporarily */
420extern int CIFSSMBNotify(const int xid, struct cifs_tcon *tcon, 425extern int CIFSSMBNotify(const unsigned int xid, struct cifs_tcon *tcon,
421 const int notify_subdirs, const __u16 netfid, 426 const int notify_subdirs, const __u16 netfid,
422 __u32 filter, struct file *file, int multishot, 427 __u32 filter, struct file *file, int multishot,
423 const struct nls_table *nls_codepage); 428 const struct nls_table *nls_codepage);
424#endif /* was needed for dnotify, and will be needed for inotify when VFS fix */ 429#endif /* was needed for dnotify, and will be needed for inotify when VFS fix */
425extern int CIFSSMBCopy(int xid, 430extern int CIFSSMBCopy(unsigned int xid,
426 struct cifs_tcon *source_tcon, 431 struct cifs_tcon *source_tcon,
427 const char *fromName, 432 const char *fromName,
428 const __u16 target_tid, 433 const __u16 target_tid,
429 const char *toName, const int flags, 434 const char *toName, const int flags,
430 const struct nls_table *nls_codepage, 435 const struct nls_table *nls_codepage,
431 int remap_special_chars); 436 int remap_special_chars);
432extern ssize_t CIFSSMBQAllEAs(const int xid, struct cifs_tcon *tcon, 437extern ssize_t CIFSSMBQAllEAs(const unsigned int xid, struct cifs_tcon *tcon,
433 const unsigned char *searchName, 438 const unsigned char *searchName,
434 const unsigned char *ea_name, char *EAData, 439 const unsigned char *ea_name, char *EAData,
435 size_t bufsize, const struct nls_table *nls_codepage, 440 size_t bufsize, const struct nls_table *nls_codepage,
436 int remap_special_chars); 441 int remap_special_chars);
437extern int CIFSSMBSetEA(const int xid, struct cifs_tcon *tcon, 442extern int CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
438 const char *fileName, const char *ea_name, 443 const char *fileName, const char *ea_name,
439 const void *ea_value, const __u16 ea_value_len, 444 const void *ea_value, const __u16 ea_value_len,
440 const struct nls_table *nls_codepage, int remap_special_chars); 445 const struct nls_table *nls_codepage, int remap_special_chars);
441extern int CIFSSMBGetCIFSACL(const int xid, struct cifs_tcon *tcon, 446extern int CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon,
442 __u16 fid, struct cifs_ntsd **acl_inf, __u32 *buflen); 447 __u16 fid, struct cifs_ntsd **acl_inf, __u32 *buflen);
443extern int CIFSSMBSetCIFSACL(const int, struct cifs_tcon *, __u16, 448extern int CIFSSMBSetCIFSACL(const unsigned int, struct cifs_tcon *, __u16,
444 struct cifs_ntsd *, __u32, int); 449 struct cifs_ntsd *, __u32, int);
445extern int CIFSSMBGetPosixACL(const int xid, struct cifs_tcon *tcon, 450extern int CIFSSMBGetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
446 const unsigned char *searchName, 451 const unsigned char *searchName,
447 char *acl_inf, const int buflen, const int acl_type, 452 char *acl_inf, const int buflen, const int acl_type,
448 const struct nls_table *nls_codepage, int remap_special_chars); 453 const struct nls_table *nls_codepage, int remap_special_chars);
449extern int CIFSSMBSetPosixACL(const int xid, struct cifs_tcon *tcon, 454extern int CIFSSMBSetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
450 const unsigned char *fileName, 455 const unsigned char *fileName,
451 const char *local_acl, const int buflen, const int acl_type, 456 const char *local_acl, const int buflen, const int acl_type,
452 const struct nls_table *nls_codepage, int remap_special_chars); 457 const struct nls_table *nls_codepage, int remap_special_chars);
453extern int CIFSGetExtAttr(const int xid, struct cifs_tcon *tcon, 458extern int CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
454 const int netfid, __u64 *pExtAttrBits, __u64 *pMask); 459 const int netfid, __u64 *pExtAttrBits, __u64 *pMask);
455extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb); 460extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb);
456extern bool CIFSCouldBeMFSymlink(const struct cifs_fattr *fattr); 461extern bool CIFSCouldBeMFSymlink(const struct cifs_fattr *fattr);
457extern int CIFSCheckMFSymlink(struct cifs_fattr *fattr, 462extern int CIFSCheckMFSymlink(struct cifs_fattr *fattr,
458 const unsigned char *path, 463 const unsigned char *path,
459 struct cifs_sb_info *cifs_sb, int xid); 464 struct cifs_sb_info *cifs_sb, unsigned int xid);
460extern int mdfour(unsigned char *, unsigned char *, int); 465extern int mdfour(unsigned char *, unsigned char *, int);
461extern int E_md4hash(const unsigned char *passwd, unsigned char *p16, 466extern int E_md4hash(const unsigned char *passwd, unsigned char *p16,
462 const struct nls_table *codepage); 467 const struct nls_table *codepage);
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 98fc454827af..7a3b4a3b113b 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -828,8 +828,9 @@ session_already_dead:
828} 828}
829 829
830int 830int
831CIFSPOSIXDelFile(const int xid, struct cifs_tcon *tcon, const char *fileName, 831CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon,
832 __u16 type, const struct nls_table *nls_codepage, int remap) 832 const char *fileName, __u16 type,
833 const struct nls_table *nls_codepage, int remap)
833{ 834{
834 TRANSACTION2_SPI_REQ *pSMB = NULL; 835 TRANSACTION2_SPI_REQ *pSMB = NULL;
835 TRANSACTION2_SPI_RSP *pSMBr = NULL; 836 TRANSACTION2_SPI_RSP *pSMBr = NULL;
@@ -903,8 +904,9 @@ PsxDelete:
903} 904}
904 905
905int 906int
906CIFSSMBDelFile(const int xid, struct cifs_tcon *tcon, const char *fileName, 907CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon,
907 const struct nls_table *nls_codepage, int remap) 908 const char *fileName, const struct nls_table *nls_codepage,
909 int remap)
908{ 910{
909 DELETE_FILE_REQ *pSMB = NULL; 911 DELETE_FILE_REQ *pSMB = NULL;
910 DELETE_FILE_RSP *pSMBr = NULL; 912 DELETE_FILE_RSP *pSMBr = NULL;
@@ -948,8 +950,9 @@ DelFileRetry:
948} 950}
949 951
950int 952int
951CIFSSMBRmDir(const int xid, struct cifs_tcon *tcon, const char *dirName, 953CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon,
952 const struct nls_table *nls_codepage, int remap) 954 const char *dirName, const struct nls_table *nls_codepage,
955 int remap)
953{ 956{
954 DELETE_DIRECTORY_REQ *pSMB = NULL; 957 DELETE_DIRECTORY_REQ *pSMB = NULL;
955 DELETE_DIRECTORY_RSP *pSMBr = NULL; 958 DELETE_DIRECTORY_RSP *pSMBr = NULL;
@@ -991,7 +994,7 @@ RmDirRetry:
991} 994}
992 995
993int 996int
994CIFSSMBMkDir(const int xid, struct cifs_tcon *tcon, 997CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon,
995 const char *name, const struct nls_table *nls_codepage, int remap) 998 const char *name, const struct nls_table *nls_codepage, int remap)
996{ 999{
997 int rc = 0; 1000 int rc = 0;
@@ -1034,10 +1037,11 @@ MkDirRetry:
1034} 1037}
1035 1038
1036int 1039int
1037CIFSPOSIXCreate(const int xid, struct cifs_tcon *tcon, __u32 posix_flags, 1040CIFSPOSIXCreate(const unsigned int xid, struct cifs_tcon *tcon,
1038 __u64 mode, __u16 *netfid, FILE_UNIX_BASIC_INFO *pRetData, 1041 __u32 posix_flags, __u64 mode, __u16 *netfid,
1039 __u32 *pOplock, const char *name, 1042 FILE_UNIX_BASIC_INFO *pRetData, __u32 *pOplock,
1040 const struct nls_table *nls_codepage, int remap) 1043 const char *name, const struct nls_table *nls_codepage,
1044 int remap)
1041{ 1045{
1042 TRANSACTION2_SPI_REQ *pSMB = NULL; 1046 TRANSACTION2_SPI_REQ *pSMB = NULL;
1043 TRANSACTION2_SPI_RSP *pSMBr = NULL; 1047 TRANSACTION2_SPI_RSP *pSMBr = NULL;
@@ -1200,7 +1204,7 @@ access_flags_to_smbopen_mode(const int access_flags)
1200} 1204}
1201 1205
1202int 1206int
1203SMBLegacyOpen(const int xid, struct cifs_tcon *tcon, 1207SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon,
1204 const char *fileName, const int openDisposition, 1208 const char *fileName, const int openDisposition,
1205 const int access_flags, const int create_options, __u16 *netfid, 1209 const int access_flags, const int create_options, __u16 *netfid,
1206 int *pOplock, FILE_ALL_INFO *pfile_info, 1210 int *pOplock, FILE_ALL_INFO *pfile_info,
@@ -1307,7 +1311,7 @@ OldOpenRetry:
1307} 1311}
1308 1312
1309int 1313int
1310CIFSSMBOpen(const int xid, struct cifs_tcon *tcon, 1314CIFSSMBOpen(const unsigned int xid, struct cifs_tcon *tcon,
1311 const char *fileName, const int openDisposition, 1315 const char *fileName, const int openDisposition,
1312 const int access_flags, const int create_options, __u16 *netfid, 1316 const int access_flags, const int create_options, __u16 *netfid,
1313 int *pOplock, FILE_ALL_INFO *pfile_info, 1317 int *pOplock, FILE_ALL_INFO *pfile_info,
@@ -1657,8 +1661,8 @@ cifs_async_readv(struct cifs_readdata *rdata)
1657} 1661}
1658 1662
1659int 1663int
1660CIFSSMBRead(const int xid, struct cifs_io_parms *io_parms, unsigned int *nbytes, 1664CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
1661 char **buf, int *pbuf_type) 1665 unsigned int *nbytes, char **buf, int *pbuf_type)
1662{ 1666{
1663 int rc = -EACCES; 1667 int rc = -EACCES;
1664 READ_REQ *pSMB = NULL; 1668 READ_REQ *pSMB = NULL;
@@ -1769,7 +1773,7 @@ CIFSSMBRead(const int xid, struct cifs_io_parms *io_parms, unsigned int *nbytes,
1769 1773
1770 1774
1771int 1775int
1772CIFSSMBWrite(const int xid, struct cifs_io_parms *io_parms, 1776CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
1773 unsigned int *nbytes, const char *buf, 1777 unsigned int *nbytes, const char *buf,
1774 const char __user *ubuf, const int long_op) 1778 const char __user *ubuf, const int long_op)
1775{ 1779{
@@ -2136,7 +2140,7 @@ async_writev_out:
2136} 2140}
2137 2141
2138int 2142int
2139CIFSSMBWrite2(const int xid, struct cifs_io_parms *io_parms, 2143CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
2140 unsigned int *nbytes, struct kvec *iov, int n_vec, 2144 unsigned int *nbytes, struct kvec *iov, int n_vec,
2141 const int long_op) 2145 const int long_op)
2142{ 2146{
@@ -2244,8 +2248,8 @@ CIFSSMBWrite2(const int xid, struct cifs_io_parms *io_parms,
2244 return rc; 2248 return rc;
2245} 2249}
2246 2250
2247int cifs_lockv(const int xid, struct cifs_tcon *tcon, const __u16 netfid, 2251int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
2248 const __u8 lock_type, const __u32 num_unlock, 2252 const __u16 netfid, const __u8 lock_type, const __u32 num_unlock,
2249 const __u32 num_lock, LOCKING_ANDX_RANGE *buf) 2253 const __u32 num_lock, LOCKING_ANDX_RANGE *buf)
2250{ 2254{
2251 int rc = 0; 2255 int rc = 0;
@@ -2286,7 +2290,7 @@ int cifs_lockv(const int xid, struct cifs_tcon *tcon, const __u16 netfid,
2286} 2290}
2287 2291
2288int 2292int
2289CIFSSMBLock(const int xid, struct cifs_tcon *tcon, 2293CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
2290 const __u16 smb_file_id, const __u32 netpid, const __u64 len, 2294 const __u16 smb_file_id, const __u32 netpid, const __u64 len,
2291 const __u64 offset, const __u32 numUnlock, 2295 const __u64 offset, const __u32 numUnlock,
2292 const __u32 numLock, const __u8 lockType, 2296 const __u32 numLock, const __u8 lockType,
@@ -2356,7 +2360,7 @@ CIFSSMBLock(const int xid, struct cifs_tcon *tcon,
2356} 2360}
2357 2361
2358int 2362int
2359CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon, 2363CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
2360 const __u16 smb_file_id, const __u32 netpid, 2364 const __u16 smb_file_id, const __u32 netpid,
2361 const loff_t start_offset, const __u64 len, 2365 const loff_t start_offset, const __u64 len,
2362 struct file_lock *pLockData, const __u16 lock_type, 2366 struct file_lock *pLockData, const __u16 lock_type,
@@ -2492,7 +2496,7 @@ plk_err_exit:
2492 2496
2493 2497
2494int 2498int
2495CIFSSMBClose(const int xid, struct cifs_tcon *tcon, int smb_file_id) 2499CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2496{ 2500{
2497 int rc = 0; 2501 int rc = 0;
2498 CLOSE_REQ *pSMB = NULL; 2502 CLOSE_REQ *pSMB = NULL;
@@ -2525,7 +2529,7 @@ CIFSSMBClose(const int xid, struct cifs_tcon *tcon, int smb_file_id)
2525} 2529}
2526 2530
2527int 2531int
2528CIFSSMBFlush(const int xid, struct cifs_tcon *tcon, int smb_file_id) 2532CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2529{ 2533{
2530 int rc = 0; 2534 int rc = 0;
2531 FLUSH_REQ *pSMB = NULL; 2535 FLUSH_REQ *pSMB = NULL;
@@ -2546,7 +2550,7 @@ CIFSSMBFlush(const int xid, struct cifs_tcon *tcon, int smb_file_id)
2546} 2550}
2547 2551
2548int 2552int
2549CIFSSMBRename(const int xid, struct cifs_tcon *tcon, 2553CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon,
2550 const char *fromName, const char *toName, 2554 const char *fromName, const char *toName,
2551 const struct nls_table *nls_codepage, int remap) 2555 const struct nls_table *nls_codepage, int remap)
2552{ 2556{
@@ -2613,7 +2617,7 @@ renameRetry:
2613 return rc; 2617 return rc;
2614} 2618}
2615 2619
2616int CIFSSMBRenameOpenFile(const int xid, struct cifs_tcon *pTcon, 2620int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *pTcon,
2617 int netfid, const char *target_name, 2621 int netfid, const char *target_name,
2618 const struct nls_table *nls_codepage, int remap) 2622 const struct nls_table *nls_codepage, int remap)
2619{ 2623{
@@ -2695,9 +2699,9 @@ int CIFSSMBRenameOpenFile(const int xid, struct cifs_tcon *pTcon,
2695} 2699}
2696 2700
2697int 2701int
2698CIFSSMBCopy(const int xid, struct cifs_tcon *tcon, const char *fromName, 2702CIFSSMBCopy(const unsigned int xid, struct cifs_tcon *tcon,
2699 const __u16 target_tid, const char *toName, const int flags, 2703 const char *fromName, const __u16 target_tid, const char *toName,
2700 const struct nls_table *nls_codepage, int remap) 2704 const int flags, const struct nls_table *nls_codepage, int remap)
2701{ 2705{
2702 int rc = 0; 2706 int rc = 0;
2703 COPY_REQ *pSMB = NULL; 2707 COPY_REQ *pSMB = NULL;
@@ -2763,7 +2767,7 @@ copyRetry:
2763} 2767}
2764 2768
2765int 2769int
2766CIFSUnixCreateSymLink(const int xid, struct cifs_tcon *tcon, 2770CIFSUnixCreateSymLink(const unsigned int xid, struct cifs_tcon *tcon,
2767 const char *fromName, const char *toName, 2771 const char *fromName, const char *toName,
2768 const struct nls_table *nls_codepage) 2772 const struct nls_table *nls_codepage)
2769{ 2773{
@@ -2852,7 +2856,7 @@ createSymLinkRetry:
2852} 2856}
2853 2857
2854int 2858int
2855CIFSUnixCreateHardLink(const int xid, struct cifs_tcon *tcon, 2859CIFSUnixCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
2856 const char *fromName, const char *toName, 2860 const char *fromName, const char *toName,
2857 const struct nls_table *nls_codepage, int remap) 2861 const struct nls_table *nls_codepage, int remap)
2858{ 2862{
@@ -2937,7 +2941,7 @@ createHardLinkRetry:
2937} 2941}
2938 2942
2939int 2943int
2940CIFSCreateHardLink(const int xid, struct cifs_tcon *tcon, 2944CIFSCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
2941 const char *fromName, const char *toName, 2945 const char *fromName, const char *toName,
2942 const struct nls_table *nls_codepage, int remap) 2946 const struct nls_table *nls_codepage, int remap)
2943{ 2947{
@@ -3009,7 +3013,7 @@ winCreateHardLinkRetry:
3009} 3013}
3010 3014
3011int 3015int
3012CIFSSMBUnixQuerySymLink(const int xid, struct cifs_tcon *tcon, 3016CIFSSMBUnixQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon,
3013 const unsigned char *searchName, char **symlinkinfo, 3017 const unsigned char *searchName, char **symlinkinfo,
3014 const struct nls_table *nls_codepage) 3018 const struct nls_table *nls_codepage)
3015{ 3019{
@@ -3114,7 +3118,7 @@ querySymLinkRetry:
3114 * it is not compiled in by default until callers fixed up and more tested. 3118 * it is not compiled in by default until callers fixed up and more tested.
3115 */ 3119 */
3116int 3120int
3117CIFSSMBQueryReparseLinkInfo(const int xid, struct cifs_tcon *tcon, 3121CIFSSMBQueryReparseLinkInfo(const unsigned int xid, struct cifs_tcon *tcon,
3118 const unsigned char *searchName, 3122 const unsigned char *searchName,
3119 char *symlinkinfo, const int buflen, __u16 fid, 3123 char *symlinkinfo, const int buflen, __u16 fid,
3120 const struct nls_table *nls_codepage) 3124 const struct nls_table *nls_codepage)
@@ -3351,7 +3355,7 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL,
3351} 3355}
3352 3356
3353int 3357int
3354CIFSSMBGetPosixACL(const int xid, struct cifs_tcon *tcon, 3358CIFSSMBGetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
3355 const unsigned char *searchName, 3359 const unsigned char *searchName,
3356 char *acl_inf, const int buflen, const int acl_type, 3360 char *acl_inf, const int buflen, const int acl_type,
3357 const struct nls_table *nls_codepage, int remap) 3361 const struct nls_table *nls_codepage, int remap)
@@ -3440,7 +3444,7 @@ queryAclRetry:
3440} 3444}
3441 3445
3442int 3446int
3443CIFSSMBSetPosixACL(const int xid, struct cifs_tcon *tcon, 3447CIFSSMBSetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
3444 const unsigned char *fileName, 3448 const unsigned char *fileName,
3445 const char *local_acl, const int buflen, 3449 const char *local_acl, const int buflen,
3446 const int acl_type, 3450 const int acl_type,
@@ -3520,7 +3524,7 @@ setACLerrorExit:
3520 3524
3521/* BB fix tabs in this function FIXME BB */ 3525/* BB fix tabs in this function FIXME BB */
3522int 3526int
3523CIFSGetExtAttr(const int xid, struct cifs_tcon *tcon, 3527CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
3524 const int netfid, __u64 *pExtAttrBits, __u64 *pMask) 3528 const int netfid, __u64 *pExtAttrBits, __u64 *pMask)
3525{ 3529{
3526 int rc = 0; 3530 int rc = 0;
@@ -3695,7 +3699,7 @@ validate_ntransact(char *buf, char **ppparm, char **ppdata,
3695 3699
3696/* Get Security Descriptor (by handle) from remote server for a file or dir */ 3700/* Get Security Descriptor (by handle) from remote server for a file or dir */
3697int 3701int
3698CIFSSMBGetCIFSACL(const int xid, struct cifs_tcon *tcon, __u16 fid, 3702CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3699 struct cifs_ntsd **acl_inf, __u32 *pbuflen) 3703 struct cifs_ntsd **acl_inf, __u32 *pbuflen)
3700{ 3704{
3701 int rc = 0; 3705 int rc = 0;
@@ -3787,7 +3791,7 @@ qsec_out:
3787} 3791}
3788 3792
3789int 3793int
3790CIFSSMBSetCIFSACL(const int xid, struct cifs_tcon *tcon, __u16 fid, 3794CIFSSMBSetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3791 struct cifs_ntsd *pntsd, __u32 acllen, int aclflag) 3795 struct cifs_ntsd *pntsd, __u32 acllen, int aclflag)
3792{ 3796{
3793 __u16 byte_count, param_count, data_count, param_offset, data_offset; 3797 __u16 byte_count, param_count, data_count, param_offset, data_offset;
@@ -3851,7 +3855,7 @@ setCifsAclRetry:
3851 3855
3852/* Legacy Query Path Information call for lookup to old servers such 3856/* Legacy Query Path Information call for lookup to old servers such
3853 as Win9x/WinME */ 3857 as Win9x/WinME */
3854int SMBQueryInformation(const int xid, struct cifs_tcon *tcon, 3858int SMBQueryInformation(const unsigned int xid, struct cifs_tcon *tcon,
3855 const unsigned char *searchName, 3859 const unsigned char *searchName,
3856 FILE_ALL_INFO *pFinfo, 3860 FILE_ALL_INFO *pFinfo,
3857 const struct nls_table *nls_codepage, int remap) 3861 const struct nls_table *nls_codepage, int remap)
@@ -3920,7 +3924,7 @@ QInfRetry:
3920} 3924}
3921 3925
3922int 3926int
3923CIFSSMBQFileInfo(const int xid, struct cifs_tcon *tcon, 3927CIFSSMBQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
3924 u16 netfid, FILE_ALL_INFO *pFindData) 3928 u16 netfid, FILE_ALL_INFO *pFindData)
3925{ 3929{
3926 struct smb_t2_qfi_req *pSMB = NULL; 3930 struct smb_t2_qfi_req *pSMB = NULL;
@@ -3987,7 +3991,7 @@ QFileInfoRetry:
3987} 3991}
3988 3992
3989int 3993int
3990CIFSSMBQPathInfo(const int xid, struct cifs_tcon *tcon, 3994CIFSSMBQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
3991 const unsigned char *searchName, 3995 const unsigned char *searchName,
3992 FILE_ALL_INFO *pFindData, 3996 FILE_ALL_INFO *pFindData,
3993 int legacy /* old style infolevel */, 3997 int legacy /* old style infolevel */,
@@ -4088,7 +4092,7 @@ QPathInfoRetry:
4088} 4092}
4089 4093
4090int 4094int
4091CIFSSMBUnixQFileInfo(const int xid, struct cifs_tcon *tcon, 4095CIFSSMBUnixQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
4092 u16 netfid, FILE_UNIX_BASIC_INFO *pFindData) 4096 u16 netfid, FILE_UNIX_BASIC_INFO *pFindData)
4093{ 4097{
4094 struct smb_t2_qfi_req *pSMB = NULL; 4098 struct smb_t2_qfi_req *pSMB = NULL;
@@ -4157,7 +4161,7 @@ UnixQFileInfoRetry:
4157} 4161}
4158 4162
4159int 4163int
4160CIFSSMBUnixQPathInfo(const int xid, struct cifs_tcon *tcon, 4164CIFSSMBUnixQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
4161 const unsigned char *searchName, 4165 const unsigned char *searchName,
4162 FILE_UNIX_BASIC_INFO *pFindData, 4166 FILE_UNIX_BASIC_INFO *pFindData,
4163 const struct nls_table *nls_codepage, int remap) 4167 const struct nls_table *nls_codepage, int remap)
@@ -4243,7 +4247,7 @@ UnixQPathInfoRetry:
4243 4247
4244/* xid, tcon, searchName and codepage are input parms, rest are returned */ 4248/* xid, tcon, searchName and codepage are input parms, rest are returned */
4245int 4249int
4246CIFSFindFirst(const int xid, struct cifs_tcon *tcon, 4250CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon,
4247 const char *searchName, 4251 const char *searchName,
4248 const struct nls_table *nls_codepage, 4252 const struct nls_table *nls_codepage,
4249 __u16 *pnetfid, __u16 search_flags, 4253 __u16 *pnetfid, __u16 search_flags,
@@ -4388,8 +4392,9 @@ findFirstRetry:
4388 return rc; 4392 return rc;
4389} 4393}
4390 4394
4391int CIFSFindNext(const int xid, struct cifs_tcon *tcon, __u16 searchHandle, 4395int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
4392 __u16 search_flags, struct cifs_search_info *psrch_inf) 4396 __u16 searchHandle, __u16 search_flags,
4397 struct cifs_search_info *psrch_inf)
4393{ 4398{
4394 TRANSACTION2_FNEXT_REQ *pSMB = NULL; 4399 TRANSACTION2_FNEXT_REQ *pSMB = NULL;
4395 TRANSACTION2_FNEXT_RSP *pSMBr = NULL; 4400 TRANSACTION2_FNEXT_RSP *pSMBr = NULL;
@@ -4523,7 +4528,7 @@ FNext2_err_exit:
4523} 4528}
4524 4529
4525int 4530int
4526CIFSFindClose(const int xid, struct cifs_tcon *tcon, 4531CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
4527 const __u16 searchHandle) 4532 const __u16 searchHandle)
4528{ 4533{
4529 int rc = 0; 4534 int rc = 0;
@@ -4555,7 +4560,7 @@ CIFSFindClose(const int xid, struct cifs_tcon *tcon,
4555} 4560}
4556 4561
4557int 4562int
4558CIFSGetSrvInodeNumber(const int xid, struct cifs_tcon *tcon, 4563CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon,
4559 const unsigned char *searchName, 4564 const unsigned char *searchName,
4560 __u64 *inode_number, 4565 __u64 *inode_number,
4561 const struct nls_table *nls_codepage, int remap) 4566 const struct nls_table *nls_codepage, int remap)
@@ -4762,7 +4767,7 @@ parse_DFS_referrals_exit:
4762} 4767}
4763 4768
4764int 4769int
4765CIFSGetDFSRefer(const int xid, struct cifs_ses *ses, 4770CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
4766 const unsigned char *searchName, 4771 const unsigned char *searchName,
4767 struct dfs_info3_param **target_nodes, 4772 struct dfs_info3_param **target_nodes,
4768 unsigned int *num_of_nodes, 4773 unsigned int *num_of_nodes,
@@ -4877,7 +4882,8 @@ GetDFSRefExit:
4877 4882
4878/* Query File System Info such as free space to old servers such as Win 9x */ 4883/* Query File System Info such as free space to old servers such as Win 9x */
4879int 4884int
4880SMBOldQFSInfo(const int xid, struct cifs_tcon *tcon, struct kstatfs *FSData) 4885SMBOldQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
4886 struct kstatfs *FSData)
4881{ 4887{
4882/* level 0x01 SMB_QUERY_FILE_SYSTEM_INFO */ 4888/* level 0x01 SMB_QUERY_FILE_SYSTEM_INFO */
4883 TRANSACTION2_QFSI_REQ *pSMB = NULL; 4889 TRANSACTION2_QFSI_REQ *pSMB = NULL;
@@ -4956,7 +4962,8 @@ oldQFSInfoRetry:
4956} 4962}
4957 4963
4958int 4964int
4959CIFSSMBQFSInfo(const int xid, struct cifs_tcon *tcon, struct kstatfs *FSData) 4965CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
4966 struct kstatfs *FSData)
4960{ 4967{
4961/* level 0x103 SMB_QUERY_FILE_SYSTEM_INFO */ 4968/* level 0x103 SMB_QUERY_FILE_SYSTEM_INFO */
4962 TRANSACTION2_QFSI_REQ *pSMB = NULL; 4969 TRANSACTION2_QFSI_REQ *pSMB = NULL;
@@ -5035,7 +5042,7 @@ QFSInfoRetry:
5035} 5042}
5036 5043
5037int 5044int
5038CIFSSMBQFSAttributeInfo(const int xid, struct cifs_tcon *tcon) 5045CIFSSMBQFSAttributeInfo(const unsigned int xid, struct cifs_tcon *tcon)
5039{ 5046{
5040/* level 0x105 SMB_QUERY_FILE_SYSTEM_INFO */ 5047/* level 0x105 SMB_QUERY_FILE_SYSTEM_INFO */
5041 TRANSACTION2_QFSI_REQ *pSMB = NULL; 5048 TRANSACTION2_QFSI_REQ *pSMB = NULL;
@@ -5105,7 +5112,7 @@ QFSAttributeRetry:
5105} 5112}
5106 5113
5107int 5114int
5108CIFSSMBQFSDeviceInfo(const int xid, struct cifs_tcon *tcon) 5115CIFSSMBQFSDeviceInfo(const unsigned int xid, struct cifs_tcon *tcon)
5109{ 5116{
5110/* level 0x104 SMB_QUERY_FILE_SYSTEM_INFO */ 5117/* level 0x104 SMB_QUERY_FILE_SYSTEM_INFO */
5111 TRANSACTION2_QFSI_REQ *pSMB = NULL; 5118 TRANSACTION2_QFSI_REQ *pSMB = NULL;
@@ -5176,7 +5183,7 @@ QFSDeviceRetry:
5176} 5183}
5177 5184
5178int 5185int
5179CIFSSMBQFSUnixInfo(const int xid, struct cifs_tcon *tcon) 5186CIFSSMBQFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon)
5180{ 5187{
5181/* level 0x200 SMB_QUERY_CIFS_UNIX_INFO */ 5188/* level 0x200 SMB_QUERY_CIFS_UNIX_INFO */
5182 TRANSACTION2_QFSI_REQ *pSMB = NULL; 5189 TRANSACTION2_QFSI_REQ *pSMB = NULL;
@@ -5246,7 +5253,7 @@ QFSUnixRetry:
5246} 5253}
5247 5254
5248int 5255int
5249CIFSSMBSetFSUnixInfo(const int xid, struct cifs_tcon *tcon, __u64 cap) 5256CIFSSMBSetFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon, __u64 cap)
5250{ 5257{
5251/* level 0x200 SMB_SET_CIFS_UNIX_INFO */ 5258/* level 0x200 SMB_SET_CIFS_UNIX_INFO */
5252 TRANSACTION2_SETFSI_REQ *pSMB = NULL; 5259 TRANSACTION2_SETFSI_REQ *pSMB = NULL;
@@ -5320,7 +5327,7 @@ SETFSUnixRetry:
5320 5327
5321 5328
5322int 5329int
5323CIFSSMBQFSPosixInfo(const int xid, struct cifs_tcon *tcon, 5330CIFSSMBQFSPosixInfo(const unsigned int xid, struct cifs_tcon *tcon,
5324 struct kstatfs *FSData) 5331 struct kstatfs *FSData)
5325{ 5332{
5326/* level 0x201 SMB_QUERY_CIFS_POSIX_INFO */ 5333/* level 0x201 SMB_QUERY_CIFS_POSIX_INFO */
@@ -5413,8 +5420,8 @@ QFSPosixRetry:
5413 in Samba which this routine can run into */ 5420 in Samba which this routine can run into */
5414 5421
5415int 5422int
5416CIFSSMBSetEOF(const int xid, struct cifs_tcon *tcon, const char *fileName, 5423CIFSSMBSetEOF(const unsigned int xid, struct cifs_tcon *tcon,
5417 __u64 size, bool SetAllocation, 5424 const char *fileName, __u64 size, bool SetAllocation,
5418 const struct nls_table *nls_codepage, int remap) 5425 const struct nls_table *nls_codepage, int remap)
5419{ 5426{
5420 struct smb_com_transaction2_spi_req *pSMB = NULL; 5427 struct smb_com_transaction2_spi_req *pSMB = NULL;
@@ -5502,7 +5509,7 @@ SetEOFRetry:
5502} 5509}
5503 5510
5504int 5511int
5505CIFSSMBSetFileSize(const int xid, struct cifs_tcon *tcon, __u64 size, 5512CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon, __u64 size,
5506 __u16 fid, __u32 pid_of_opener, bool SetAllocation) 5513 __u16 fid, __u32 pid_of_opener, bool SetAllocation)
5507{ 5514{
5508 struct smb_com_transaction2_sfi_req *pSMB = NULL; 5515 struct smb_com_transaction2_sfi_req *pSMB = NULL;
@@ -5584,7 +5591,7 @@ CIFSSMBSetFileSize(const int xid, struct cifs_tcon *tcon, __u64 size,
5584 time and resort to the original setpathinfo level which takes the ancient 5591 time and resort to the original setpathinfo level which takes the ancient
5585 DOS time format with 2 second granularity */ 5592 DOS time format with 2 second granularity */
5586int 5593int
5587CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon, 5594CIFSSMBSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
5588 const FILE_BASIC_INFO *data, __u16 fid, __u32 pid_of_opener) 5595 const FILE_BASIC_INFO *data, __u16 fid, __u32 pid_of_opener)
5589{ 5596{
5590 struct smb_com_transaction2_sfi_req *pSMB = NULL; 5597 struct smb_com_transaction2_sfi_req *pSMB = NULL;
@@ -5647,7 +5654,7 @@ CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon,
5647} 5654}
5648 5655
5649int 5656int
5650CIFSSMBSetFileDisposition(const int xid, struct cifs_tcon *tcon, 5657CIFSSMBSetFileDisposition(const unsigned int xid, struct cifs_tcon *tcon,
5651 bool delete_file, __u16 fid, __u32 pid_of_opener) 5658 bool delete_file, __u16 fid, __u32 pid_of_opener)
5652{ 5659{
5653 struct smb_com_transaction2_sfi_req *pSMB = NULL; 5660 struct smb_com_transaction2_sfi_req *pSMB = NULL;
@@ -5703,7 +5710,7 @@ CIFSSMBSetFileDisposition(const int xid, struct cifs_tcon *tcon,
5703} 5710}
5704 5711
5705int 5712int
5706CIFSSMBSetPathInfo(const int xid, struct cifs_tcon *tcon, 5713CIFSSMBSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
5707 const char *fileName, const FILE_BASIC_INFO *data, 5714 const char *fileName, const FILE_BASIC_INFO *data,
5708 const struct nls_table *nls_codepage, int remap) 5715 const struct nls_table *nls_codepage, int remap)
5709{ 5716{
@@ -5787,7 +5794,7 @@ SetTimesRetry:
5787 handling it anyway and NT4 was what we thought it would be needed for 5794 handling it anyway and NT4 was what we thought it would be needed for
5788 Do not delete it until we prove whether needed for Win9x though */ 5795 Do not delete it until we prove whether needed for Win9x though */
5789int 5796int
5790CIFSSMBSetAttrLegacy(int xid, struct cifs_tcon *tcon, char *fileName, 5797CIFSSMBSetAttrLegacy(unsigned int xid, struct cifs_tcon *tcon, char *fileName,
5791 __u16 dos_attrs, const struct nls_table *nls_codepage) 5798 __u16 dos_attrs, const struct nls_table *nls_codepage)
5792{ 5799{
5793 SETATTR_REQ *pSMB = NULL; 5800 SETATTR_REQ *pSMB = NULL;
@@ -5875,7 +5882,7 @@ cifs_fill_unix_set_info(FILE_UNIX_BASIC_INFO *data_offset,
5875} 5882}
5876 5883
5877int 5884int
5878CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon, 5885CIFSSMBUnixSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
5879 const struct cifs_unix_set_info_args *args, 5886 const struct cifs_unix_set_info_args *args,
5880 u16 fid, u32 pid_of_opener) 5887 u16 fid, u32 pid_of_opener)
5881{ 5888{
@@ -5939,7 +5946,8 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon,
5939} 5946}
5940 5947
5941int 5948int
5942CIFSSMBUnixSetPathInfo(const int xid, struct cifs_tcon *tcon, char *fileName, 5949CIFSSMBUnixSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
5950 char *fileName,
5943 const struct cifs_unix_set_info_args *args, 5951 const struct cifs_unix_set_info_args *args,
5944 const struct nls_table *nls_codepage, int remap) 5952 const struct nls_table *nls_codepage, int remap)
5945{ 5953{
@@ -6026,7 +6034,7 @@ setPermsRetry:
6026 * the data isn't copied to it, but the length is returned. 6034 * the data isn't copied to it, but the length is returned.
6027 */ 6035 */
6028ssize_t 6036ssize_t
6029CIFSSMBQAllEAs(const int xid, struct cifs_tcon *tcon, 6037CIFSSMBQAllEAs(const unsigned int xid, struct cifs_tcon *tcon,
6030 const unsigned char *searchName, const unsigned char *ea_name, 6038 const unsigned char *searchName, const unsigned char *ea_name,
6031 char *EAData, size_t buf_size, 6039 char *EAData, size_t buf_size,
6032 const struct nls_table *nls_codepage, int remap) 6040 const struct nls_table *nls_codepage, int remap)
@@ -6209,8 +6217,8 @@ QAllEAsOut:
6209} 6217}
6210 6218
6211int 6219int
6212CIFSSMBSetEA(const int xid, struct cifs_tcon *tcon, const char *fileName, 6220CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
6213 const char *ea_name, const void *ea_value, 6221 const char *fileName, const char *ea_name, const void *ea_value,
6214 const __u16 ea_value_len, const struct nls_table *nls_codepage, 6222 const __u16 ea_value_len, const struct nls_table *nls_codepage,
6215 int remap) 6223 int remap)
6216{ 6224{
@@ -6336,7 +6344,7 @@ SetEARetry:
6336 * incompatible for network fs clients, we could instead simply 6344 * incompatible for network fs clients, we could instead simply
6337 * expose this config flag by adding a future cifs (and smb2) notify ioctl. 6345 * expose this config flag by adding a future cifs (and smb2) notify ioctl.
6338 */ 6346 */
6339int CIFSSMBNotify(const int xid, struct cifs_tcon *tcon, 6347int CIFSSMBNotify(const unsigned int xid, struct cifs_tcon *tcon,
6340 const int notify_subdirs, const __u16 netfid, 6348 const int notify_subdirs, const __u16 netfid,
6341 __u32 filter, struct file *pfile, int multishot, 6349 __u32 filter, struct file *pfile, int multishot,
6342 const struct nls_table *nls_codepage) 6350 const struct nls_table *nls_codepage)
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index fcf20d1b58b9..cfb7e7797642 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2267,9 +2267,9 @@ cifs_put_smb_ses(struct cifs_ses *ses)
2267 spin_unlock(&cifs_tcp_ses_lock); 2267 spin_unlock(&cifs_tcp_ses_lock);
2268 2268
2269 if (ses->status == CifsGood && server->ops->logoff) { 2269 if (ses->status == CifsGood && server->ops->logoff) {
2270 xid = GetXid(); 2270 xid = get_xid();
2271 server->ops->logoff(xid, ses); 2271 server->ops->logoff(xid, ses);
2272 _FreeXid(xid); 2272 _free_xid(xid);
2273 } 2273 }
2274 sesInfoFree(ses); 2274 sesInfoFree(ses);
2275 cifs_put_tcp_session(server); 2275 cifs_put_tcp_session(server);
@@ -2412,7 +2412,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
2412 struct sockaddr_in *addr = (struct sockaddr_in *)&server->dstaddr; 2412 struct sockaddr_in *addr = (struct sockaddr_in *)&server->dstaddr;
2413 struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&server->dstaddr; 2413 struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&server->dstaddr;
2414 2414
2415 xid = GetXid(); 2415 xid = get_xid();
2416 2416
2417 ses = cifs_find_smb_ses(server, volume_info); 2417 ses = cifs_find_smb_ses(server, volume_info);
2418 if (ses) { 2418 if (ses) {
@@ -2424,7 +2424,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
2424 mutex_unlock(&ses->session_mutex); 2424 mutex_unlock(&ses->session_mutex);
2425 /* problem -- put our ses reference */ 2425 /* problem -- put our ses reference */
2426 cifs_put_smb_ses(ses); 2426 cifs_put_smb_ses(ses);
2427 FreeXid(xid); 2427 free_xid(xid);
2428 return ERR_PTR(rc); 2428 return ERR_PTR(rc);
2429 } 2429 }
2430 if (ses->need_reconnect) { 2430 if (ses->need_reconnect) {
@@ -2435,7 +2435,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
2435 mutex_unlock(&ses->session_mutex); 2435 mutex_unlock(&ses->session_mutex);
2436 /* problem -- put our reference */ 2436 /* problem -- put our reference */
2437 cifs_put_smb_ses(ses); 2437 cifs_put_smb_ses(ses);
2438 FreeXid(xid); 2438 free_xid(xid);
2439 return ERR_PTR(rc); 2439 return ERR_PTR(rc);
2440 } 2440 }
2441 } 2441 }
@@ -2443,7 +2443,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
2443 2443
2444 /* existing SMB ses has a server reference already */ 2444 /* existing SMB ses has a server reference already */
2445 cifs_put_tcp_session(server); 2445 cifs_put_tcp_session(server);
2446 FreeXid(xid); 2446 free_xid(xid);
2447 return ses; 2447 return ses;
2448 } 2448 }
2449 2449
@@ -2502,12 +2502,12 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
2502 list_add(&ses->smb_ses_list, &server->smb_ses_list); 2502 list_add(&ses->smb_ses_list, &server->smb_ses_list);
2503 spin_unlock(&cifs_tcp_ses_lock); 2503 spin_unlock(&cifs_tcp_ses_lock);
2504 2504
2505 FreeXid(xid); 2505 free_xid(xid);
2506 return ses; 2506 return ses;
2507 2507
2508get_ses_fail: 2508get_ses_fail:
2509 sesInfoFree(ses); 2509 sesInfoFree(ses);
2510 FreeXid(xid); 2510 free_xid(xid);
2511 return ERR_PTR(rc); 2511 return ERR_PTR(rc);
2512} 2512}
2513 2513
@@ -2555,10 +2555,10 @@ cifs_put_tcon(struct cifs_tcon *tcon)
2555 list_del_init(&tcon->tcon_list); 2555 list_del_init(&tcon->tcon_list);
2556 spin_unlock(&cifs_tcp_ses_lock); 2556 spin_unlock(&cifs_tcp_ses_lock);
2557 2557
2558 xid = GetXid(); 2558 xid = get_xid();
2559 if (ses->server->ops->tree_disconnect) 2559 if (ses->server->ops->tree_disconnect)
2560 ses->server->ops->tree_disconnect(xid, tcon); 2560 ses->server->ops->tree_disconnect(xid, tcon);
2561 _FreeXid(xid); 2561 _free_xid(xid);
2562 2562
2563 cifs_fscache_release_super_cookie(tcon); 2563 cifs_fscache_release_super_cookie(tcon);
2564 tconInfoFree(tcon); 2564 tconInfoFree(tcon);
@@ -2613,10 +2613,10 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
2613 * BB Do we need to wrap session_mutex around this TCon call and Unix 2613 * BB Do we need to wrap session_mutex around this TCon call and Unix
2614 * SetFS as we do on SessSetup and reconnect? 2614 * SetFS as we do on SessSetup and reconnect?
2615 */ 2615 */
2616 xid = GetXid(); 2616 xid = get_xid();
2617 rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon, 2617 rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon,
2618 volume_info->local_nls); 2618 volume_info->local_nls);
2619 FreeXid(xid); 2619 free_xid(xid);
2620 cFYI(1, "Tcon rc = %d", rc); 2620 cFYI(1, "Tcon rc = %d", rc);
2621 if (rc) 2621 if (rc)
2622 goto out_fail; 2622 goto out_fail;
@@ -2764,7 +2764,7 @@ out:
2764} 2764}
2765 2765
2766int 2766int
2767get_dfs_path(int xid, struct cifs_ses *ses, const char *old_path, 2767get_dfs_path(unsigned int xid, struct cifs_ses *ses, const char *old_path,
2768 const struct nls_table *nls_codepage, unsigned int *num_referrals, 2768 const struct nls_table *nls_codepage, unsigned int *num_referrals,
2769 struct dfs_info3_param **referrals, int remap) 2769 struct dfs_info3_param **referrals, int remap)
2770{ 2770{
@@ -3067,7 +3067,7 @@ ip_connect(struct TCP_Server_Info *server)
3067 return generic_ip_connect(server); 3067 return generic_ip_connect(server);
3068} 3068}
3069 3069
3070void reset_cifs_unix_caps(int xid, struct cifs_tcon *tcon, 3070void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
3071 struct cifs_sb_info *cifs_sb, struct smb_vol *vol_info) 3071 struct cifs_sb_info *cifs_sb, struct smb_vol *vol_info)
3072{ 3072{
3073 /* if we are reconnecting then should we check to see if 3073 /* if we are reconnecting then should we check to see if
@@ -3399,7 +3399,7 @@ cifs_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info)
3399} 3399}
3400 3400
3401static int 3401static int
3402is_path_accessible(int xid, struct cifs_tcon *tcon, 3402is_path_accessible(unsigned int xid, struct cifs_tcon *tcon,
3403 struct cifs_sb_info *cifs_sb, const char *full_path) 3403 struct cifs_sb_info *cifs_sb, const char *full_path)
3404{ 3404{
3405 int rc; 3405 int rc;
@@ -3485,7 +3485,7 @@ build_unc_path_to_root(const struct smb_vol *vol,
3485 * determine whether there were referrals. 3485 * determine whether there were referrals.
3486 */ 3486 */
3487static int 3487static int
3488expand_dfs_referral(int xid, struct cifs_ses *pSesInfo, 3488expand_dfs_referral(unsigned int xid, struct cifs_ses *pSesInfo,
3489 struct smb_vol *volume_info, struct cifs_sb_info *cifs_sb, 3489 struct smb_vol *volume_info, struct cifs_sb_info *cifs_sb,
3490 int check_prefix) 3490 int check_prefix)
3491{ 3491{
@@ -3595,7 +3595,7 @@ int
3595cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info) 3595cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
3596{ 3596{
3597 int rc; 3597 int rc;
3598 int xid; 3598 unsigned int xid;
3599 struct cifs_ses *pSesInfo; 3599 struct cifs_ses *pSesInfo;
3600 struct cifs_tcon *tcon; 3600 struct cifs_tcon *tcon;
3601 struct TCP_Server_Info *srvTcp; 3601 struct TCP_Server_Info *srvTcp;
@@ -3618,7 +3618,7 @@ try_mount_again:
3618 else if (pSesInfo) 3618 else if (pSesInfo)
3619 cifs_put_smb_ses(pSesInfo); 3619 cifs_put_smb_ses(pSesInfo);
3620 3620
3621 FreeXid(xid); 3621 free_xid(xid);
3622 } 3622 }
3623#endif 3623#endif
3624 rc = 0; 3624 rc = 0;
@@ -3628,7 +3628,7 @@ try_mount_again:
3628 full_path = NULL; 3628 full_path = NULL;
3629 tlink = NULL; 3629 tlink = NULL;
3630 3630
3631 xid = GetXid(); 3631 xid = get_xid();
3632 3632
3633 /* get a reference to a tcp session */ 3633 /* get a reference to a tcp session */
3634 srvTcp = cifs_get_tcp_session(volume_info); 3634 srvTcp = cifs_get_tcp_session(volume_info);
@@ -3781,7 +3781,7 @@ mount_fail_check:
3781 } 3781 }
3782 3782
3783out: 3783out:
3784 FreeXid(xid); 3784 free_xid(xid);
3785 return rc; 3785 return rc;
3786} 3786}
3787 3787
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index a180265a10b5..d364654491e3 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -157,10 +157,10 @@ check_name(struct dentry *direntry)
157 157
158/* Inode operations in similar order to how they appear in Linux file fs.h */ 158/* Inode operations in similar order to how they appear in Linux file fs.h */
159 159
160static int cifs_do_create(struct inode *inode, struct dentry *direntry, 160static int
161 int xid, struct tcon_link *tlink, unsigned oflags, 161cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
162 umode_t mode, __u32 *oplock, __u16 *fileHandle, 162 struct tcon_link *tlink, unsigned oflags, umode_t mode,
163 int *created) 163 __u32 *oplock, __u16 *fileHandle, int *created)
164{ 164{
165 int rc = -ENOENT; 165 int rc = -ENOENT;
166 int create_options = CREATE_NOT_DIR; 166 int create_options = CREATE_NOT_DIR;
@@ -382,7 +382,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
382 int *opened) 382 int *opened)
383{ 383{
384 int rc; 384 int rc;
385 int xid; 385 unsigned int xid;
386 struct tcon_link *tlink; 386 struct tcon_link *tlink;
387 struct cifs_tcon *tcon; 387 struct cifs_tcon *tcon;
388 __u16 fileHandle; 388 __u16 fileHandle;
@@ -412,7 +412,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
412 if (rc) 412 if (rc)
413 return rc; 413 return rc;
414 414
415 xid = GetXid(); 415 xid = get_xid();
416 416
417 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", 417 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p",
418 inode, direntry->d_name.name, direntry); 418 inode, direntry->d_name.name, direntry);
@@ -420,7 +420,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
420 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); 420 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
421 filp = ERR_CAST(tlink); 421 filp = ERR_CAST(tlink);
422 if (IS_ERR(tlink)) 422 if (IS_ERR(tlink))
423 goto free_xid; 423 goto out_free_xid;
424 424
425 tcon = tlink_tcon(tlink); 425 tcon = tlink_tcon(tlink);
426 426
@@ -445,8 +445,8 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
445 445
446out: 446out:
447 cifs_put_tlink(tlink); 447 cifs_put_tlink(tlink);
448free_xid: 448out_free_xid:
449 FreeXid(xid); 449 free_xid(xid);
450 return rc; 450 return rc;
451} 451}
452 452
@@ -454,7 +454,7 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
454 bool excl) 454 bool excl)
455{ 455{
456 int rc; 456 int rc;
457 int xid = GetXid(); 457 unsigned int xid = get_xid();
458 /* 458 /*
459 * BB below access is probably too much for mknod to request 459 * BB below access is probably too much for mknod to request
460 * but we have to do query and setpathinfo so requesting 460 * but we have to do query and setpathinfo so requesting
@@ -474,7 +474,7 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
474 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); 474 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
475 rc = PTR_ERR(tlink); 475 rc = PTR_ERR(tlink);
476 if (IS_ERR(tlink)) 476 if (IS_ERR(tlink))
477 goto free_xid; 477 goto out_free_xid;
478 478
479 rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, 479 rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode,
480 &oplock, &fileHandle, &created); 480 &oplock, &fileHandle, &created);
@@ -482,9 +482,8 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
482 CIFSSMBClose(xid, tlink_tcon(tlink), fileHandle); 482 CIFSSMBClose(xid, tlink_tcon(tlink), fileHandle);
483 483
484 cifs_put_tlink(tlink); 484 cifs_put_tlink(tlink);
485free_xid: 485out_free_xid:
486 FreeXid(xid); 486 free_xid(xid);
487
488 return rc; 487 return rc;
489} 488}
490 489
@@ -492,7 +491,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
492 dev_t device_number) 491 dev_t device_number)
493{ 492{
494 int rc = -EPERM; 493 int rc = -EPERM;
495 int xid; 494 unsigned int xid;
496 int create_options = CREATE_NOT_DIR | CREATE_OPTION_SPECIAL; 495 int create_options = CREATE_NOT_DIR | CREATE_OPTION_SPECIAL;
497 struct cifs_sb_info *cifs_sb; 496 struct cifs_sb_info *cifs_sb;
498 struct tcon_link *tlink; 497 struct tcon_link *tlink;
@@ -516,7 +515,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
516 515
517 pTcon = tlink_tcon(tlink); 516 pTcon = tlink_tcon(tlink);
518 517
519 xid = GetXid(); 518 xid = get_xid();
520 519
521 full_path = build_path_from_dentry(direntry); 520 full_path = build_path_from_dentry(direntry);
522 if (full_path == NULL) { 521 if (full_path == NULL) {
@@ -564,7 +563,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
564 if (buf == NULL) { 563 if (buf == NULL) {
565 kfree(full_path); 564 kfree(full_path);
566 rc = -ENOMEM; 565 rc = -ENOMEM;
567 FreeXid(xid); 566 free_xid(xid);
568 return rc; 567 return rc;
569 } 568 }
570 569
@@ -614,7 +613,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
614mknod_out: 613mknod_out:
615 kfree(full_path); 614 kfree(full_path);
616 kfree(buf); 615 kfree(buf);
617 FreeXid(xid); 616 free_xid(xid);
618 cifs_put_tlink(tlink); 617 cifs_put_tlink(tlink);
619 return rc; 618 return rc;
620} 619}
@@ -623,7 +622,7 @@ struct dentry *
623cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, 622cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
624 unsigned int flags) 623 unsigned int flags)
625{ 624{
626 int xid; 625 unsigned int xid;
627 int rc = 0; /* to get around spurious gcc warning, set to zero here */ 626 int rc = 0; /* to get around spurious gcc warning, set to zero here */
628 struct cifs_sb_info *cifs_sb; 627 struct cifs_sb_info *cifs_sb;
629 struct tcon_link *tlink; 628 struct tcon_link *tlink;
@@ -631,7 +630,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
631 struct inode *newInode = NULL; 630 struct inode *newInode = NULL;
632 char *full_path = NULL; 631 char *full_path = NULL;
633 632
634 xid = GetXid(); 633 xid = get_xid();
635 634
636 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", 635 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p",
637 parent_dir_inode, direntry->d_name.name, direntry); 636 parent_dir_inode, direntry->d_name.name, direntry);
@@ -641,7 +640,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
641 cifs_sb = CIFS_SB(parent_dir_inode->i_sb); 640 cifs_sb = CIFS_SB(parent_dir_inode->i_sb);
642 tlink = cifs_sb_tlink(cifs_sb); 641 tlink = cifs_sb_tlink(cifs_sb);
643 if (IS_ERR(tlink)) { 642 if (IS_ERR(tlink)) {
644 FreeXid(xid); 643 free_xid(xid);
645 return (struct dentry *)tlink; 644 return (struct dentry *)tlink;
646 } 645 }
647 pTcon = tlink_tcon(tlink); 646 pTcon = tlink_tcon(tlink);
@@ -695,7 +694,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
695lookup_out: 694lookup_out:
696 kfree(full_path); 695 kfree(full_path);
697 cifs_put_tlink(tlink); 696 cifs_put_tlink(tlink);
698 FreeXid(xid); 697 free_xid(xid);
699 return ERR_PTR(rc); 698 return ERR_PTR(rc);
700} 699}
701 700
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index e9a8ac0047c7..93b3b1358409 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -107,7 +107,7 @@ static inline int cifs_get_disposition(unsigned int flags)
107 107
108int cifs_posix_open(char *full_path, struct inode **pinode, 108int cifs_posix_open(char *full_path, struct inode **pinode,
109 struct super_block *sb, int mode, unsigned int f_flags, 109 struct super_block *sb, int mode, unsigned int f_flags,
110 __u32 *poplock, __u16 *pnetfid, int xid) 110 __u32 *poplock, __u16 *pnetfid, unsigned int xid)
111{ 111{
112 int rc; 112 int rc;
113 FILE_UNIX_BASIC_INFO *presp_data; 113 FILE_UNIX_BASIC_INFO *presp_data;
@@ -170,7 +170,7 @@ posix_open_ret:
170static int 170static int
171cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb, 171cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb,
172 struct cifs_tcon *tcon, unsigned int f_flags, __u32 *poplock, 172 struct cifs_tcon *tcon, unsigned int f_flags, __u32 *poplock,
173 __u16 *pnetfid, int xid) 173 __u16 *pnetfid, unsigned int xid)
174{ 174{
175 int rc; 175 int rc;
176 int desiredAccess; 176 int desiredAccess;
@@ -324,11 +324,11 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
324 cancel_work_sync(&cifs_file->oplock_break); 324 cancel_work_sync(&cifs_file->oplock_break);
325 325
326 if (!tcon->need_reconnect && !cifs_file->invalidHandle) { 326 if (!tcon->need_reconnect && !cifs_file->invalidHandle) {
327 int xid, rc; 327 unsigned int xid;
328 328 int rc;
329 xid = GetXid(); 329 xid = get_xid();
330 rc = CIFSSMBClose(xid, tcon, cifs_file->netfid); 330 rc = CIFSSMBClose(xid, tcon, cifs_file->netfid);
331 FreeXid(xid); 331 free_xid(xid);
332 } 332 }
333 333
334 /* Delete any outstanding lock records. We'll lose them when the file 334 /* Delete any outstanding lock records. We'll lose them when the file
@@ -350,7 +350,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
350int cifs_open(struct inode *inode, struct file *file) 350int cifs_open(struct inode *inode, struct file *file)
351{ 351{
352 int rc = -EACCES; 352 int rc = -EACCES;
353 int xid; 353 unsigned int xid;
354 __u32 oplock; 354 __u32 oplock;
355 struct cifs_sb_info *cifs_sb; 355 struct cifs_sb_info *cifs_sb;
356 struct cifs_tcon *tcon; 356 struct cifs_tcon *tcon;
@@ -360,12 +360,12 @@ int cifs_open(struct inode *inode, struct file *file)
360 bool posix_open_ok = false; 360 bool posix_open_ok = false;
361 __u16 netfid; 361 __u16 netfid;
362 362
363 xid = GetXid(); 363 xid = get_xid();
364 364
365 cifs_sb = CIFS_SB(inode->i_sb); 365 cifs_sb = CIFS_SB(inode->i_sb);
366 tlink = cifs_sb_tlink(cifs_sb); 366 tlink = cifs_sb_tlink(cifs_sb);
367 if (IS_ERR(tlink)) { 367 if (IS_ERR(tlink)) {
368 FreeXid(xid); 368 free_xid(xid);
369 return PTR_ERR(tlink); 369 return PTR_ERR(tlink);
370 } 370 }
371 tcon = tlink_tcon(tlink); 371 tcon = tlink_tcon(tlink);
@@ -445,7 +445,7 @@ int cifs_open(struct inode *inode, struct file *file)
445 445
446out: 446out:
447 kfree(full_path); 447 kfree(full_path);
448 FreeXid(xid); 448 free_xid(xid);
449 cifs_put_tlink(tlink); 449 cifs_put_tlink(tlink);
450 return rc; 450 return rc;
451} 451}
@@ -464,7 +464,7 @@ static int cifs_relock_file(struct cifsFileInfo *cifsFile)
464static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush) 464static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush)
465{ 465{
466 int rc = -EACCES; 466 int rc = -EACCES;
467 int xid; 467 unsigned int xid;
468 __u32 oplock; 468 __u32 oplock;
469 struct cifs_sb_info *cifs_sb; 469 struct cifs_sb_info *cifs_sb;
470 struct cifs_tcon *tcon; 470 struct cifs_tcon *tcon;
@@ -476,12 +476,12 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush)
476 int create_options = CREATE_NOT_DIR; 476 int create_options = CREATE_NOT_DIR;
477 __u16 netfid; 477 __u16 netfid;
478 478
479 xid = GetXid(); 479 xid = get_xid();
480 mutex_lock(&pCifsFile->fh_mutex); 480 mutex_lock(&pCifsFile->fh_mutex);
481 if (!pCifsFile->invalidHandle) { 481 if (!pCifsFile->invalidHandle) {
482 mutex_unlock(&pCifsFile->fh_mutex); 482 mutex_unlock(&pCifsFile->fh_mutex);
483 rc = 0; 483 rc = 0;
484 FreeXid(xid); 484 free_xid(xid);
485 return rc; 485 return rc;
486 } 486 }
487 487
@@ -497,7 +497,7 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush)
497 if (full_path == NULL) { 497 if (full_path == NULL) {
498 rc = -ENOMEM; 498 rc = -ENOMEM;
499 mutex_unlock(&pCifsFile->fh_mutex); 499 mutex_unlock(&pCifsFile->fh_mutex);
500 FreeXid(xid); 500 free_xid(xid);
501 return rc; 501 return rc;
502 } 502 }
503 503
@@ -583,7 +583,7 @@ reopen_success:
583 583
584reopen_error_exit: 584reopen_error_exit:
585 kfree(full_path); 585 kfree(full_path);
586 FreeXid(xid); 586 free_xid(xid);
587 return rc; 587 return rc;
588} 588}
589 589
@@ -601,13 +601,13 @@ int cifs_close(struct inode *inode, struct file *file)
601int cifs_closedir(struct inode *inode, struct file *file) 601int cifs_closedir(struct inode *inode, struct file *file)
602{ 602{
603 int rc = 0; 603 int rc = 0;
604 int xid; 604 unsigned int xid;
605 struct cifsFileInfo *pCFileStruct = file->private_data; 605 struct cifsFileInfo *pCFileStruct = file->private_data;
606 char *ptmp; 606 char *ptmp;
607 607
608 cFYI(1, "Closedir inode = 0x%p", inode); 608 cFYI(1, "Closedir inode = 0x%p", inode);
609 609
610 xid = GetXid(); 610 xid = get_xid();
611 611
612 if (pCFileStruct) { 612 if (pCFileStruct) {
613 struct cifs_tcon *pTcon = tlink_tcon(pCFileStruct->tlink); 613 struct cifs_tcon *pTcon = tlink_tcon(pCFileStruct->tlink);
@@ -639,7 +639,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
639 file->private_data = NULL; 639 file->private_data = NULL;
640 } 640 }
641 /* BB can we lock the filestruct while this is going on? */ 641 /* BB can we lock the filestruct while this is going on? */
642 FreeXid(xid); 642 free_xid(xid);
643 return rc; 643 return rc;
644} 644}
645 645
@@ -872,7 +872,8 @@ try_again:
872static int 872static int
873cifs_push_mandatory_locks(struct cifsFileInfo *cfile) 873cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
874{ 874{
875 int xid, rc = 0, stored_rc; 875 unsigned int xid;
876 int rc = 0, stored_rc;
876 struct cifsLockInfo *li, *tmp; 877 struct cifsLockInfo *li, *tmp;
877 struct cifs_tcon *tcon; 878 struct cifs_tcon *tcon;
878 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); 879 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode);
@@ -882,13 +883,13 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
882 LOCKING_ANDX_SHARED_LOCK | LOCKING_ANDX_LARGE_FILES}; 883 LOCKING_ANDX_SHARED_LOCK | LOCKING_ANDX_LARGE_FILES};
883 int i; 884 int i;
884 885
885 xid = GetXid(); 886 xid = get_xid();
886 tcon = tlink_tcon(cfile->tlink); 887 tcon = tlink_tcon(cfile->tlink);
887 888
888 mutex_lock(&cinode->lock_mutex); 889 mutex_lock(&cinode->lock_mutex);
889 if (!cinode->can_cache_brlcks) { 890 if (!cinode->can_cache_brlcks) {
890 mutex_unlock(&cinode->lock_mutex); 891 mutex_unlock(&cinode->lock_mutex);
891 FreeXid(xid); 892 free_xid(xid);
892 return rc; 893 return rc;
893 } 894 }
894 895
@@ -899,7 +900,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
899 max_buf = tcon->ses->server->maxBuf; 900 max_buf = tcon->ses->server->maxBuf;
900 if (!max_buf) { 901 if (!max_buf) {
901 mutex_unlock(&cinode->lock_mutex); 902 mutex_unlock(&cinode->lock_mutex);
902 FreeXid(xid); 903 free_xid(xid);
903 return -EINVAL; 904 return -EINVAL;
904 } 905 }
905 906
@@ -908,7 +909,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
908 buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); 909 buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL);
909 if (!buf) { 910 if (!buf) {
910 mutex_unlock(&cinode->lock_mutex); 911 mutex_unlock(&cinode->lock_mutex);
911 FreeXid(xid); 912 free_xid(xid);
912 return rc; 913 return rc;
913 } 914 }
914 915
@@ -947,7 +948,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
947 mutex_unlock(&cinode->lock_mutex); 948 mutex_unlock(&cinode->lock_mutex);
948 949
949 kfree(buf); 950 kfree(buf);
950 FreeXid(xid); 951 free_xid(xid);
951 return rc; 952 return rc;
952} 953}
953 954
@@ -977,12 +978,12 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile)
977 struct lock_to_push *lck, *tmp; 978 struct lock_to_push *lck, *tmp;
978 __u64 length; 979 __u64 length;
979 980
980 xid = GetXid(); 981 xid = get_xid();
981 982
982 mutex_lock(&cinode->lock_mutex); 983 mutex_lock(&cinode->lock_mutex);
983 if (!cinode->can_cache_brlcks) { 984 if (!cinode->can_cache_brlcks) {
984 mutex_unlock(&cinode->lock_mutex); 985 mutex_unlock(&cinode->lock_mutex);
985 FreeXid(xid); 986 free_xid(xid);
986 return rc; 987 return rc;
987 } 988 }
988 989
@@ -1054,7 +1055,7 @@ out:
1054 cinode->can_cache_brlcks = false; 1055 cinode->can_cache_brlcks = false;
1055 mutex_unlock(&cinode->lock_mutex); 1056 mutex_unlock(&cinode->lock_mutex);
1056 1057
1057 FreeXid(xid); 1058 free_xid(xid);
1058 return rc; 1059 return rc;
1059err_out: 1060err_out:
1060 list_for_each_entry_safe(lck, tmp, &locks_to_send, llist) { 1061 list_for_each_entry_safe(lck, tmp, &locks_to_send, llist) {
@@ -1126,7 +1127,7 @@ cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock,
1126} 1127}
1127 1128
1128static int 1129static int
1129cifs_mandatory_lock(int xid, struct cifsFileInfo *cfile, __u64 offset, 1130cifs_mandatory_lock(unsigned int xid, struct cifsFileInfo *cfile, __u64 offset,
1130 __u64 length, __u32 type, int lock, int unlock, bool wait) 1131 __u64 length, __u32 type, int lock, int unlock, bool wait)
1131{ 1132{
1132 return CIFSSMBLock(xid, tlink_tcon(cfile->tlink), cfile->netfid, 1133 return CIFSSMBLock(xid, tlink_tcon(cfile->tlink), cfile->netfid,
@@ -1136,7 +1137,7 @@ cifs_mandatory_lock(int xid, struct cifsFileInfo *cfile, __u64 offset,
1136 1137
1137static int 1138static int
1138cifs_getlk(struct file *file, struct file_lock *flock, __u32 type, 1139cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
1139 bool wait_flag, bool posix_lck, int xid) 1140 bool wait_flag, bool posix_lck, unsigned int xid)
1140{ 1141{
1141 int rc = 0; 1142 int rc = 0;
1142 __u64 length = 1 + flock->fl_end - flock->fl_start; 1143 __u64 length = 1 + flock->fl_end - flock->fl_start;
@@ -1221,7 +1222,8 @@ cifs_free_llist(struct list_head *llist)
1221} 1222}
1222 1223
1223static int 1224static int
1224cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, int xid) 1225cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,
1226 unsigned int xid)
1225{ 1227{
1226 int rc = 0, stored_rc; 1228 int rc = 0, stored_rc;
1227 int types[] = {LOCKING_ANDX_LARGE_FILES, 1229 int types[] = {LOCKING_ANDX_LARGE_FILES,
@@ -1326,7 +1328,8 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, int xid)
1326 1328
1327static int 1329static int
1328cifs_setlk(struct file *file, struct file_lock *flock, __u32 type, 1330cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
1329 bool wait_flag, bool posix_lck, int lock, int unlock, int xid) 1331 bool wait_flag, bool posix_lck, int lock, int unlock,
1332 unsigned int xid)
1330{ 1333{
1331 int rc = 0; 1334 int rc = 0;
1332 __u64 length = 1 + flock->fl_end - flock->fl_start; 1335 __u64 length = 1 + flock->fl_end - flock->fl_start;
@@ -1400,7 +1403,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
1400 __u32 type; 1403 __u32 type;
1401 1404
1402 rc = -EACCES; 1405 rc = -EACCES;
1403 xid = GetXid(); 1406 xid = get_xid();
1404 1407
1405 cFYI(1, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld " 1408 cFYI(1, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld "
1406 "end: %lld", cmd, flock->fl_flags, flock->fl_type, 1409 "end: %lld", cmd, flock->fl_flags, flock->fl_type,
@@ -1426,7 +1429,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
1426 */ 1429 */
1427 if (IS_GETLK(cmd)) { 1430 if (IS_GETLK(cmd)) {
1428 rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid); 1431 rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid);
1429 FreeXid(xid); 1432 free_xid(xid);
1430 return rc; 1433 return rc;
1431 } 1434 }
1432 1435
@@ -1435,13 +1438,13 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
1435 * if no lock or unlock then nothing to do since we do not 1438 * if no lock or unlock then nothing to do since we do not
1436 * know what it is 1439 * know what it is
1437 */ 1440 */
1438 FreeXid(xid); 1441 free_xid(xid);
1439 return -EOPNOTSUPP; 1442 return -EOPNOTSUPP;
1440 } 1443 }
1441 1444
1442 rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock, 1445 rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock,
1443 xid); 1446 xid);
1444 FreeXid(xid); 1447 free_xid(xid);
1445 return rc; 1448 return rc;
1446} 1449}
1447 1450
@@ -1468,7 +1471,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid,
1468 unsigned int total_written; 1471 unsigned int total_written;
1469 struct cifs_sb_info *cifs_sb; 1472 struct cifs_sb_info *cifs_sb;
1470 struct cifs_tcon *pTcon; 1473 struct cifs_tcon *pTcon;
1471 int xid; 1474 unsigned int xid;
1472 struct dentry *dentry = open_file->dentry; 1475 struct dentry *dentry = open_file->dentry;
1473 struct cifsInodeInfo *cifsi = CIFS_I(dentry->d_inode); 1476 struct cifsInodeInfo *cifsi = CIFS_I(dentry->d_inode);
1474 struct cifs_io_parms io_parms; 1477 struct cifs_io_parms io_parms;
@@ -1480,7 +1483,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid,
1480 1483
1481 pTcon = tlink_tcon(open_file->tlink); 1484 pTcon = tlink_tcon(open_file->tlink);
1482 1485
1483 xid = GetXid(); 1486 xid = get_xid();
1484 1487
1485 for (total_written = 0; write_size > total_written; 1488 for (total_written = 0; write_size > total_written;
1486 total_written += bytes_written) { 1489 total_written += bytes_written) {
@@ -1516,7 +1519,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid,
1516 if (total_written) 1519 if (total_written)
1517 break; 1520 break;
1518 else { 1521 else {
1519 FreeXid(xid); 1522 free_xid(xid);
1520 return rc; 1523 return rc;
1521 } 1524 }
1522 } else { 1525 } else {
@@ -1536,7 +1539,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid,
1536 spin_unlock(&dentry->d_inode->i_lock); 1539 spin_unlock(&dentry->d_inode->i_lock);
1537 } 1540 }
1538 mark_inode_dirty_sync(dentry->d_inode); 1541 mark_inode_dirty_sync(dentry->d_inode);
1539 FreeXid(xid); 1542 free_xid(xid);
1540 return total_written; 1543 return total_written;
1541} 1544}
1542 1545
@@ -1935,9 +1938,9 @@ static int
1935cifs_writepage_locked(struct page *page, struct writeback_control *wbc) 1938cifs_writepage_locked(struct page *page, struct writeback_control *wbc)
1936{ 1939{
1937 int rc; 1940 int rc;
1938 int xid; 1941 unsigned int xid;
1939 1942
1940 xid = GetXid(); 1943 xid = get_xid();
1941/* BB add check for wbc flags */ 1944/* BB add check for wbc flags */
1942 page_cache_get(page); 1945 page_cache_get(page);
1943 if (!PageUptodate(page)) 1946 if (!PageUptodate(page))
@@ -1966,7 +1969,7 @@ retry_write:
1966 SetPageUptodate(page); 1969 SetPageUptodate(page);
1967 end_page_writeback(page); 1970 end_page_writeback(page);
1968 page_cache_release(page); 1971 page_cache_release(page);
1969 FreeXid(xid); 1972 free_xid(xid);
1970 return rc; 1973 return rc;
1971} 1974}
1972 1975
@@ -2005,9 +2008,9 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
2005 if (!PageUptodate(page)) { 2008 if (!PageUptodate(page)) {
2006 char *page_data; 2009 char *page_data;
2007 unsigned offset = pos & (PAGE_CACHE_SIZE - 1); 2010 unsigned offset = pos & (PAGE_CACHE_SIZE - 1);
2008 int xid; 2011 unsigned int xid;
2009 2012
2010 xid = GetXid(); 2013 xid = get_xid();
2011 /* this is probably better than directly calling 2014 /* this is probably better than directly calling
2012 partialpage_write since in this function the file handle is 2015 partialpage_write since in this function the file handle is
2013 known which we might as well leverage */ 2016 known which we might as well leverage */
@@ -2018,7 +2021,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
2018 /* if (rc < 0) should we set writebehind rc? */ 2021 /* if (rc < 0) should we set writebehind rc? */
2019 kunmap(page); 2022 kunmap(page);
2020 2023
2021 FreeXid(xid); 2024 free_xid(xid);
2022 } else { 2025 } else {
2023 rc = copied; 2026 rc = copied;
2024 pos += copied; 2027 pos += copied;
@@ -2041,7 +2044,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
2041int cifs_strict_fsync(struct file *file, loff_t start, loff_t end, 2044int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
2042 int datasync) 2045 int datasync)
2043{ 2046{
2044 int xid; 2047 unsigned int xid;
2045 int rc = 0; 2048 int rc = 0;
2046 struct cifs_tcon *tcon; 2049 struct cifs_tcon *tcon;
2047 struct cifsFileInfo *smbfile = file->private_data; 2050 struct cifsFileInfo *smbfile = file->private_data;
@@ -2053,7 +2056,7 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
2053 return rc; 2056 return rc;
2054 mutex_lock(&inode->i_mutex); 2057 mutex_lock(&inode->i_mutex);
2055 2058
2056 xid = GetXid(); 2059 xid = get_xid();
2057 2060
2058 cFYI(1, "Sync file - name: %s datasync: 0x%x", 2061 cFYI(1, "Sync file - name: %s datasync: 0x%x",
2059 file->f_path.dentry->d_name.name, datasync); 2062 file->f_path.dentry->d_name.name, datasync);
@@ -2070,14 +2073,14 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
2070 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) 2073 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC))
2071 rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); 2074 rc = CIFSSMBFlush(xid, tcon, smbfile->netfid);
2072 2075
2073 FreeXid(xid); 2076 free_xid(xid);
2074 mutex_unlock(&inode->i_mutex); 2077 mutex_unlock(&inode->i_mutex);
2075 return rc; 2078 return rc;
2076} 2079}
2077 2080
2078int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) 2081int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
2079{ 2082{
2080 int xid; 2083 unsigned int xid;
2081 int rc = 0; 2084 int rc = 0;
2082 struct cifs_tcon *tcon; 2085 struct cifs_tcon *tcon;
2083 struct cifsFileInfo *smbfile = file->private_data; 2086 struct cifsFileInfo *smbfile = file->private_data;
@@ -2089,7 +2092,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
2089 return rc; 2092 return rc;
2090 mutex_lock(&inode->i_mutex); 2093 mutex_lock(&inode->i_mutex);
2091 2094
2092 xid = GetXid(); 2095 xid = get_xid();
2093 2096
2094 cFYI(1, "Sync file - name: %s datasync: 0x%x", 2097 cFYI(1, "Sync file - name: %s datasync: 0x%x",
2095 file->f_path.dentry->d_name.name, datasync); 2098 file->f_path.dentry->d_name.name, datasync);
@@ -2098,7 +2101,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
2098 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) 2101 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC))
2099 rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); 2102 rc = CIFSSMBFlush(xid, tcon, smbfile->netfid);
2100 2103
2101 FreeXid(xid); 2104 free_xid(xid);
2102 mutex_unlock(&inode->i_mutex); 2105 mutex_unlock(&inode->i_mutex);
2103 return rc; 2106 return rc;
2104} 2107}
@@ -2743,14 +2746,14 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
2743 unsigned int rsize; 2746 unsigned int rsize;
2744 struct cifs_sb_info *cifs_sb; 2747 struct cifs_sb_info *cifs_sb;
2745 struct cifs_tcon *pTcon; 2748 struct cifs_tcon *pTcon;
2746 int xid; 2749 unsigned int xid;
2747 char *current_offset; 2750 char *current_offset;
2748 struct cifsFileInfo *open_file; 2751 struct cifsFileInfo *open_file;
2749 struct cifs_io_parms io_parms; 2752 struct cifs_io_parms io_parms;
2750 int buf_type = CIFS_NO_BUFFER; 2753 int buf_type = CIFS_NO_BUFFER;
2751 __u32 pid; 2754 __u32 pid;
2752 2755
2753 xid = GetXid(); 2756 xid = get_xid();
2754 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 2757 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
2755 2758
2756 /* FIXME: set up handlers for larger reads and/or convert to async */ 2759 /* FIXME: set up handlers for larger reads and/or convert to async */
@@ -2758,7 +2761,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
2758 2761
2759 if (file->private_data == NULL) { 2762 if (file->private_data == NULL) {
2760 rc = -EBADF; 2763 rc = -EBADF;
2761 FreeXid(xid); 2764 free_xid(xid);
2762 return rc; 2765 return rc;
2763 } 2766 }
2764 open_file = file->private_data; 2767 open_file = file->private_data;
@@ -2803,7 +2806,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
2803 if (total_read) { 2806 if (total_read) {
2804 break; 2807 break;
2805 } else { 2808 } else {
2806 FreeXid(xid); 2809 free_xid(xid);
2807 return rc; 2810 return rc;
2808 } 2811 }
2809 } else { 2812 } else {
@@ -2811,7 +2814,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
2811 *poffset += bytes_read; 2814 *poffset += bytes_read;
2812 } 2815 }
2813 } 2816 }
2814 FreeXid(xid); 2817 free_xid(xid);
2815 return total_read; 2818 return total_read;
2816} 2819}
2817 2820
@@ -2838,7 +2841,7 @@ int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma)
2838 int rc, xid; 2841 int rc, xid;
2839 struct inode *inode = file->f_path.dentry->d_inode; 2842 struct inode *inode = file->f_path.dentry->d_inode;
2840 2843
2841 xid = GetXid(); 2844 xid = get_xid();
2842 2845
2843 if (!CIFS_I(inode)->clientCanCacheRead) { 2846 if (!CIFS_I(inode)->clientCanCacheRead) {
2844 rc = cifs_invalidate_mapping(inode); 2847 rc = cifs_invalidate_mapping(inode);
@@ -2849,7 +2852,7 @@ int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma)
2849 rc = generic_file_mmap(file, vma); 2852 rc = generic_file_mmap(file, vma);
2850 if (rc == 0) 2853 if (rc == 0)
2851 vma->vm_ops = &cifs_file_vm_ops; 2854 vma->vm_ops = &cifs_file_vm_ops;
2852 FreeXid(xid); 2855 free_xid(xid);
2853 return rc; 2856 return rc;
2854} 2857}
2855 2858
@@ -2857,17 +2860,17 @@ int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
2857{ 2860{
2858 int rc, xid; 2861 int rc, xid;
2859 2862
2860 xid = GetXid(); 2863 xid = get_xid();
2861 rc = cifs_revalidate_file(file); 2864 rc = cifs_revalidate_file(file);
2862 if (rc) { 2865 if (rc) {
2863 cFYI(1, "Validation prior to mmap failed, error=%d", rc); 2866 cFYI(1, "Validation prior to mmap failed, error=%d", rc);
2864 FreeXid(xid); 2867 free_xid(xid);
2865 return rc; 2868 return rc;
2866 } 2869 }
2867 rc = generic_file_mmap(file, vma); 2870 rc = generic_file_mmap(file, vma);
2868 if (rc == 0) 2871 if (rc == 0)
2869 vma->vm_ops = &cifs_file_vm_ops; 2872 vma->vm_ops = &cifs_file_vm_ops;
2870 FreeXid(xid); 2873 free_xid(xid);
2871 return rc; 2874 return rc;
2872} 2875}
2873 2876
@@ -3157,13 +3160,13 @@ static int cifs_readpage(struct file *file, struct page *page)
3157{ 3160{
3158 loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT; 3161 loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT;
3159 int rc = -EACCES; 3162 int rc = -EACCES;
3160 int xid; 3163 unsigned int xid;
3161 3164
3162 xid = GetXid(); 3165 xid = get_xid();
3163 3166
3164 if (file->private_data == NULL) { 3167 if (file->private_data == NULL) {
3165 rc = -EBADF; 3168 rc = -EBADF;
3166 FreeXid(xid); 3169 free_xid(xid);
3167 return rc; 3170 return rc;
3168 } 3171 }
3169 3172
@@ -3174,7 +3177,7 @@ static int cifs_readpage(struct file *file, struct page *page)
3174 3177
3175 unlock_page(page); 3178 unlock_page(page);
3176 3179
3177 FreeXid(xid); 3180 free_xid(xid);
3178 return rc; 3181 return rc;
3179} 3182}
3180 3183
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 8e8bb49112ff..af902864ac03 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -289,7 +289,7 @@ cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb)
289int cifs_get_file_info_unix(struct file *filp) 289int cifs_get_file_info_unix(struct file *filp)
290{ 290{
291 int rc; 291 int rc;
292 int xid; 292 unsigned int xid;
293 FILE_UNIX_BASIC_INFO find_data; 293 FILE_UNIX_BASIC_INFO find_data;
294 struct cifs_fattr fattr; 294 struct cifs_fattr fattr;
295 struct inode *inode = filp->f_path.dentry->d_inode; 295 struct inode *inode = filp->f_path.dentry->d_inode;
@@ -297,7 +297,7 @@ int cifs_get_file_info_unix(struct file *filp)
297 struct cifsFileInfo *cfile = filp->private_data; 297 struct cifsFileInfo *cfile = filp->private_data;
298 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 298 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
299 299
300 xid = GetXid(); 300 xid = get_xid();
301 rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->netfid, &find_data); 301 rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->netfid, &find_data);
302 if (!rc) { 302 if (!rc) {
303 cifs_unix_basic_to_fattr(&fattr, &find_data, cifs_sb); 303 cifs_unix_basic_to_fattr(&fattr, &find_data, cifs_sb);
@@ -307,13 +307,13 @@ int cifs_get_file_info_unix(struct file *filp)
307 } 307 }
308 308
309 cifs_fattr_to_inode(inode, &fattr); 309 cifs_fattr_to_inode(inode, &fattr);
310 FreeXid(xid); 310 free_xid(xid);
311 return rc; 311 return rc;
312} 312}
313 313
314int cifs_get_inode_info_unix(struct inode **pinode, 314int cifs_get_inode_info_unix(struct inode **pinode,
315 const unsigned char *full_path, 315 const unsigned char *full_path,
316 struct super_block *sb, int xid) 316 struct super_block *sb, unsigned int xid)
317{ 317{
318 int rc; 318 int rc;
319 FILE_UNIX_BASIC_INFO find_data; 319 FILE_UNIX_BASIC_INFO find_data;
@@ -367,7 +367,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
367 367
368static int 368static int
369cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path, 369cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
370 struct cifs_sb_info *cifs_sb, int xid) 370 struct cifs_sb_info *cifs_sb, unsigned int xid)
371{ 371{
372 int rc; 372 int rc;
373 int oplock = 0; 373 int oplock = 0;
@@ -466,7 +466,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
466 * FIXME: Doesn't this clobber the type bit we got from cifs_sfu_type ? 466 * FIXME: Doesn't this clobber the type bit we got from cifs_sfu_type ?
467 */ 467 */
468static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path, 468static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,
469 struct cifs_sb_info *cifs_sb, int xid) 469 struct cifs_sb_info *cifs_sb, unsigned int xid)
470{ 470{
471#ifdef CONFIG_CIFS_XATTR 471#ifdef CONFIG_CIFS_XATTR
472 ssize_t rc; 472 ssize_t rc;
@@ -557,7 +557,7 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
557int cifs_get_file_info(struct file *filp) 557int cifs_get_file_info(struct file *filp)
558{ 558{
559 int rc; 559 int rc;
560 int xid; 560 unsigned int xid;
561 FILE_ALL_INFO find_data; 561 FILE_ALL_INFO find_data;
562 struct cifs_fattr fattr; 562 struct cifs_fattr fattr;
563 struct inode *inode = filp->f_path.dentry->d_inode; 563 struct inode *inode = filp->f_path.dentry->d_inode;
@@ -565,7 +565,7 @@ int cifs_get_file_info(struct file *filp)
565 struct cifsFileInfo *cfile = filp->private_data; 565 struct cifsFileInfo *cfile = filp->private_data;
566 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 566 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
567 567
568 xid = GetXid(); 568 xid = get_xid();
569 rc = CIFSSMBQFileInfo(xid, tcon, cfile->netfid, &find_data); 569 rc = CIFSSMBQFileInfo(xid, tcon, cfile->netfid, &find_data);
570 switch (rc) { 570 switch (rc) {
571 case 0: 571 case 0:
@@ -596,13 +596,13 @@ int cifs_get_file_info(struct file *filp)
596 fattr.cf_flags |= CIFS_FATTR_NEED_REVAL; 596 fattr.cf_flags |= CIFS_FATTR_NEED_REVAL;
597 cifs_fattr_to_inode(inode, &fattr); 597 cifs_fattr_to_inode(inode, &fattr);
598cgfi_exit: 598cgfi_exit:
599 FreeXid(xid); 599 free_xid(xid);
600 return rc; 600 return rc;
601} 601}
602 602
603int cifs_get_inode_info(struct inode **pinode, 603int cifs_get_inode_info(struct inode **pinode,
604 const unsigned char *full_path, FILE_ALL_INFO *pfindData, 604 const unsigned char *full_path, FILE_ALL_INFO *pfindData,
605 struct super_block *sb, int xid, const __u16 *pfid) 605 struct super_block *sb, unsigned int xid, const __u16 *pfid)
606{ 606{
607 int rc = 0, tmprc; 607 int rc = 0, tmprc;
608 struct cifs_tcon *pTcon; 608 struct cifs_tcon *pTcon;
@@ -886,13 +886,13 @@ retry_iget5_locked:
886/* gets root inode */ 886/* gets root inode */
887struct inode *cifs_root_iget(struct super_block *sb) 887struct inode *cifs_root_iget(struct super_block *sb)
888{ 888{
889 int xid; 889 unsigned int xid;
890 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 890 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
891 struct inode *inode = NULL; 891 struct inode *inode = NULL;
892 long rc; 892 long rc;
893 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); 893 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
894 894
895 xid = GetXid(); 895 xid = get_xid();
896 if (tcon->unix_ext) 896 if (tcon->unix_ext)
897 rc = cifs_get_inode_info_unix(&inode, "", sb, xid); 897 rc = cifs_get_inode_info_unix(&inode, "", sb, xid);
898 else 898 else
@@ -922,15 +922,15 @@ struct inode *cifs_root_iget(struct super_block *sb)
922 } 922 }
923 923
924out: 924out:
925 /* can not call macro FreeXid here since in a void func 925 /* can not call macro free_xid here since in a void func
926 * TODO: This is no longer true 926 * TODO: This is no longer true
927 */ 927 */
928 _FreeXid(xid); 928 _free_xid(xid);
929 return inode; 929 return inode;
930} 930}
931 931
932static int 932static int
933cifs_set_file_info(struct inode *inode, struct iattr *attrs, int xid, 933cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid,
934 char *full_path, __u32 dosattr) 934 char *full_path, __u32 dosattr)
935{ 935{
936 int rc; 936 int rc;
@@ -1051,7 +1051,8 @@ out:
1051 * anything else. 1051 * anything else.
1052 */ 1052 */
1053static int 1053static int
1054cifs_rename_pending_delete(char *full_path, struct dentry *dentry, int xid) 1054cifs_rename_pending_delete(char *full_path, struct dentry *dentry,
1055 unsigned int xid)
1055{ 1056{
1056 int oplock = 0; 1057 int oplock = 0;
1057 int rc; 1058 int rc;
@@ -1171,7 +1172,7 @@ undo_setattr:
1171int cifs_unlink(struct inode *dir, struct dentry *dentry) 1172int cifs_unlink(struct inode *dir, struct dentry *dentry)
1172{ 1173{
1173 int rc = 0; 1174 int rc = 0;
1174 int xid; 1175 unsigned int xid;
1175 char *full_path = NULL; 1176 char *full_path = NULL;
1176 struct inode *inode = dentry->d_inode; 1177 struct inode *inode = dentry->d_inode;
1177 struct cifsInodeInfo *cifs_inode; 1178 struct cifsInodeInfo *cifs_inode;
@@ -1189,7 +1190,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
1189 return PTR_ERR(tlink); 1190 return PTR_ERR(tlink);
1190 tcon = tlink_tcon(tlink); 1191 tcon = tlink_tcon(tlink);
1191 1192
1192 xid = GetXid(); 1193 xid = get_xid();
1193 1194
1194 /* Unlink can be called from rename so we can not take the 1195 /* Unlink can be called from rename so we can not take the
1195 * sb->s_vfs_rename_mutex here */ 1196 * sb->s_vfs_rename_mutex here */
@@ -1265,7 +1266,7 @@ out_reval:
1265unlink_out: 1266unlink_out:
1266 kfree(full_path); 1267 kfree(full_path);
1267 kfree(attrs); 1268 kfree(attrs);
1268 FreeXid(xid); 1269 free_xid(xid);
1269 cifs_put_tlink(tlink); 1270 cifs_put_tlink(tlink);
1270 return rc; 1271 return rc;
1271} 1272}
@@ -1273,7 +1274,7 @@ unlink_out:
1273int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) 1274int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
1274{ 1275{
1275 int rc = 0, tmprc; 1276 int rc = 0, tmprc;
1276 int xid; 1277 unsigned int xid;
1277 struct cifs_sb_info *cifs_sb; 1278 struct cifs_sb_info *cifs_sb;
1278 struct tcon_link *tlink; 1279 struct tcon_link *tlink;
1279 struct cifs_tcon *pTcon; 1280 struct cifs_tcon *pTcon;
@@ -1289,7 +1290,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
1289 return PTR_ERR(tlink); 1290 return PTR_ERR(tlink);
1290 pTcon = tlink_tcon(tlink); 1291 pTcon = tlink_tcon(tlink);
1291 1292
1292 xid = GetXid(); 1293 xid = get_xid();
1293 1294
1294 full_path = build_path_from_dentry(direntry); 1295 full_path = build_path_from_dentry(direntry);
1295 if (full_path == NULL) { 1296 if (full_path == NULL) {
@@ -1446,7 +1447,7 @@ mkdir_out:
1446 */ 1447 */
1447 CIFS_I(inode)->time = 0; 1448 CIFS_I(inode)->time = 0;
1448 kfree(full_path); 1449 kfree(full_path);
1449 FreeXid(xid); 1450 free_xid(xid);
1450 cifs_put_tlink(tlink); 1451 cifs_put_tlink(tlink);
1451 return rc; 1452 return rc;
1452} 1453}
@@ -1454,7 +1455,7 @@ mkdir_out:
1454int cifs_rmdir(struct inode *inode, struct dentry *direntry) 1455int cifs_rmdir(struct inode *inode, struct dentry *direntry)
1455{ 1456{
1456 int rc = 0; 1457 int rc = 0;
1457 int xid; 1458 unsigned int xid;
1458 struct cifs_sb_info *cifs_sb; 1459 struct cifs_sb_info *cifs_sb;
1459 struct tcon_link *tlink; 1460 struct tcon_link *tlink;
1460 struct cifs_tcon *pTcon; 1461 struct cifs_tcon *pTcon;
@@ -1463,7 +1464,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
1463 1464
1464 cFYI(1, "cifs_rmdir, inode = 0x%p", inode); 1465 cFYI(1, "cifs_rmdir, inode = 0x%p", inode);
1465 1466
1466 xid = GetXid(); 1467 xid = get_xid();
1467 1468
1468 full_path = build_path_from_dentry(direntry); 1469 full_path = build_path_from_dentry(direntry);
1469 if (full_path == NULL) { 1470 if (full_path == NULL) {
@@ -1506,13 +1507,14 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
1506 1507
1507rmdir_exit: 1508rmdir_exit:
1508 kfree(full_path); 1509 kfree(full_path);
1509 FreeXid(xid); 1510 free_xid(xid);
1510 return rc; 1511 return rc;
1511} 1512}
1512 1513
1513static int 1514static int
1514cifs_do_rename(int xid, struct dentry *from_dentry, const char *fromPath, 1515cifs_do_rename(unsigned int xid, struct dentry *from_dentry,
1515 struct dentry *to_dentry, const char *toPath) 1516 const char *fromPath, struct dentry *to_dentry,
1517 const char *toPath)
1516{ 1518{
1517 struct cifs_sb_info *cifs_sb = CIFS_SB(from_dentry->d_sb); 1519 struct cifs_sb_info *cifs_sb = CIFS_SB(from_dentry->d_sb);
1518 struct tcon_link *tlink; 1520 struct tcon_link *tlink;
@@ -1571,7 +1573,8 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry,
1571 struct cifs_tcon *tcon; 1573 struct cifs_tcon *tcon;
1572 FILE_UNIX_BASIC_INFO *info_buf_source = NULL; 1574 FILE_UNIX_BASIC_INFO *info_buf_source = NULL;
1573 FILE_UNIX_BASIC_INFO *info_buf_target; 1575 FILE_UNIX_BASIC_INFO *info_buf_target;
1574 int xid, rc, tmprc; 1576 unsigned int xid;
1577 int rc, tmprc;
1575 1578
1576 cifs_sb = CIFS_SB(source_dir->i_sb); 1579 cifs_sb = CIFS_SB(source_dir->i_sb);
1577 tlink = cifs_sb_tlink(cifs_sb); 1580 tlink = cifs_sb_tlink(cifs_sb);
@@ -1579,7 +1582,7 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry,
1579 return PTR_ERR(tlink); 1582 return PTR_ERR(tlink);
1580 tcon = tlink_tcon(tlink); 1583 tcon = tlink_tcon(tlink);
1581 1584
1582 xid = GetXid(); 1585 xid = get_xid();
1583 1586
1584 /* 1587 /*
1585 * we already have the rename sem so we do not need to 1588 * we already have the rename sem so we do not need to
@@ -1652,7 +1655,7 @@ cifs_rename_exit:
1652 kfree(info_buf_source); 1655 kfree(info_buf_source);
1653 kfree(fromName); 1656 kfree(fromName);
1654 kfree(toName); 1657 kfree(toName);
1655 FreeXid(xid); 1658 free_xid(xid);
1656 cifs_put_tlink(tlink); 1659 cifs_put_tlink(tlink);
1657 return rc; 1660 return rc;
1658} 1661}
@@ -1727,7 +1730,7 @@ int cifs_revalidate_file_attr(struct file *filp)
1727 1730
1728int cifs_revalidate_dentry_attr(struct dentry *dentry) 1731int cifs_revalidate_dentry_attr(struct dentry *dentry)
1729{ 1732{
1730 int xid; 1733 unsigned int xid;
1731 int rc = 0; 1734 int rc = 0;
1732 struct inode *inode = dentry->d_inode; 1735 struct inode *inode = dentry->d_inode;
1733 struct super_block *sb = dentry->d_sb; 1736 struct super_block *sb = dentry->d_sb;
@@ -1739,7 +1742,7 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry)
1739 if (!cifs_inode_needs_reval(inode)) 1742 if (!cifs_inode_needs_reval(inode))
1740 return rc; 1743 return rc;
1741 1744
1742 xid = GetXid(); 1745 xid = get_xid();
1743 1746
1744 /* can not safely grab the rename sem here if rename calls revalidate 1747 /* can not safely grab the rename sem here if rename calls revalidate
1745 since that would deadlock */ 1748 since that would deadlock */
@@ -1761,7 +1764,7 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry)
1761 1764
1762out: 1765out:
1763 kfree(full_path); 1766 kfree(full_path);
1764 FreeXid(xid); 1767 free_xid(xid);
1765 return rc; 1768 return rc;
1766} 1769}
1767 1770
@@ -1869,7 +1872,7 @@ static void cifs_setsize(struct inode *inode, loff_t offset)
1869 1872
1870static int 1873static int
1871cifs_set_file_size(struct inode *inode, struct iattr *attrs, 1874cifs_set_file_size(struct inode *inode, struct iattr *attrs,
1872 int xid, char *full_path) 1875 unsigned int xid, char *full_path)
1873{ 1876{
1874 int rc; 1877 int rc;
1875 struct cifsFileInfo *open_file; 1878 struct cifsFileInfo *open_file;
@@ -1971,7 +1974,7 @@ static int
1971cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) 1974cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
1972{ 1975{
1973 int rc; 1976 int rc;
1974 int xid; 1977 unsigned int xid;
1975 char *full_path = NULL; 1978 char *full_path = NULL;
1976 struct inode *inode = direntry->d_inode; 1979 struct inode *inode = direntry->d_inode;
1977 struct cifsInodeInfo *cifsInode = CIFS_I(inode); 1980 struct cifsInodeInfo *cifsInode = CIFS_I(inode);
@@ -1984,7 +1987,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
1984 cFYI(1, "setattr_unix on file %s attrs->ia_valid=0x%x", 1987 cFYI(1, "setattr_unix on file %s attrs->ia_valid=0x%x",
1985 direntry->d_name.name, attrs->ia_valid); 1988 direntry->d_name.name, attrs->ia_valid);
1986 1989
1987 xid = GetXid(); 1990 xid = get_xid();
1988 1991
1989 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) 1992 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM)
1990 attrs->ia_valid |= ATTR_FORCE; 1993 attrs->ia_valid |= ATTR_FORCE;
@@ -2104,14 +2107,14 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
2104out: 2107out:
2105 kfree(args); 2108 kfree(args);
2106 kfree(full_path); 2109 kfree(full_path);
2107 FreeXid(xid); 2110 free_xid(xid);
2108 return rc; 2111 return rc;
2109} 2112}
2110 2113
2111static int 2114static int
2112cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) 2115cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
2113{ 2116{
2114 int xid; 2117 unsigned int xid;
2115 uid_t uid = NO_CHANGE_32; 2118 uid_t uid = NO_CHANGE_32;
2116 gid_t gid = NO_CHANGE_32; 2119 gid_t gid = NO_CHANGE_32;
2117 struct inode *inode = direntry->d_inode; 2120 struct inode *inode = direntry->d_inode;
@@ -2122,7 +2125,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
2122 __u32 dosattr = 0; 2125 __u32 dosattr = 0;
2123 __u64 mode = NO_CHANGE_64; 2126 __u64 mode = NO_CHANGE_64;
2124 2127
2125 xid = GetXid(); 2128 xid = get_xid();
2126 2129
2127 cFYI(1, "setattr on file %s attrs->iavalid 0x%x", 2130 cFYI(1, "setattr on file %s attrs->iavalid 0x%x",
2128 direntry->d_name.name, attrs->ia_valid); 2131 direntry->d_name.name, attrs->ia_valid);
@@ -2132,14 +2135,14 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
2132 2135
2133 rc = inode_change_ok(inode, attrs); 2136 rc = inode_change_ok(inode, attrs);
2134 if (rc < 0) { 2137 if (rc < 0) {
2135 FreeXid(xid); 2138 free_xid(xid);
2136 return rc; 2139 return rc;
2137 } 2140 }
2138 2141
2139 full_path = build_path_from_dentry(direntry); 2142 full_path = build_path_from_dentry(direntry);
2140 if (full_path == NULL) { 2143 if (full_path == NULL) {
2141 rc = -ENOMEM; 2144 rc = -ENOMEM;
2142 FreeXid(xid); 2145 free_xid(xid);
2143 return rc; 2146 return rc;
2144 } 2147 }
2145 2148
@@ -2265,7 +2268,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
2265 2268
2266cifs_setattr_exit: 2269cifs_setattr_exit:
2267 kfree(full_path); 2270 kfree(full_path);
2268 FreeXid(xid); 2271 free_xid(xid);
2269 return rc; 2272 return rc;
2270} 2273}
2271 2274
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
index 6d2667f0c98c..ae082a66de2f 100644
--- a/fs/cifs/ioctl.c
+++ b/fs/cifs/ioctl.c
@@ -34,7 +34,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
34{ 34{
35 struct inode *inode = filep->f_dentry->d_inode; 35 struct inode *inode = filep->f_dentry->d_inode;
36 int rc = -ENOTTY; /* strange error - but the precedent */ 36 int rc = -ENOTTY; /* strange error - but the precedent */
37 int xid; 37 unsigned int xid;
38 struct cifs_sb_info *cifs_sb; 38 struct cifs_sb_info *cifs_sb;
39#ifdef CONFIG_CIFS_POSIX 39#ifdef CONFIG_CIFS_POSIX
40 struct cifsFileInfo *pSMBFile = filep->private_data; 40 struct cifsFileInfo *pSMBFile = filep->private_data;
@@ -44,7 +44,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
44 __u64 caps; 44 __u64 caps;
45#endif /* CONFIG_CIFS_POSIX */ 45#endif /* CONFIG_CIFS_POSIX */
46 46
47 xid = GetXid(); 47 xid = get_xid();
48 48
49 cFYI(1, "ioctl file %p cmd %u arg %lu", filep, command, arg); 49 cFYI(1, "ioctl file %p cmd %u arg %lu", filep, command, arg);
50 50
@@ -105,6 +105,6 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
105 break; 105 break;
106 } 106 }
107 107
108 FreeXid(xid); 108 free_xid(xid);
109 return rc; 109 return rc;
110} 110}
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 90d8add2a2a9..f78971511f57 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -181,7 +181,7 @@ CIFSFormatMFSymlink(u8 *buf, unsigned int buf_len, const char *link_str)
181} 181}
182 182
183static int 183static int
184CIFSCreateMFSymLink(const int xid, struct cifs_tcon *tcon, 184CIFSCreateMFSymLink(const unsigned int xid, struct cifs_tcon *tcon,
185 const char *fromName, const char *toName, 185 const char *fromName, const char *toName,
186 struct cifs_sb_info *cifs_sb) 186 struct cifs_sb_info *cifs_sb)
187{ 187{
@@ -238,7 +238,7 @@ CIFSCreateMFSymLink(const int xid, struct cifs_tcon *tcon,
238} 238}
239 239
240static int 240static int
241CIFSQueryMFSymLink(const int xid, struct cifs_tcon *tcon, 241CIFSQueryMFSymLink(const unsigned int xid, struct cifs_tcon *tcon,
242 const unsigned char *searchName, char **symlinkinfo, 242 const unsigned char *searchName, char **symlinkinfo,
243 const struct nls_table *nls_codepage, int remap) 243 const struct nls_table *nls_codepage, int remap)
244{ 244{
@@ -307,7 +307,7 @@ CIFSCouldBeMFSymlink(const struct cifs_fattr *fattr)
307int 307int
308CIFSCheckMFSymlink(struct cifs_fattr *fattr, 308CIFSCheckMFSymlink(struct cifs_fattr *fattr,
309 const unsigned char *path, 309 const unsigned char *path,
310 struct cifs_sb_info *cifs_sb, int xid) 310 struct cifs_sb_info *cifs_sb, unsigned int xid)
311{ 311{
312 int rc; 312 int rc;
313 int oplock = 0; 313 int oplock = 0;
@@ -390,7 +390,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
390 struct dentry *direntry) 390 struct dentry *direntry)
391{ 391{
392 int rc = -EACCES; 392 int rc = -EACCES;
393 int xid; 393 unsigned int xid;
394 char *fromName = NULL; 394 char *fromName = NULL;
395 char *toName = NULL; 395 char *toName = NULL;
396 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 396 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
@@ -403,7 +403,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
403 return PTR_ERR(tlink); 403 return PTR_ERR(tlink);
404 pTcon = tlink_tcon(tlink); 404 pTcon = tlink_tcon(tlink);
405 405
406 xid = GetXid(); 406 xid = get_xid();
407 407
408 fromName = build_path_from_dentry(old_file); 408 fromName = build_path_from_dentry(old_file);
409 toName = build_path_from_dentry(direntry); 409 toName = build_path_from_dentry(direntry);
@@ -455,7 +455,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
455cifs_hl_exit: 455cifs_hl_exit:
456 kfree(fromName); 456 kfree(fromName);
457 kfree(toName); 457 kfree(toName);
458 FreeXid(xid); 458 free_xid(xid);
459 cifs_put_tlink(tlink); 459 cifs_put_tlink(tlink);
460 return rc; 460 return rc;
461} 461}
@@ -465,14 +465,14 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
465{ 465{
466 struct inode *inode = direntry->d_inode; 466 struct inode *inode = direntry->d_inode;
467 int rc = -ENOMEM; 467 int rc = -ENOMEM;
468 int xid; 468 unsigned int xid;
469 char *full_path = NULL; 469 char *full_path = NULL;
470 char *target_path = NULL; 470 char *target_path = NULL;
471 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 471 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
472 struct tcon_link *tlink = NULL; 472 struct tcon_link *tlink = NULL;
473 struct cifs_tcon *tcon; 473 struct cifs_tcon *tcon;
474 474
475 xid = GetXid(); 475 xid = get_xid();
476 476
477 tlink = cifs_sb_tlink(cifs_sb); 477 tlink = cifs_sb_tlink(cifs_sb);
478 if (IS_ERR(tlink)) { 478 if (IS_ERR(tlink)) {
@@ -529,7 +529,7 @@ out:
529 target_path = ERR_PTR(rc); 529 target_path = ERR_PTR(rc);
530 } 530 }
531 531
532 FreeXid(xid); 532 free_xid(xid);
533 if (tlink) 533 if (tlink)
534 cifs_put_tlink(tlink); 534 cifs_put_tlink(tlink);
535 nd_set_link(nd, target_path); 535 nd_set_link(nd, target_path);
@@ -540,14 +540,14 @@ int
540cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname) 540cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
541{ 541{
542 int rc = -EOPNOTSUPP; 542 int rc = -EOPNOTSUPP;
543 int xid; 543 unsigned int xid;
544 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 544 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
545 struct tcon_link *tlink; 545 struct tcon_link *tlink;
546 struct cifs_tcon *pTcon; 546 struct cifs_tcon *pTcon;
547 char *full_path = NULL; 547 char *full_path = NULL;
548 struct inode *newinode = NULL; 548 struct inode *newinode = NULL;
549 549
550 xid = GetXid(); 550 xid = get_xid();
551 551
552 tlink = cifs_sb_tlink(cifs_sb); 552 tlink = cifs_sb_tlink(cifs_sb);
553 if (IS_ERR(tlink)) { 553 if (IS_ERR(tlink)) {
@@ -594,7 +594,7 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
594symlink_exit: 594symlink_exit:
595 kfree(full_path); 595 kfree(full_path);
596 cifs_put_tlink(tlink); 596 cifs_put_tlink(tlink);
597 FreeXid(xid); 597 free_xid(xid);
598 return rc; 598 return rc;
599} 599}
600 600
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 557506ae1e2a..64601146f157 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -40,7 +40,7 @@ extern mempool_t *cifs_req_poolp;
40 since the cifs fs was mounted */ 40 since the cifs fs was mounted */
41 41
42unsigned int 42unsigned int
43_GetXid(void) 43_get_xid(void)
44{ 44{
45 unsigned int xid; 45 unsigned int xid;
46 46
@@ -58,7 +58,7 @@ _GetXid(void)
58} 58}
59 59
60void 60void
61_FreeXid(unsigned int xid) 61_free_xid(unsigned int xid)
62{ 62{
63 spin_lock(&GlobalMid_Lock); 63 spin_lock(&GlobalMid_Lock);
64 /* if (GlobalTotalActiveXid == 0) 64 /* if (GlobalTotalActiveXid == 0)
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index a4217f02fab2..da30d96a7495 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -193,7 +193,7 @@ cifs_std_info_to_fattr(struct cifs_fattr *fattr, FIND_FILE_STANDARD_INFO *info,
193 we try to do FindFirst on (NTFS) directory symlinks */ 193 we try to do FindFirst on (NTFS) directory symlinks */
194/* 194/*
195int get_symlink_reparse_path(char *full_path, struct cifs_sb_info *cifs_sb, 195int get_symlink_reparse_path(char *full_path, struct cifs_sb_info *cifs_sb,
196 int xid) 196 unsigned int xid)
197{ 197{
198 __u16 fid; 198 __u16 fid;
199 int len; 199 int len;
@@ -220,7 +220,7 @@ int get_symlink_reparse_path(char *full_path, struct cifs_sb_info *cifs_sb,
220} 220}
221 */ 221 */
222 222
223static int initiate_cifs_search(const int xid, struct file *file) 223static int initiate_cifs_search(const unsigned int xid, struct file *file)
224{ 224{
225 __u16 search_flags; 225 __u16 search_flags;
226 int rc = 0; 226 int rc = 0;
@@ -507,7 +507,7 @@ static int cifs_save_resume_key(const char *current_entry,
507 assume that they are located in the findfirst return buffer.*/ 507 assume that they are located in the findfirst return buffer.*/
508/* We start counting in the buffer with entry 2 and increment for every 508/* We start counting in the buffer with entry 2 and increment for every
509 entry (do not increment for . or .. entry) */ 509 entry (do not increment for . or .. entry) */
510static int find_cifs_entry(const int xid, struct cifs_tcon *pTcon, 510static int find_cifs_entry(const unsigned int xid, struct cifs_tcon *pTcon,
511 struct file *file, char **ppCurrentEntry, int *num_to_ret) 511 struct file *file, char **ppCurrentEntry, int *num_to_ret)
512{ 512{
513 __u16 search_flags; 513 __u16 search_flags;
@@ -721,7 +721,8 @@ static int cifs_filldir(char *find_entry, struct file *file, filldir_t filldir,
721int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) 721int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
722{ 722{
723 int rc = 0; 723 int rc = 0;
724 int xid, i; 724 unsigned int xid;
725 int i;
725 struct cifs_tcon *pTcon; 726 struct cifs_tcon *pTcon;
726 struct cifsFileInfo *cifsFile = NULL; 727 struct cifsFileInfo *cifsFile = NULL;
727 char *current_entry; 728 char *current_entry;
@@ -730,7 +731,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
730 char *end_of_smb; 731 char *end_of_smb;
731 unsigned int max_len; 732 unsigned int max_len;
732 733
733 xid = GetXid(); 734 xid = get_xid();
734 735
735 /* 736 /*
736 * Ensure FindFirst doesn't fail before doing filldir() for '.' and 737 * Ensure FindFirst doesn't fail before doing filldir() for '.' and
@@ -768,7 +769,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
768 769
769 if (file->private_data == NULL) { 770 if (file->private_data == NULL) {
770 rc = -EINVAL; 771 rc = -EINVAL;
771 FreeXid(xid); 772 free_xid(xid);
772 return rc; 773 return rc;
773 } 774 }
774 cifsFile = file->private_data; 775 cifsFile = file->private_data;
@@ -840,6 +841,6 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
840 } /* end switch */ 841 } /* end switch */
841 842
842rddir2_exit: 843rddir2_exit:
843 FreeXid(xid); 844 free_xid(xid);
844 return rc; 845 return rc;
845} 846}
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
index 10d92cf57ab6..5142f2c60278 100644
--- a/fs/cifs/xattr.c
+++ b/fs/cifs/xattr.c
@@ -39,7 +39,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
39{ 39{
40 int rc = -EOPNOTSUPP; 40 int rc = -EOPNOTSUPP;
41#ifdef CONFIG_CIFS_XATTR 41#ifdef CONFIG_CIFS_XATTR
42 int xid; 42 unsigned int xid;
43 struct cifs_sb_info *cifs_sb; 43 struct cifs_sb_info *cifs_sb;
44 struct tcon_link *tlink; 44 struct tcon_link *tlink;
45 struct cifs_tcon *pTcon; 45 struct cifs_tcon *pTcon;
@@ -60,7 +60,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
60 return PTR_ERR(tlink); 60 return PTR_ERR(tlink);
61 pTcon = tlink_tcon(tlink); 61 pTcon = tlink_tcon(tlink);
62 62
63 xid = GetXid(); 63 xid = get_xid();
64 64
65 full_path = build_path_from_dentry(direntry); 65 full_path = build_path_from_dentry(direntry);
66 if (full_path == NULL) { 66 if (full_path == NULL) {
@@ -88,7 +88,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
88 } 88 }
89remove_ea_exit: 89remove_ea_exit:
90 kfree(full_path); 90 kfree(full_path);
91 FreeXid(xid); 91 free_xid(xid);
92 cifs_put_tlink(tlink); 92 cifs_put_tlink(tlink);
93#endif 93#endif
94 return rc; 94 return rc;
@@ -99,7 +99,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
99{ 99{
100 int rc = -EOPNOTSUPP; 100 int rc = -EOPNOTSUPP;
101#ifdef CONFIG_CIFS_XATTR 101#ifdef CONFIG_CIFS_XATTR
102 int xid; 102 unsigned int xid;
103 struct cifs_sb_info *cifs_sb; 103 struct cifs_sb_info *cifs_sb;
104 struct tcon_link *tlink; 104 struct tcon_link *tlink;
105 struct cifs_tcon *pTcon; 105 struct cifs_tcon *pTcon;
@@ -120,7 +120,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
120 return PTR_ERR(tlink); 120 return PTR_ERR(tlink);
121 pTcon = tlink_tcon(tlink); 121 pTcon = tlink_tcon(tlink);
122 122
123 xid = GetXid(); 123 xid = get_xid();
124 124
125 full_path = build_path_from_dentry(direntry); 125 full_path = build_path_from_dentry(direntry);
126 if (full_path == NULL) { 126 if (full_path == NULL) {
@@ -221,7 +221,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
221 221
222set_ea_exit: 222set_ea_exit:
223 kfree(full_path); 223 kfree(full_path);
224 FreeXid(xid); 224 free_xid(xid);
225 cifs_put_tlink(tlink); 225 cifs_put_tlink(tlink);
226#endif 226#endif
227 return rc; 227 return rc;
@@ -232,7 +232,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
232{ 232{
233 ssize_t rc = -EOPNOTSUPP; 233 ssize_t rc = -EOPNOTSUPP;
234#ifdef CONFIG_CIFS_XATTR 234#ifdef CONFIG_CIFS_XATTR
235 int xid; 235 unsigned int xid;
236 struct cifs_sb_info *cifs_sb; 236 struct cifs_sb_info *cifs_sb;
237 struct tcon_link *tlink; 237 struct tcon_link *tlink;
238 struct cifs_tcon *pTcon; 238 struct cifs_tcon *pTcon;
@@ -253,7 +253,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
253 return PTR_ERR(tlink); 253 return PTR_ERR(tlink);
254 pTcon = tlink_tcon(tlink); 254 pTcon = tlink_tcon(tlink);
255 255
256 xid = GetXid(); 256 xid = get_xid();
257 257
258 full_path = build_path_from_dentry(direntry); 258 full_path = build_path_from_dentry(direntry);
259 if (full_path == NULL) { 259 if (full_path == NULL) {
@@ -355,7 +355,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
355 355
356get_ea_exit: 356get_ea_exit:
357 kfree(full_path); 357 kfree(full_path);
358 FreeXid(xid); 358 free_xid(xid);
359 cifs_put_tlink(tlink); 359 cifs_put_tlink(tlink);
360#endif 360#endif
361 return rc; 361 return rc;
@@ -365,7 +365,7 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
365{ 365{
366 ssize_t rc = -EOPNOTSUPP; 366 ssize_t rc = -EOPNOTSUPP;
367#ifdef CONFIG_CIFS_XATTR 367#ifdef CONFIG_CIFS_XATTR
368 int xid; 368 unsigned int xid;
369 struct cifs_sb_info *cifs_sb; 369 struct cifs_sb_info *cifs_sb;
370 struct tcon_link *tlink; 370 struct tcon_link *tlink;
371 struct cifs_tcon *pTcon; 371 struct cifs_tcon *pTcon;
@@ -389,7 +389,7 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
389 return PTR_ERR(tlink); 389 return PTR_ERR(tlink);
390 pTcon = tlink_tcon(tlink); 390 pTcon = tlink_tcon(tlink);
391 391
392 xid = GetXid(); 392 xid = get_xid();
393 393
394 full_path = build_path_from_dentry(direntry); 394 full_path = build_path_from_dentry(direntry);
395 if (full_path == NULL) { 395 if (full_path == NULL) {
@@ -409,7 +409,7 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
409 409
410list_ea_exit: 410list_ea_exit:
411 kfree(full_path); 411 kfree(full_path);
412 FreeXid(xid); 412 free_xid(xid);
413 cifs_put_tlink(tlink); 413 cifs_put_tlink(tlink);
414#endif 414#endif
415 return rc; 415 return rc;