提交 6d5786a3 编写于 作者: P Pavel Shilovsky 提交者: Steve French

CIFS: Rename Get/FreeXid and make them work with unsigned int

Acked-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NPavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: NSteve French <smfrench@gmail.com>
上级 2e6e02ab
...@@ -275,7 +275,8 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt) ...@@ -275,7 +275,8 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct cifs_ses *ses; struct cifs_ses *ses;
char *full_path; char *full_path;
int xid, i; unsigned int xid;
int i;
int rc; int rc;
struct vfsmount *mnt; struct vfsmount *mnt;
struct tcon_link *tlink; struct tcon_link *tlink;
...@@ -302,11 +303,11 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt) ...@@ -302,11 +303,11 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
} }
ses = tlink_tcon(tlink)->ses; ses = tlink_tcon(tlink)->ses;
xid = GetXid(); xid = get_xid();
rc = get_dfs_path(xid, ses, full_path + 1, cifs_sb->local_nls, rc = get_dfs_path(xid, ses, full_path + 1, cifs_sb->local_nls,
&num_referrals, &referrals, &num_referrals, &referrals,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
FreeXid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
......
...@@ -1153,15 +1153,16 @@ static struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb, ...@@ -1153,15 +1153,16 @@ static struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
__u16 fid, u32 *pacllen) __u16 fid, u32 *pacllen)
{ {
struct cifs_ntsd *pntsd = NULL; struct cifs_ntsd *pntsd = NULL;
int xid, rc; unsigned int xid;
int rc;
struct tcon_link *tlink = cifs_sb_tlink(cifs_sb); struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
if (IS_ERR(tlink)) if (IS_ERR(tlink))
return ERR_CAST(tlink); return ERR_CAST(tlink);
xid = GetXid(); xid = get_xid();
rc = CIFSSMBGetCIFSACL(xid, tlink_tcon(tlink), fid, &pntsd, pacllen); rc = CIFSSMBGetCIFSACL(xid, tlink_tcon(tlink), fid, &pntsd, pacllen);
FreeXid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
...@@ -1176,7 +1177,8 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb, ...@@ -1176,7 +1177,8 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
{ {
struct cifs_ntsd *pntsd = NULL; struct cifs_ntsd *pntsd = NULL;
int oplock = 0; int oplock = 0;
int xid, rc, create_options = 0; unsigned int xid;
int rc, create_options = 0;
__u16 fid; __u16 fid;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
struct tcon_link *tlink = cifs_sb_tlink(cifs_sb); 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,7 +1187,7 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
return ERR_CAST(tlink); return ERR_CAST(tlink);
tcon = tlink_tcon(tlink); tcon = tlink_tcon(tlink);
xid = GetXid(); xid = get_xid();
if (backup_cred(cifs_sb)) if (backup_cred(cifs_sb))
create_options |= CREATE_OPEN_BACKUP_INTENT; 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,7 +1201,7 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
} }
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
FreeXid(xid); free_xid(xid);
cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen); cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen);
if (rc) if (rc)
...@@ -1230,7 +1232,8 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen, ...@@ -1230,7 +1232,8 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
struct inode *inode, const char *path, int aclflag) struct inode *inode, const char *path, int aclflag)
{ {
int oplock = 0; int oplock = 0;
int xid, rc, access_flags, create_options = 0; unsigned int xid;
int rc, access_flags, create_options = 0;
__u16 fid; __u16 fid;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 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,7 +1243,7 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
return PTR_ERR(tlink); return PTR_ERR(tlink);
tcon = tlink_tcon(tlink); tcon = tlink_tcon(tlink);
xid = GetXid(); xid = get_xid();
if (backup_cred(cifs_sb)) if (backup_cred(cifs_sb))
create_options |= CREATE_OPEN_BACKUP_INTENT; create_options |= CREATE_OPEN_BACKUP_INTENT;
...@@ -1263,7 +1266,7 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen, ...@@ -1263,7 +1266,7 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
CIFSSMBClose(xid, tcon, fid); CIFSSMBClose(xid, tcon, fid);
out: out:
FreeXid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
return rc; return rc;
} }
......
...@@ -158,9 +158,9 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf) ...@@ -158,9 +158,9 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
struct cifs_sb_info *cifs_sb = CIFS_SB(sb); struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
int rc = -EOPNOTSUPP; int rc = -EOPNOTSUPP;
int xid; unsigned int xid;
xid = GetXid(); xid = get_xid();
buf->f_type = CIFS_MAGIC_NUMBER; buf->f_type = CIFS_MAGIC_NUMBER;
...@@ -197,7 +197,7 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf) ...@@ -197,7 +197,7 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
if (rc) if (rc)
rc = SMBOldQFSInfo(xid, tcon, buf); rc = SMBOldQFSInfo(xid, tcon, buf);
FreeXid(xid); free_xid(xid);
return 0; return 0;
} }
......
...@@ -37,20 +37,20 @@ extern struct smb_hdr *cifs_small_buf_get(void); ...@@ -37,20 +37,20 @@ extern struct smb_hdr *cifs_small_buf_get(void);
extern void cifs_small_buf_release(void *); extern void cifs_small_buf_release(void *);
extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *, extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
unsigned int /* length */); unsigned int /* length */);
extern unsigned int _GetXid(void); extern unsigned int _get_xid(void);
extern void _FreeXid(unsigned int); extern void _free_xid(unsigned int);
#define GetXid() \ #define get_xid() \
({ \ ({ \
int __xid = (int)_GetXid(); \ unsigned int __xid = _get_xid(); \
cFYI(1, "CIFS VFS: in %s as Xid: %d with uid: %d", \ cFYI(1, "CIFS VFS: in %s as Xid: %u with uid: %d", \
__func__, __xid, current_fsuid()); \ __func__, __xid, current_fsuid()); \
__xid; \ __xid; \
}) })
#define FreeXid(curr_xid) \ #define free_xid(curr_xid) \
do { \ do { \
_FreeXid(curr_xid); \ _free_xid(curr_xid); \
cFYI(1, "CIFS VFS: leaving %s (xid = %d) rc = %d", \ cFYI(1, "CIFS VFS: leaving %s (xid = %u) rc = %d", \
__func__, curr_xid, (int)rc); \ __func__, curr_xid, (int)rc); \
} while (0) } while (0)
extern int init_cifs_idmap(void); extern int init_cifs_idmap(void);
...@@ -123,10 +123,10 @@ extern void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock); ...@@ -123,10 +123,10 @@ extern void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock);
extern struct cifsFileInfo *cifs_new_fileinfo(__u16 fileHandle, extern struct cifsFileInfo *cifs_new_fileinfo(__u16 fileHandle,
struct file *file, struct tcon_link *tlink, struct file *file, struct tcon_link *tlink,
__u32 oplock); __u32 oplock);
extern int cifs_posix_open(char *full_path, struct inode **pinode, extern int cifs_posix_open(char *full_path, struct inode **inode,
struct super_block *sb, struct super_block *sb, int mode,
int mode, unsigned int f_flags, unsigned int f_flags, __u32 *oplock, __u16 *netfid,
__u32 *poplock, __u16 *pnetfid, int xid); unsigned int xid);
void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr); void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr);
extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr,
FILE_UNIX_BASIC_INFO *info, FILE_UNIX_BASIC_INFO *info,
...@@ -139,11 +139,12 @@ extern int cifs_get_file_info(struct file *filp); ...@@ -139,11 +139,12 @@ extern int cifs_get_file_info(struct file *filp);
extern int cifs_get_inode_info(struct inode **pinode, extern int cifs_get_inode_info(struct inode **pinode,
const unsigned char *search_path, const unsigned char *search_path,
FILE_ALL_INFO *pfile_info, FILE_ALL_INFO *pfile_info,
struct super_block *sb, int xid, const __u16 *pfid); struct super_block *sb, unsigned int xid,
const __u16 *pfid);
extern int cifs_get_file_info_unix(struct file *filp); extern int cifs_get_file_info_unix(struct file *filp);
extern int cifs_get_inode_info_unix(struct inode **pinode, extern int cifs_get_inode_info_unix(struct inode **pinode,
const unsigned char *search_path, const unsigned char *search_path,
struct super_block *sb, int xid); struct super_block *sb, unsigned int xid);
extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb,
struct cifs_fattr *fattr, struct inode *inode, struct cifs_fattr *fattr, struct inode *inode,
const char *path, const __u16 *pfid); const char *path, const __u16 *pfid);
...@@ -188,88 +189,90 @@ extern int CIFSTCon(const unsigned int xid, struct cifs_ses *ses, ...@@ -188,88 +189,90 @@ extern int CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
const char *tree, struct cifs_tcon *tcon, const char *tree, struct cifs_tcon *tcon,
const struct nls_table *); const struct nls_table *);
extern int CIFSFindFirst(const int xid, struct cifs_tcon *tcon, extern int CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon,
const char *searchName, const struct nls_table *nls_codepage, const char *searchName, const struct nls_table *nls_codepage,
__u16 *searchHandle, __u16 search_flags, __u16 *searchHandle, __u16 search_flags,
struct cifs_search_info *psrch_inf, struct cifs_search_info *psrch_inf,
int map, const char dirsep); int map, const char dirsep);
extern int CIFSFindNext(const int xid, struct cifs_tcon *tcon, extern int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
__u16 searchHandle, __u16 search_flags, __u16 searchHandle, __u16 search_flags,
struct cifs_search_info *psrch_inf); struct cifs_search_info *psrch_inf);
extern int CIFSFindClose(const int, struct cifs_tcon *tcon, extern int CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
const __u16 search_handle); const __u16 search_handle);
extern int CIFSSMBQFileInfo(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
u16 netfid, FILE_ALL_INFO *pFindData); u16 netfid, FILE_ALL_INFO *pFindData);
extern int CIFSSMBQPathInfo(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName, const unsigned char *searchName,
FILE_ALL_INFO *findData, FILE_ALL_INFO *findData,
int legacy /* whether to use old info level */, int legacy /* whether to use old info level */,
const struct nls_table *nls_codepage, int remap); const struct nls_table *nls_codepage, int remap);
extern int SMBQueryInformation(const int xid, struct cifs_tcon *tcon, extern int SMBQueryInformation(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName, const unsigned char *searchName,
FILE_ALL_INFO *findData, FILE_ALL_INFO *findData,
const struct nls_table *nls_codepage, int remap); const struct nls_table *nls_codepage, int remap);
extern int CIFSSMBUnixQFileInfo(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBUnixQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
u16 netfid, FILE_UNIX_BASIC_INFO *pFindData); u16 netfid, FILE_UNIX_BASIC_INFO *pFindData);
extern int CIFSSMBUnixQPathInfo(const int xid, extern int CIFSSMBUnixQPathInfo(const unsigned int xid,
struct cifs_tcon *tcon, struct cifs_tcon *tcon,
const unsigned char *searchName, const unsigned char *searchName,
FILE_UNIX_BASIC_INFO *pFindData, FILE_UNIX_BASIC_INFO *pFindData,
const struct nls_table *nls_codepage, int remap); const struct nls_table *nls_codepage, int remap);
extern int CIFSGetDFSRefer(const int xid, struct cifs_ses *ses, extern int CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
const unsigned char *searchName, const unsigned char *searchName,
struct dfs_info3_param **target_nodes, struct dfs_info3_param **target_nodes,
unsigned int *number_of_nodes_in_array, unsigned int *number_of_nodes_in_array,
const struct nls_table *nls_codepage, int remap); const struct nls_table *nls_codepage, int remap);
extern int get_dfs_path(int xid, struct cifs_ses *pSesInfo, extern int get_dfs_path(unsigned int xid, struct cifs_ses *pSesInfo,
const char *old_path, const char *old_path,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
unsigned int *pnum_referrals, unsigned int *pnum_referrals,
struct dfs_info3_param **preferrals, struct dfs_info3_param **preferrals,
int remap); int remap);
extern void reset_cifs_unix_caps(int xid, struct cifs_tcon *tcon, extern void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
struct cifs_sb_info *cifs_sb, struct cifs_sb_info *cifs_sb,
struct smb_vol *vol); struct smb_vol *vol);
extern int CIFSSMBQFSInfo(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
struct kstatfs *FSData); struct kstatfs *FSData);
extern int SMBOldQFSInfo(const int xid, struct cifs_tcon *tcon, extern int SMBOldQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
struct kstatfs *FSData); struct kstatfs *FSData);
extern int CIFSSMBSetFSUnixInfo(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBSetFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon,
__u64 cap); __u64 cap);
extern int CIFSSMBQFSAttributeInfo(const int xid, extern int CIFSSMBQFSAttributeInfo(const unsigned int xid,
struct cifs_tcon *tcon); struct cifs_tcon *tcon);
extern int CIFSSMBQFSDeviceInfo(const int xid, struct cifs_tcon *tcon); extern int CIFSSMBQFSDeviceInfo(const unsigned int xid, struct cifs_tcon *tcon);
extern int CIFSSMBQFSUnixInfo(const int xid, struct cifs_tcon *tcon); extern int CIFSSMBQFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon);
extern int CIFSSMBQFSPosixInfo(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBQFSPosixInfo(const unsigned int xid, struct cifs_tcon *tcon,
struct kstatfs *FSData); struct kstatfs *FSData);
extern int CIFSSMBSetPathInfo(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
const char *fileName, const FILE_BASIC_INFO *data, const char *fileName, const FILE_BASIC_INFO *data,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
const FILE_BASIC_INFO *data, __u16 fid, const FILE_BASIC_INFO *data, __u16 fid,
__u32 pid_of_opener); __u32 pid_of_opener);
extern int CIFSSMBSetFileDisposition(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBSetFileDisposition(const unsigned int xid,
bool delete_file, __u16 fid, __u32 pid_of_opener); struct cifs_tcon *tcon,
bool delete_file, __u16 fid,
__u32 pid_of_opener);
#if 0 #if 0
extern int CIFSSMBSetAttrLegacy(int xid, struct cifs_tcon *tcon, extern int CIFSSMBSetAttrLegacy(unsigned int xid, struct cifs_tcon *tcon,
char *fileName, __u16 dos_attributes, char *fileName, __u16 dos_attributes,
const struct nls_table *nls_codepage); const struct nls_table *nls_codepage);
#endif /* possibly unneeded function */ #endif /* possibly unneeded function */
extern int CIFSSMBSetEOF(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBSetEOF(const unsigned int xid, struct cifs_tcon *tcon,
const char *fileName, __u64 size, const char *fileName, __u64 size,
bool setAllocationSizeFlag, bool setAllocationSizeFlag,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int CIFSSMBSetFileSize(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon,
__u64 size, __u16 fileHandle, __u32 opener_pid, __u64 size, __u16 fileHandle, __u32 opener_pid,
bool AllocSizeFlag); bool AllocSizeFlag);
...@@ -283,108 +286,110 @@ struct cifs_unix_set_info_args { ...@@ -283,108 +286,110 @@ struct cifs_unix_set_info_args {
dev_t device; dev_t device;
}; };
extern int CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBUnixSetFileInfo(const unsigned int xid,
struct cifs_tcon *tcon,
const struct cifs_unix_set_info_args *args, const struct cifs_unix_set_info_args *args,
u16 fid, u32 pid_of_opener); u16 fid, u32 pid_of_opener);
extern int CIFSSMBUnixSetPathInfo(const int xid, struct cifs_tcon *pTcon, extern int CIFSSMBUnixSetPathInfo(const unsigned int xid,
char *fileName, struct cifs_tcon *tcon, char *file_name,
const struct cifs_unix_set_info_args *args, const struct cifs_unix_set_info_args *args,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int CIFSSMBMkDir(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon,
const char *newName, const char *newName,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int CIFSSMBRmDir(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon,
const char *name, const struct nls_table *nls_codepage, const char *name, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int CIFSPOSIXDelFile(const int xid, struct cifs_tcon *tcon, extern int CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon,
const char *name, __u16 type, const char *name, __u16 type,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int CIFSSMBDelFile(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon,
const char *name, const char *name,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int CIFSSMBRename(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon,
const char *fromName, const char *toName, const char *fromName, const char *toName,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int CIFSSMBRenameOpenFile(const int xid, struct cifs_tcon *pTcon, extern int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *tcon,
int netfid, const char *target_name, int netfid, const char *target_name,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int CIFSCreateHardLink(const int xid, extern int CIFSCreateHardLink(const unsigned int xid,
struct cifs_tcon *tcon, struct cifs_tcon *tcon,
const char *fromName, const char *toName, const char *fromName, const char *toName,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int CIFSUnixCreateHardLink(const int xid, extern int CIFSUnixCreateHardLink(const unsigned int xid,
struct cifs_tcon *tcon, struct cifs_tcon *tcon,
const char *fromName, const char *toName, const char *fromName, const char *toName,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int CIFSUnixCreateSymLink(const int xid, extern int CIFSUnixCreateSymLink(const unsigned int xid,
struct cifs_tcon *tcon, struct cifs_tcon *tcon,
const char *fromName, const char *toName, const char *fromName, const char *toName,
const struct nls_table *nls_codepage); const struct nls_table *nls_codepage);
extern int CIFSSMBUnixQuerySymLink(const int xid, extern int CIFSSMBUnixQuerySymLink(const unsigned int xid,
struct cifs_tcon *tcon, struct cifs_tcon *tcon,
const unsigned char *searchName, char **syminfo, const unsigned char *searchName, char **syminfo,
const struct nls_table *nls_codepage); const struct nls_table *nls_codepage);
#ifdef CONFIG_CIFS_SYMLINK_EXPERIMENTAL #ifdef CONFIG_CIFS_SYMLINK_EXPERIMENTAL
extern int CIFSSMBQueryReparseLinkInfo(const int xid, extern int CIFSSMBQueryReparseLinkInfo(const unsigned int xid,
struct cifs_tcon *tcon, struct cifs_tcon *tcon,
const unsigned char *searchName, const unsigned char *searchName,
char *symlinkinfo, const int buflen, __u16 fid, char *symlinkinfo, const int buflen, __u16 fid,
const struct nls_table *nls_codepage); const struct nls_table *nls_codepage);
#endif /* temporarily unused until cifs_symlink fixed */ #endif /* temporarily unused until cifs_symlink fixed */
extern int CIFSSMBOpen(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBOpen(const unsigned int xid, struct cifs_tcon *tcon,
const char *fileName, const int disposition, const char *fileName, const int disposition,
const int access_flags, const int omode, const int access_flags, const int omode,
__u16 *netfid, int *pOplock, FILE_ALL_INFO *, __u16 *netfid, int *pOplock, FILE_ALL_INFO *,
const struct nls_table *nls_codepage, int remap); const struct nls_table *nls_codepage, int remap);
extern int SMBLegacyOpen(const int xid, struct cifs_tcon *tcon, extern int SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon,
const char *fileName, const int disposition, const char *fileName, const int disposition,
const int access_flags, const int omode, const int access_flags, const int omode,
__u16 *netfid, int *pOplock, FILE_ALL_INFO *, __u16 *netfid, int *pOplock, FILE_ALL_INFO *,
const struct nls_table *nls_codepage, int remap); const struct nls_table *nls_codepage, int remap);
extern int CIFSPOSIXCreate(const int xid, struct cifs_tcon *tcon, extern int CIFSPOSIXCreate(const unsigned int xid, struct cifs_tcon *tcon,
u32 posix_flags, __u64 mode, __u16 *netfid, u32 posix_flags, __u64 mode, __u16 *netfid,
FILE_UNIX_BASIC_INFO *pRetData, FILE_UNIX_BASIC_INFO *pRetData,
__u32 *pOplock, const char *name, __u32 *pOplock, const char *name,
const struct nls_table *nls_codepage, int remap); const struct nls_table *nls_codepage, int remap);
extern int CIFSSMBClose(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon,
const int smb_file_id); const int smb_file_id);
extern int CIFSSMBFlush(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon,
const int smb_file_id); const int smb_file_id);
extern int CIFSSMBRead(const int xid, struct cifs_io_parms *io_parms, extern int CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
unsigned int *nbytes, char **buf, unsigned int *nbytes, char **buf,
int *return_buf_type); int *return_buf_type);
extern int CIFSSMBWrite(const int xid, struct cifs_io_parms *io_parms, extern int CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
unsigned int *nbytes, const char *buf, unsigned int *nbytes, const char *buf,
const char __user *ubuf, const int long_op); const char __user *ubuf, const int long_op);
extern int CIFSSMBWrite2(const int xid, struct cifs_io_parms *io_parms, extern int CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
unsigned int *nbytes, struct kvec *iov, const int nvec, unsigned int *nbytes, struct kvec *iov, const int nvec,
const int long_op); const int long_op);
extern int CIFSGetSrvInodeNumber(const int xid, struct cifs_tcon *tcon, extern int CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName, __u64 *inode_number, const unsigned char *searchName, __u64 *inode_number,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int cifs_lockv(const int xid, struct cifs_tcon *tcon, const __u16 netfid, extern int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
const __u8 lock_type, const __u32 num_unlock, const __u16 netfid, const __u8 lock_type,
const __u32 num_lock, LOCKING_ANDX_RANGE *buf); const __u32 num_unlock, const __u32 num_lock,
extern int CIFSSMBLock(const int xid, struct cifs_tcon *tcon, LOCKING_ANDX_RANGE *buf);
extern int CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
const __u16 netfid, const __u32 netpid, const __u64 len, const __u16 netfid, const __u32 netpid, const __u64 len,
const __u64 offset, const __u32 numUnlock, const __u64 offset, const __u32 numUnlock,
const __u32 numLock, const __u8 lockType, const __u32 numLock, const __u8 lockType,
const bool waitFlag, const __u8 oplock_level); const bool waitFlag, const __u8 oplock_level);
extern int CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
const __u16 smb_file_id, const __u32 netpid, const __u16 smb_file_id, const __u32 netpid,
const loff_t start_offset, const __u64 len, const loff_t start_offset, const __u64 len,
struct file_lock *, const __u16 lock_type, struct file_lock *, const __u16 lock_type,
...@@ -417,46 +422,46 @@ extern int calc_lanman_hash(const char *password, const char *cryptkey, ...@@ -417,46 +422,46 @@ extern int calc_lanman_hash(const char *password, const char *cryptkey,
bool encrypt, char *lnm_session_key); bool encrypt, char *lnm_session_key);
#endif /* CIFS_WEAK_PW_HASH */ #endif /* CIFS_WEAK_PW_HASH */
#ifdef CONFIG_CIFS_DNOTIFY_EXPERIMENTAL /* unused temporarily */ #ifdef CONFIG_CIFS_DNOTIFY_EXPERIMENTAL /* unused temporarily */
extern int CIFSSMBNotify(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBNotify(const unsigned int xid, struct cifs_tcon *tcon,
const int notify_subdirs, const __u16 netfid, const int notify_subdirs, const __u16 netfid,
__u32 filter, struct file *file, int multishot, __u32 filter, struct file *file, int multishot,
const struct nls_table *nls_codepage); const struct nls_table *nls_codepage);
#endif /* was needed for dnotify, and will be needed for inotify when VFS fix */ #endif /* was needed for dnotify, and will be needed for inotify when VFS fix */
extern int CIFSSMBCopy(int xid, extern int CIFSSMBCopy(unsigned int xid,
struct cifs_tcon *source_tcon, struct cifs_tcon *source_tcon,
const char *fromName, const char *fromName,
const __u16 target_tid, const __u16 target_tid,
const char *toName, const int flags, const char *toName, const int flags,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern ssize_t CIFSSMBQAllEAs(const int xid, struct cifs_tcon *tcon, extern ssize_t CIFSSMBQAllEAs(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName, const unsigned char *searchName,
const unsigned char *ea_name, char *EAData, const unsigned char *ea_name, char *EAData,
size_t bufsize, const struct nls_table *nls_codepage, size_t bufsize, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int CIFSSMBSetEA(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
const char *fileName, const char *ea_name, const char *fileName, const char *ea_name,
const void *ea_value, const __u16 ea_value_len, const void *ea_value, const __u16 ea_value_len,
const struct nls_table *nls_codepage, int remap_special_chars); const struct nls_table *nls_codepage, int remap_special_chars);
extern int CIFSSMBGetCIFSACL(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon,
__u16 fid, struct cifs_ntsd **acl_inf, __u32 *buflen); __u16 fid, struct cifs_ntsd **acl_inf, __u32 *buflen);
extern int CIFSSMBSetCIFSACL(const int, struct cifs_tcon *, __u16, extern int CIFSSMBSetCIFSACL(const unsigned int, struct cifs_tcon *, __u16,
struct cifs_ntsd *, __u32, int); struct cifs_ntsd *, __u32, int);
extern int CIFSSMBGetPosixACL(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBGetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName, const unsigned char *searchName,
char *acl_inf, const int buflen, const int acl_type, char *acl_inf, const int buflen, const int acl_type,
const struct nls_table *nls_codepage, int remap_special_chars); const struct nls_table *nls_codepage, int remap_special_chars);
extern int CIFSSMBSetPosixACL(const int xid, struct cifs_tcon *tcon, extern int CIFSSMBSetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *fileName, const unsigned char *fileName,
const char *local_acl, const int buflen, const int acl_type, const char *local_acl, const int buflen, const int acl_type,
const struct nls_table *nls_codepage, int remap_special_chars); const struct nls_table *nls_codepage, int remap_special_chars);
extern int CIFSGetExtAttr(const int xid, struct cifs_tcon *tcon, extern int CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
const int netfid, __u64 *pExtAttrBits, __u64 *pMask); const int netfid, __u64 *pExtAttrBits, __u64 *pMask);
extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb); extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb);
extern bool CIFSCouldBeMFSymlink(const struct cifs_fattr *fattr); extern bool CIFSCouldBeMFSymlink(const struct cifs_fattr *fattr);
extern int CIFSCheckMFSymlink(struct cifs_fattr *fattr, extern int CIFSCheckMFSymlink(struct cifs_fattr *fattr,
const unsigned char *path, const unsigned char *path,
struct cifs_sb_info *cifs_sb, int xid); struct cifs_sb_info *cifs_sb, unsigned int xid);
extern int mdfour(unsigned char *, unsigned char *, int); extern int mdfour(unsigned char *, unsigned char *, int);
extern int E_md4hash(const unsigned char *passwd, unsigned char *p16, extern int E_md4hash(const unsigned char *passwd, unsigned char *p16,
const struct nls_table *codepage); const struct nls_table *codepage);
......
此差异已折叠。
...@@ -2267,9 +2267,9 @@ cifs_put_smb_ses(struct cifs_ses *ses) ...@@ -2267,9 +2267,9 @@ cifs_put_smb_ses(struct cifs_ses *ses)
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
if (ses->status == CifsGood && server->ops->logoff) { if (ses->status == CifsGood && server->ops->logoff) {
xid = GetXid(); xid = get_xid();
server->ops->logoff(xid, ses); server->ops->logoff(xid, ses);
_FreeXid(xid); _free_xid(xid);
} }
sesInfoFree(ses); sesInfoFree(ses);
cifs_put_tcp_session(server); cifs_put_tcp_session(server);
...@@ -2412,7 +2412,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) ...@@ -2412,7 +2412,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
struct sockaddr_in *addr = (struct sockaddr_in *)&server->dstaddr; struct sockaddr_in *addr = (struct sockaddr_in *)&server->dstaddr;
struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&server->dstaddr; struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&server->dstaddr;
xid = GetXid(); xid = get_xid();
ses = cifs_find_smb_ses(server, volume_info); ses = cifs_find_smb_ses(server, volume_info);
if (ses) { if (ses) {
...@@ -2424,7 +2424,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) ...@@ -2424,7 +2424,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
mutex_unlock(&ses->session_mutex); mutex_unlock(&ses->session_mutex);
/* problem -- put our ses reference */ /* problem -- put our ses reference */
cifs_put_smb_ses(ses); cifs_put_smb_ses(ses);
FreeXid(xid); free_xid(xid);
return ERR_PTR(rc); return ERR_PTR(rc);
} }
if (ses->need_reconnect) { if (ses->need_reconnect) {
...@@ -2435,7 +2435,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) ...@@ -2435,7 +2435,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
mutex_unlock(&ses->session_mutex); mutex_unlock(&ses->session_mutex);
/* problem -- put our reference */ /* problem -- put our reference */
cifs_put_smb_ses(ses); cifs_put_smb_ses(ses);
FreeXid(xid); free_xid(xid);
return ERR_PTR(rc); return ERR_PTR(rc);
} }
} }
...@@ -2443,7 +2443,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) ...@@ -2443,7 +2443,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
/* existing SMB ses has a server reference already */ /* existing SMB ses has a server reference already */
cifs_put_tcp_session(server); cifs_put_tcp_session(server);
FreeXid(xid); free_xid(xid);
return ses; return ses;
} }
...@@ -2502,12 +2502,12 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) ...@@ -2502,12 +2502,12 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
list_add(&ses->smb_ses_list, &server->smb_ses_list); list_add(&ses->smb_ses_list, &server->smb_ses_list);
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
FreeXid(xid); free_xid(xid);
return ses; return ses;
get_ses_fail: get_ses_fail:
sesInfoFree(ses); sesInfoFree(ses);
FreeXid(xid); free_xid(xid);
return ERR_PTR(rc); return ERR_PTR(rc);
} }
...@@ -2555,10 +2555,10 @@ cifs_put_tcon(struct cifs_tcon *tcon) ...@@ -2555,10 +2555,10 @@ cifs_put_tcon(struct cifs_tcon *tcon)
list_del_init(&tcon->tcon_list); list_del_init(&tcon->tcon_list);
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
xid = GetXid(); xid = get_xid();
if (ses->server->ops->tree_disconnect) if (ses->server->ops->tree_disconnect)
ses->server->ops->tree_disconnect(xid, tcon); ses->server->ops->tree_disconnect(xid, tcon);
_FreeXid(xid); _free_xid(xid);
cifs_fscache_release_super_cookie(tcon); cifs_fscache_release_super_cookie(tcon);
tconInfoFree(tcon); tconInfoFree(tcon);
...@@ -2613,10 +2613,10 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info) ...@@ -2613,10 +2613,10 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
* BB Do we need to wrap session_mutex around this TCon call and Unix * BB Do we need to wrap session_mutex around this TCon call and Unix
* SetFS as we do on SessSetup and reconnect? * SetFS as we do on SessSetup and reconnect?
*/ */
xid = GetXid(); xid = get_xid();
rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon, rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon,
volume_info->local_nls); volume_info->local_nls);
FreeXid(xid); free_xid(xid);
cFYI(1, "Tcon rc = %d", rc); cFYI(1, "Tcon rc = %d", rc);
if (rc) if (rc)
goto out_fail; goto out_fail;
...@@ -2764,7 +2764,7 @@ cifs_match_super(struct super_block *sb, void *data) ...@@ -2764,7 +2764,7 @@ cifs_match_super(struct super_block *sb, void *data)
} }
int int
get_dfs_path(int xid, struct cifs_ses *ses, const char *old_path, get_dfs_path(unsigned int xid, struct cifs_ses *ses, const char *old_path,
const struct nls_table *nls_codepage, unsigned int *num_referrals, const struct nls_table *nls_codepage, unsigned int *num_referrals,
struct dfs_info3_param **referrals, int remap) struct dfs_info3_param **referrals, int remap)
{ {
...@@ -3067,7 +3067,7 @@ ip_connect(struct TCP_Server_Info *server) ...@@ -3067,7 +3067,7 @@ ip_connect(struct TCP_Server_Info *server)
return generic_ip_connect(server); return generic_ip_connect(server);
} }
void reset_cifs_unix_caps(int xid, struct cifs_tcon *tcon, void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
struct cifs_sb_info *cifs_sb, struct smb_vol *vol_info) struct cifs_sb_info *cifs_sb, struct smb_vol *vol_info)
{ {
/* if we are reconnecting then should we check to see if /* 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,7 +3399,7 @@ cifs_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info)
} }
static int static int
is_path_accessible(int xid, struct cifs_tcon *tcon, is_path_accessible(unsigned int xid, struct cifs_tcon *tcon,
struct cifs_sb_info *cifs_sb, const char *full_path) struct cifs_sb_info *cifs_sb, const char *full_path)
{ {
int rc; int rc;
...@@ -3485,7 +3485,7 @@ build_unc_path_to_root(const struct smb_vol *vol, ...@@ -3485,7 +3485,7 @@ build_unc_path_to_root(const struct smb_vol *vol,
* determine whether there were referrals. * determine whether there were referrals.
*/ */
static int static int
expand_dfs_referral(int xid, struct cifs_ses *pSesInfo, expand_dfs_referral(unsigned int xid, struct cifs_ses *pSesInfo,
struct smb_vol *volume_info, struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info, struct cifs_sb_info *cifs_sb,
int check_prefix) int check_prefix)
{ {
...@@ -3595,7 +3595,7 @@ int ...@@ -3595,7 +3595,7 @@ int
cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info) cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
{ {
int rc; int rc;
int xid; unsigned int xid;
struct cifs_ses *pSesInfo; struct cifs_ses *pSesInfo;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
struct TCP_Server_Info *srvTcp; struct TCP_Server_Info *srvTcp;
...@@ -3618,7 +3618,7 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info) ...@@ -3618,7 +3618,7 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
else if (pSesInfo) else if (pSesInfo)
cifs_put_smb_ses(pSesInfo); cifs_put_smb_ses(pSesInfo);
FreeXid(xid); free_xid(xid);
} }
#endif #endif
rc = 0; rc = 0;
...@@ -3628,7 +3628,7 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info) ...@@ -3628,7 +3628,7 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
full_path = NULL; full_path = NULL;
tlink = NULL; tlink = NULL;
xid = GetXid(); xid = get_xid();
/* get a reference to a tcp session */ /* get a reference to a tcp session */
srvTcp = cifs_get_tcp_session(volume_info); srvTcp = cifs_get_tcp_session(volume_info);
...@@ -3781,7 +3781,7 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info) ...@@ -3781,7 +3781,7 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
} }
out: out:
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
......
...@@ -157,10 +157,10 @@ check_name(struct dentry *direntry) ...@@ -157,10 +157,10 @@ check_name(struct dentry *direntry)
/* Inode operations in similar order to how they appear in Linux file fs.h */ /* Inode operations in similar order to how they appear in Linux file fs.h */
static int cifs_do_create(struct inode *inode, struct dentry *direntry, static int
int xid, struct tcon_link *tlink, unsigned oflags, cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
umode_t mode, __u32 *oplock, __u16 *fileHandle, struct tcon_link *tlink, unsigned oflags, umode_t mode,
int *created) __u32 *oplock, __u16 *fileHandle, int *created)
{ {
int rc = -ENOENT; int rc = -ENOENT;
int create_options = CREATE_NOT_DIR; int create_options = CREATE_NOT_DIR;
...@@ -382,7 +382,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry, ...@@ -382,7 +382,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
int *opened) int *opened)
{ {
int rc; int rc;
int xid; unsigned int xid;
struct tcon_link *tlink; struct tcon_link *tlink;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
__u16 fileHandle; __u16 fileHandle;
...@@ -412,7 +412,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry, ...@@ -412,7 +412,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
if (rc) if (rc)
return rc; return rc;
xid = GetXid(); xid = get_xid();
cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p",
inode, direntry->d_name.name, direntry); inode, direntry->d_name.name, direntry);
...@@ -420,7 +420,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry, ...@@ -420,7 +420,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
filp = ERR_CAST(tlink); filp = ERR_CAST(tlink);
if (IS_ERR(tlink)) if (IS_ERR(tlink))
goto free_xid; goto out_free_xid;
tcon = tlink_tcon(tlink); tcon = tlink_tcon(tlink);
...@@ -445,8 +445,8 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry, ...@@ -445,8 +445,8 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
out: out:
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
free_xid: out_free_xid:
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -454,7 +454,7 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode, ...@@ -454,7 +454,7 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
bool excl) bool excl)
{ {
int rc; int rc;
int xid = GetXid(); unsigned int xid = get_xid();
/* /*
* BB below access is probably too much for mknod to request * BB below access is probably too much for mknod to request
* but we have to do query and setpathinfo so requesting * 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,7 +474,7 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
rc = PTR_ERR(tlink); rc = PTR_ERR(tlink);
if (IS_ERR(tlink)) if (IS_ERR(tlink))
goto free_xid; goto out_free_xid;
rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode,
&oplock, &fileHandle, &created); &oplock, &fileHandle, &created);
...@@ -482,9 +482,8 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode, ...@@ -482,9 +482,8 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
CIFSSMBClose(xid, tlink_tcon(tlink), fileHandle); CIFSSMBClose(xid, tlink_tcon(tlink), fileHandle);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
free_xid: out_free_xid:
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -492,7 +491,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, ...@@ -492,7 +491,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
dev_t device_number) dev_t device_number)
{ {
int rc = -EPERM; int rc = -EPERM;
int xid; unsigned int xid;
int create_options = CREATE_NOT_DIR | CREATE_OPTION_SPECIAL; int create_options = CREATE_NOT_DIR | CREATE_OPTION_SPECIAL;
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct tcon_link *tlink; struct tcon_link *tlink;
...@@ -516,7 +515,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, ...@@ -516,7 +515,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
pTcon = tlink_tcon(tlink); pTcon = tlink_tcon(tlink);
xid = GetXid(); xid = get_xid();
full_path = build_path_from_dentry(direntry); full_path = build_path_from_dentry(direntry);
if (full_path == NULL) { if (full_path == NULL) {
...@@ -564,7 +563,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, ...@@ -564,7 +563,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
if (buf == NULL) { if (buf == NULL) {
kfree(full_path); kfree(full_path);
rc = -ENOMEM; rc = -ENOMEM;
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -614,7 +613,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, ...@@ -614,7 +613,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
mknod_out: mknod_out:
kfree(full_path); kfree(full_path);
kfree(buf); kfree(buf);
FreeXid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
return rc; return rc;
} }
...@@ -623,7 +622,7 @@ struct dentry * ...@@ -623,7 +622,7 @@ struct dentry *
cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
unsigned int flags) unsigned int flags)
{ {
int xid; unsigned int xid;
int rc = 0; /* to get around spurious gcc warning, set to zero here */ int rc = 0; /* to get around spurious gcc warning, set to zero here */
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct tcon_link *tlink; struct tcon_link *tlink;
...@@ -631,7 +630,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, ...@@ -631,7 +630,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
struct inode *newInode = NULL; struct inode *newInode = NULL;
char *full_path = NULL; char *full_path = NULL;
xid = GetXid(); xid = get_xid();
cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p",
parent_dir_inode, direntry->d_name.name, direntry); parent_dir_inode, direntry->d_name.name, direntry);
...@@ -641,7 +640,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, ...@@ -641,7 +640,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
cifs_sb = CIFS_SB(parent_dir_inode->i_sb); cifs_sb = CIFS_SB(parent_dir_inode->i_sb);
tlink = cifs_sb_tlink(cifs_sb); tlink = cifs_sb_tlink(cifs_sb);
if (IS_ERR(tlink)) { if (IS_ERR(tlink)) {
FreeXid(xid); free_xid(xid);
return (struct dentry *)tlink; return (struct dentry *)tlink;
} }
pTcon = tlink_tcon(tlink); pTcon = tlink_tcon(tlink);
...@@ -695,7 +694,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, ...@@ -695,7 +694,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
lookup_out: lookup_out:
kfree(full_path); kfree(full_path);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
FreeXid(xid); free_xid(xid);
return ERR_PTR(rc); return ERR_PTR(rc);
} }
......
...@@ -107,7 +107,7 @@ static inline int cifs_get_disposition(unsigned int flags) ...@@ -107,7 +107,7 @@ static inline int cifs_get_disposition(unsigned int flags)
int cifs_posix_open(char *full_path, struct inode **pinode, int cifs_posix_open(char *full_path, struct inode **pinode,
struct super_block *sb, int mode, unsigned int f_flags, struct super_block *sb, int mode, unsigned int f_flags,
__u32 *poplock, __u16 *pnetfid, int xid) __u32 *poplock, __u16 *pnetfid, unsigned int xid)
{ {
int rc; int rc;
FILE_UNIX_BASIC_INFO *presp_data; FILE_UNIX_BASIC_INFO *presp_data;
...@@ -170,7 +170,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode, ...@@ -170,7 +170,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
static int static int
cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb, cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb,
struct cifs_tcon *tcon, unsigned int f_flags, __u32 *poplock, struct cifs_tcon *tcon, unsigned int f_flags, __u32 *poplock,
__u16 *pnetfid, int xid) __u16 *pnetfid, unsigned int xid)
{ {
int rc; int rc;
int desiredAccess; int desiredAccess;
...@@ -324,11 +324,11 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file) ...@@ -324,11 +324,11 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
cancel_work_sync(&cifs_file->oplock_break); cancel_work_sync(&cifs_file->oplock_break);
if (!tcon->need_reconnect && !cifs_file->invalidHandle) { if (!tcon->need_reconnect && !cifs_file->invalidHandle) {
int xid, rc; unsigned int xid;
int rc;
xid = GetXid(); xid = get_xid();
rc = CIFSSMBClose(xid, tcon, cifs_file->netfid); rc = CIFSSMBClose(xid, tcon, cifs_file->netfid);
FreeXid(xid); free_xid(xid);
} }
/* Delete any outstanding lock records. We'll lose them when the file /* Delete any outstanding lock records. We'll lose them when the file
...@@ -350,7 +350,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file) ...@@ -350,7 +350,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
int cifs_open(struct inode *inode, struct file *file) int cifs_open(struct inode *inode, struct file *file)
{ {
int rc = -EACCES; int rc = -EACCES;
int xid; unsigned int xid;
__u32 oplock; __u32 oplock;
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
...@@ -360,12 +360,12 @@ int cifs_open(struct inode *inode, struct file *file) ...@@ -360,12 +360,12 @@ int cifs_open(struct inode *inode, struct file *file)
bool posix_open_ok = false; bool posix_open_ok = false;
__u16 netfid; __u16 netfid;
xid = GetXid(); xid = get_xid();
cifs_sb = CIFS_SB(inode->i_sb); cifs_sb = CIFS_SB(inode->i_sb);
tlink = cifs_sb_tlink(cifs_sb); tlink = cifs_sb_tlink(cifs_sb);
if (IS_ERR(tlink)) { if (IS_ERR(tlink)) {
FreeXid(xid); free_xid(xid);
return PTR_ERR(tlink); return PTR_ERR(tlink);
} }
tcon = tlink_tcon(tlink); tcon = tlink_tcon(tlink);
...@@ -445,7 +445,7 @@ int cifs_open(struct inode *inode, struct file *file) ...@@ -445,7 +445,7 @@ int cifs_open(struct inode *inode, struct file *file)
out: out:
kfree(full_path); kfree(full_path);
FreeXid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
return rc; return rc;
} }
...@@ -464,7 +464,7 @@ static int cifs_relock_file(struct cifsFileInfo *cifsFile) ...@@ -464,7 +464,7 @@ static int cifs_relock_file(struct cifsFileInfo *cifsFile)
static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush) static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush)
{ {
int rc = -EACCES; int rc = -EACCES;
int xid; unsigned int xid;
__u32 oplock; __u32 oplock;
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
...@@ -476,12 +476,12 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush) ...@@ -476,12 +476,12 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush)
int create_options = CREATE_NOT_DIR; int create_options = CREATE_NOT_DIR;
__u16 netfid; __u16 netfid;
xid = GetXid(); xid = get_xid();
mutex_lock(&pCifsFile->fh_mutex); mutex_lock(&pCifsFile->fh_mutex);
if (!pCifsFile->invalidHandle) { if (!pCifsFile->invalidHandle) {
mutex_unlock(&pCifsFile->fh_mutex); mutex_unlock(&pCifsFile->fh_mutex);
rc = 0; rc = 0;
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -497,7 +497,7 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush) ...@@ -497,7 +497,7 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush)
if (full_path == NULL) { if (full_path == NULL) {
rc = -ENOMEM; rc = -ENOMEM;
mutex_unlock(&pCifsFile->fh_mutex); mutex_unlock(&pCifsFile->fh_mutex);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -583,7 +583,7 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush) ...@@ -583,7 +583,7 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush)
reopen_error_exit: reopen_error_exit:
kfree(full_path); kfree(full_path);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -601,13 +601,13 @@ int cifs_close(struct inode *inode, struct file *file) ...@@ -601,13 +601,13 @@ int cifs_close(struct inode *inode, struct file *file)
int cifs_closedir(struct inode *inode, struct file *file) int cifs_closedir(struct inode *inode, struct file *file)
{ {
int rc = 0; int rc = 0;
int xid; unsigned int xid;
struct cifsFileInfo *pCFileStruct = file->private_data; struct cifsFileInfo *pCFileStruct = file->private_data;
char *ptmp; char *ptmp;
cFYI(1, "Closedir inode = 0x%p", inode); cFYI(1, "Closedir inode = 0x%p", inode);
xid = GetXid(); xid = get_xid();
if (pCFileStruct) { if (pCFileStruct) {
struct cifs_tcon *pTcon = tlink_tcon(pCFileStruct->tlink); struct cifs_tcon *pTcon = tlink_tcon(pCFileStruct->tlink);
...@@ -639,7 +639,7 @@ int cifs_closedir(struct inode *inode, struct file *file) ...@@ -639,7 +639,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
file->private_data = NULL; file->private_data = NULL;
} }
/* BB can we lock the filestruct while this is going on? */ /* BB can we lock the filestruct while this is going on? */
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -872,7 +872,8 @@ cifs_posix_lock_set(struct file *file, struct file_lock *flock) ...@@ -872,7 +872,8 @@ cifs_posix_lock_set(struct file *file, struct file_lock *flock)
static int static int
cifs_push_mandatory_locks(struct cifsFileInfo *cfile) cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
{ {
int xid, rc = 0, stored_rc; unsigned int xid;
int rc = 0, stored_rc;
struct cifsLockInfo *li, *tmp; struct cifsLockInfo *li, *tmp;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode);
...@@ -882,13 +883,13 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) ...@@ -882,13 +883,13 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
LOCKING_ANDX_SHARED_LOCK | LOCKING_ANDX_LARGE_FILES}; LOCKING_ANDX_SHARED_LOCK | LOCKING_ANDX_LARGE_FILES};
int i; int i;
xid = GetXid(); xid = get_xid();
tcon = tlink_tcon(cfile->tlink); tcon = tlink_tcon(cfile->tlink);
mutex_lock(&cinode->lock_mutex); mutex_lock(&cinode->lock_mutex);
if (!cinode->can_cache_brlcks) { if (!cinode->can_cache_brlcks) {
mutex_unlock(&cinode->lock_mutex); mutex_unlock(&cinode->lock_mutex);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -899,7 +900,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) ...@@ -899,7 +900,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
max_buf = tcon->ses->server->maxBuf; max_buf = tcon->ses->server->maxBuf;
if (!max_buf) { if (!max_buf) {
mutex_unlock(&cinode->lock_mutex); mutex_unlock(&cinode->lock_mutex);
FreeXid(xid); free_xid(xid);
return -EINVAL; return -EINVAL;
} }
...@@ -908,7 +909,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) ...@@ -908,7 +909,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL);
if (!buf) { if (!buf) {
mutex_unlock(&cinode->lock_mutex); mutex_unlock(&cinode->lock_mutex);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -947,7 +948,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) ...@@ -947,7 +948,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
mutex_unlock(&cinode->lock_mutex); mutex_unlock(&cinode->lock_mutex);
kfree(buf); kfree(buf);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -977,12 +978,12 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile) ...@@ -977,12 +978,12 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile)
struct lock_to_push *lck, *tmp; struct lock_to_push *lck, *tmp;
__u64 length; __u64 length;
xid = GetXid(); xid = get_xid();
mutex_lock(&cinode->lock_mutex); mutex_lock(&cinode->lock_mutex);
if (!cinode->can_cache_brlcks) { if (!cinode->can_cache_brlcks) {
mutex_unlock(&cinode->lock_mutex); mutex_unlock(&cinode->lock_mutex);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -1054,7 +1055,7 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile) ...@@ -1054,7 +1055,7 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile)
cinode->can_cache_brlcks = false; cinode->can_cache_brlcks = false;
mutex_unlock(&cinode->lock_mutex); mutex_unlock(&cinode->lock_mutex);
FreeXid(xid); free_xid(xid);
return rc; return rc;
err_out: err_out:
list_for_each_entry_safe(lck, tmp, &locks_to_send, llist) { 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,7 +1127,7 @@ cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock,
} }
static int static int
cifs_mandatory_lock(int xid, struct cifsFileInfo *cfile, __u64 offset, cifs_mandatory_lock(unsigned int xid, struct cifsFileInfo *cfile, __u64 offset,
__u64 length, __u32 type, int lock, int unlock, bool wait) __u64 length, __u32 type, int lock, int unlock, bool wait)
{ {
return CIFSSMBLock(xid, tlink_tcon(cfile->tlink), cfile->netfid, return CIFSSMBLock(xid, tlink_tcon(cfile->tlink), cfile->netfid,
...@@ -1136,7 +1137,7 @@ cifs_mandatory_lock(int xid, struct cifsFileInfo *cfile, __u64 offset, ...@@ -1136,7 +1137,7 @@ cifs_mandatory_lock(int xid, struct cifsFileInfo *cfile, __u64 offset,
static int static int
cifs_getlk(struct file *file, struct file_lock *flock, __u32 type, cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
bool wait_flag, bool posix_lck, int xid) bool wait_flag, bool posix_lck, unsigned int xid)
{ {
int rc = 0; int rc = 0;
__u64 length = 1 + flock->fl_end - flock->fl_start; __u64 length = 1 + flock->fl_end - flock->fl_start;
...@@ -1221,7 +1222,8 @@ cifs_free_llist(struct list_head *llist) ...@@ -1221,7 +1222,8 @@ cifs_free_llist(struct list_head *llist)
} }
static int static int
cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, int xid) cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,
unsigned int xid)
{ {
int rc = 0, stored_rc; int rc = 0, stored_rc;
int types[] = {LOCKING_ANDX_LARGE_FILES, int types[] = {LOCKING_ANDX_LARGE_FILES,
...@@ -1326,7 +1328,8 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, int xid) ...@@ -1326,7 +1328,8 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, int xid)
static int static int
cifs_setlk(struct file *file, struct file_lock *flock, __u32 type, cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
bool wait_flag, bool posix_lck, int lock, int unlock, int xid) bool wait_flag, bool posix_lck, int lock, int unlock,
unsigned int xid)
{ {
int rc = 0; int rc = 0;
__u64 length = 1 + flock->fl_end - flock->fl_start; __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,7 +1403,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
__u32 type; __u32 type;
rc = -EACCES; rc = -EACCES;
xid = GetXid(); xid = get_xid();
cFYI(1, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld " cFYI(1, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld "
"end: %lld", cmd, flock->fl_flags, flock->fl_type, "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,7 +1429,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
*/ */
if (IS_GETLK(cmd)) { if (IS_GETLK(cmd)) {
rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid); rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -1435,13 +1438,13 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock) ...@@ -1435,13 +1438,13 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
* if no lock or unlock then nothing to do since we do not * if no lock or unlock then nothing to do since we do not
* know what it is * know what it is
*/ */
FreeXid(xid); free_xid(xid);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock, rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock,
xid); xid);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -1468,7 +1471,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid, ...@@ -1468,7 +1471,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid,
unsigned int total_written; unsigned int total_written;
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct cifs_tcon *pTcon; struct cifs_tcon *pTcon;
int xid; unsigned int xid;
struct dentry *dentry = open_file->dentry; struct dentry *dentry = open_file->dentry;
struct cifsInodeInfo *cifsi = CIFS_I(dentry->d_inode); struct cifsInodeInfo *cifsi = CIFS_I(dentry->d_inode);
struct cifs_io_parms io_parms; struct cifs_io_parms io_parms;
...@@ -1480,7 +1483,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid, ...@@ -1480,7 +1483,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid,
pTcon = tlink_tcon(open_file->tlink); pTcon = tlink_tcon(open_file->tlink);
xid = GetXid(); xid = get_xid();
for (total_written = 0; write_size > total_written; for (total_written = 0; write_size > total_written;
total_written += bytes_written) { total_written += bytes_written) {
...@@ -1516,7 +1519,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid, ...@@ -1516,7 +1519,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid,
if (total_written) if (total_written)
break; break;
else { else {
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
} else { } else {
...@@ -1536,7 +1539,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid, ...@@ -1536,7 +1539,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid,
spin_unlock(&dentry->d_inode->i_lock); spin_unlock(&dentry->d_inode->i_lock);
} }
mark_inode_dirty_sync(dentry->d_inode); mark_inode_dirty_sync(dentry->d_inode);
FreeXid(xid); free_xid(xid);
return total_written; return total_written;
} }
...@@ -1935,9 +1938,9 @@ static int ...@@ -1935,9 +1938,9 @@ static int
cifs_writepage_locked(struct page *page, struct writeback_control *wbc) cifs_writepage_locked(struct page *page, struct writeback_control *wbc)
{ {
int rc; int rc;
int xid; unsigned int xid;
xid = GetXid(); xid = get_xid();
/* BB add check for wbc flags */ /* BB add check for wbc flags */
page_cache_get(page); page_cache_get(page);
if (!PageUptodate(page)) if (!PageUptodate(page))
...@@ -1966,7 +1969,7 @@ cifs_writepage_locked(struct page *page, struct writeback_control *wbc) ...@@ -1966,7 +1969,7 @@ cifs_writepage_locked(struct page *page, struct writeback_control *wbc)
SetPageUptodate(page); SetPageUptodate(page);
end_page_writeback(page); end_page_writeback(page);
page_cache_release(page); page_cache_release(page);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -2005,9 +2008,9 @@ static int cifs_write_end(struct file *file, struct address_space *mapping, ...@@ -2005,9 +2008,9 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
if (!PageUptodate(page)) { if (!PageUptodate(page)) {
char *page_data; char *page_data;
unsigned offset = pos & (PAGE_CACHE_SIZE - 1); unsigned offset = pos & (PAGE_CACHE_SIZE - 1);
int xid; unsigned int xid;
xid = GetXid(); xid = get_xid();
/* this is probably better than directly calling /* this is probably better than directly calling
partialpage_write since in this function the file handle is partialpage_write since in this function the file handle is
known which we might as well leverage */ known which we might as well leverage */
...@@ -2018,7 +2021,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping, ...@@ -2018,7 +2021,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
/* if (rc < 0) should we set writebehind rc? */ /* if (rc < 0) should we set writebehind rc? */
kunmap(page); kunmap(page);
FreeXid(xid); free_xid(xid);
} else { } else {
rc = copied; rc = copied;
pos += copied; pos += copied;
...@@ -2041,7 +2044,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping, ...@@ -2041,7 +2044,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
int cifs_strict_fsync(struct file *file, loff_t start, loff_t end, int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
int datasync) int datasync)
{ {
int xid; unsigned int xid;
int rc = 0; int rc = 0;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
struct cifsFileInfo *smbfile = file->private_data; struct cifsFileInfo *smbfile = file->private_data;
...@@ -2053,7 +2056,7 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end, ...@@ -2053,7 +2056,7 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
return rc; return rc;
mutex_lock(&inode->i_mutex); mutex_lock(&inode->i_mutex);
xid = GetXid(); xid = get_xid();
cFYI(1, "Sync file - name: %s datasync: 0x%x", cFYI(1, "Sync file - name: %s datasync: 0x%x",
file->f_path.dentry->d_name.name, datasync); 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,14 +2073,14 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC))
rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); rc = CIFSSMBFlush(xid, tcon, smbfile->netfid);
FreeXid(xid); free_xid(xid);
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
return rc; return rc;
} }
int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
{ {
int xid; unsigned int xid;
int rc = 0; int rc = 0;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
struct cifsFileInfo *smbfile = file->private_data; 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,7 +2092,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
return rc; return rc;
mutex_lock(&inode->i_mutex); mutex_lock(&inode->i_mutex);
xid = GetXid(); xid = get_xid();
cFYI(1, "Sync file - name: %s datasync: 0x%x", cFYI(1, "Sync file - name: %s datasync: 0x%x",
file->f_path.dentry->d_name.name, datasync); 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,7 +2101,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC))
rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); rc = CIFSSMBFlush(xid, tcon, smbfile->netfid);
FreeXid(xid); free_xid(xid);
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
return rc; return rc;
} }
...@@ -2743,14 +2746,14 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size, ...@@ -2743,14 +2746,14 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
unsigned int rsize; unsigned int rsize;
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct cifs_tcon *pTcon; struct cifs_tcon *pTcon;
int xid; unsigned int xid;
char *current_offset; char *current_offset;
struct cifsFileInfo *open_file; struct cifsFileInfo *open_file;
struct cifs_io_parms io_parms; struct cifs_io_parms io_parms;
int buf_type = CIFS_NO_BUFFER; int buf_type = CIFS_NO_BUFFER;
__u32 pid; __u32 pid;
xid = GetXid(); xid = get_xid();
cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
/* FIXME: set up handlers for larger reads and/or convert to async */ /* 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,7 +2761,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
if (file->private_data == NULL) { if (file->private_data == NULL) {
rc = -EBADF; rc = -EBADF;
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
open_file = file->private_data; 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,7 +2806,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
if (total_read) { if (total_read) {
break; break;
} else { } else {
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
} else { } else {
...@@ -2811,7 +2814,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size, ...@@ -2811,7 +2814,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
*poffset += bytes_read; *poffset += bytes_read;
} }
} }
FreeXid(xid); free_xid(xid);
return total_read; return total_read;
} }
...@@ -2838,7 +2841,7 @@ int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -2838,7 +2841,7 @@ int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma)
int rc, xid; int rc, xid;
struct inode *inode = file->f_path.dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
xid = GetXid(); xid = get_xid();
if (!CIFS_I(inode)->clientCanCacheRead) { if (!CIFS_I(inode)->clientCanCacheRead) {
rc = cifs_invalidate_mapping(inode); rc = cifs_invalidate_mapping(inode);
...@@ -2849,7 +2852,7 @@ int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -2849,7 +2852,7 @@ int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma)
rc = generic_file_mmap(file, vma); rc = generic_file_mmap(file, vma);
if (rc == 0) if (rc == 0)
vma->vm_ops = &cifs_file_vm_ops; vma->vm_ops = &cifs_file_vm_ops;
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -2857,17 +2860,17 @@ int cifs_file_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -2857,17 +2860,17 @@ int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
{ {
int rc, xid; int rc, xid;
xid = GetXid(); xid = get_xid();
rc = cifs_revalidate_file(file); rc = cifs_revalidate_file(file);
if (rc) { if (rc) {
cFYI(1, "Validation prior to mmap failed, error=%d", rc); cFYI(1, "Validation prior to mmap failed, error=%d", rc);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
rc = generic_file_mmap(file, vma); rc = generic_file_mmap(file, vma);
if (rc == 0) if (rc == 0)
vma->vm_ops = &cifs_file_vm_ops; vma->vm_ops = &cifs_file_vm_ops;
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -3157,13 +3160,13 @@ static int cifs_readpage(struct file *file, struct page *page) ...@@ -3157,13 +3160,13 @@ static int cifs_readpage(struct file *file, struct page *page)
{ {
loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT; loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT;
int rc = -EACCES; int rc = -EACCES;
int xid; unsigned int xid;
xid = GetXid(); xid = get_xid();
if (file->private_data == NULL) { if (file->private_data == NULL) {
rc = -EBADF; rc = -EBADF;
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -3174,7 +3177,7 @@ static int cifs_readpage(struct file *file, struct page *page) ...@@ -3174,7 +3177,7 @@ static int cifs_readpage(struct file *file, struct page *page)
unlock_page(page); unlock_page(page);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
......
...@@ -289,7 +289,7 @@ cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb) ...@@ -289,7 +289,7 @@ cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb)
int cifs_get_file_info_unix(struct file *filp) int cifs_get_file_info_unix(struct file *filp)
{ {
int rc; int rc;
int xid; unsigned int xid;
FILE_UNIX_BASIC_INFO find_data; FILE_UNIX_BASIC_INFO find_data;
struct cifs_fattr fattr; struct cifs_fattr fattr;
struct inode *inode = filp->f_path.dentry->d_inode; struct inode *inode = filp->f_path.dentry->d_inode;
...@@ -297,7 +297,7 @@ int cifs_get_file_info_unix(struct file *filp) ...@@ -297,7 +297,7 @@ int cifs_get_file_info_unix(struct file *filp)
struct cifsFileInfo *cfile = filp->private_data; struct cifsFileInfo *cfile = filp->private_data;
struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
xid = GetXid(); xid = get_xid();
rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->netfid, &find_data); rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->netfid, &find_data);
if (!rc) { if (!rc) {
cifs_unix_basic_to_fattr(&fattr, &find_data, cifs_sb); cifs_unix_basic_to_fattr(&fattr, &find_data, cifs_sb);
...@@ -307,13 +307,13 @@ int cifs_get_file_info_unix(struct file *filp) ...@@ -307,13 +307,13 @@ int cifs_get_file_info_unix(struct file *filp)
} }
cifs_fattr_to_inode(inode, &fattr); cifs_fattr_to_inode(inode, &fattr);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
int cifs_get_inode_info_unix(struct inode **pinode, int cifs_get_inode_info_unix(struct inode **pinode,
const unsigned char *full_path, const unsigned char *full_path,
struct super_block *sb, int xid) struct super_block *sb, unsigned int xid)
{ {
int rc; int rc;
FILE_UNIX_BASIC_INFO find_data; FILE_UNIX_BASIC_INFO find_data;
...@@ -367,7 +367,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, ...@@ -367,7 +367,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
static int static int
cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path, cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
struct cifs_sb_info *cifs_sb, int xid) struct cifs_sb_info *cifs_sb, unsigned int xid)
{ {
int rc; int rc;
int oplock = 0; int oplock = 0;
...@@ -466,7 +466,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path, ...@@ -466,7 +466,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
* FIXME: Doesn't this clobber the type bit we got from cifs_sfu_type ? * FIXME: Doesn't this clobber the type bit we got from cifs_sfu_type ?
*/ */
static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path, static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,
struct cifs_sb_info *cifs_sb, int xid) struct cifs_sb_info *cifs_sb, unsigned int xid)
{ {
#ifdef CONFIG_CIFS_XATTR #ifdef CONFIG_CIFS_XATTR
ssize_t rc; ssize_t rc;
...@@ -557,7 +557,7 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info, ...@@ -557,7 +557,7 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
int cifs_get_file_info(struct file *filp) int cifs_get_file_info(struct file *filp)
{ {
int rc; int rc;
int xid; unsigned int xid;
FILE_ALL_INFO find_data; FILE_ALL_INFO find_data;
struct cifs_fattr fattr; struct cifs_fattr fattr;
struct inode *inode = filp->f_path.dentry->d_inode; struct inode *inode = filp->f_path.dentry->d_inode;
...@@ -565,7 +565,7 @@ int cifs_get_file_info(struct file *filp) ...@@ -565,7 +565,7 @@ int cifs_get_file_info(struct file *filp)
struct cifsFileInfo *cfile = filp->private_data; struct cifsFileInfo *cfile = filp->private_data;
struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
xid = GetXid(); xid = get_xid();
rc = CIFSSMBQFileInfo(xid, tcon, cfile->netfid, &find_data); rc = CIFSSMBQFileInfo(xid, tcon, cfile->netfid, &find_data);
switch (rc) { switch (rc) {
case 0: case 0:
...@@ -596,13 +596,13 @@ int cifs_get_file_info(struct file *filp) ...@@ -596,13 +596,13 @@ int cifs_get_file_info(struct file *filp)
fattr.cf_flags |= CIFS_FATTR_NEED_REVAL; fattr.cf_flags |= CIFS_FATTR_NEED_REVAL;
cifs_fattr_to_inode(inode, &fattr); cifs_fattr_to_inode(inode, &fattr);
cgfi_exit: cgfi_exit:
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
int cifs_get_inode_info(struct inode **pinode, int cifs_get_inode_info(struct inode **pinode,
const unsigned char *full_path, FILE_ALL_INFO *pfindData, const unsigned char *full_path, FILE_ALL_INFO *pfindData,
struct super_block *sb, int xid, const __u16 *pfid) struct super_block *sb, unsigned int xid, const __u16 *pfid)
{ {
int rc = 0, tmprc; int rc = 0, tmprc;
struct cifs_tcon *pTcon; struct cifs_tcon *pTcon;
...@@ -886,13 +886,13 @@ cifs_iget(struct super_block *sb, struct cifs_fattr *fattr) ...@@ -886,13 +886,13 @@ cifs_iget(struct super_block *sb, struct cifs_fattr *fattr)
/* gets root inode */ /* gets root inode */
struct inode *cifs_root_iget(struct super_block *sb) struct inode *cifs_root_iget(struct super_block *sb)
{ {
int xid; unsigned int xid;
struct cifs_sb_info *cifs_sb = CIFS_SB(sb); struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
struct inode *inode = NULL; struct inode *inode = NULL;
long rc; long rc;
struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
xid = GetXid(); xid = get_xid();
if (tcon->unix_ext) if (tcon->unix_ext)
rc = cifs_get_inode_info_unix(&inode, "", sb, xid); rc = cifs_get_inode_info_unix(&inode, "", sb, xid);
else else
...@@ -922,15 +922,15 @@ struct inode *cifs_root_iget(struct super_block *sb) ...@@ -922,15 +922,15 @@ struct inode *cifs_root_iget(struct super_block *sb)
} }
out: out:
/* can not call macro FreeXid here since in a void func /* can not call macro free_xid here since in a void func
* TODO: This is no longer true * TODO: This is no longer true
*/ */
_FreeXid(xid); _free_xid(xid);
return inode; return inode;
} }
static int static int
cifs_set_file_info(struct inode *inode, struct iattr *attrs, int xid, cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid,
char *full_path, __u32 dosattr) char *full_path, __u32 dosattr)
{ {
int rc; int rc;
...@@ -1051,7 +1051,8 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, int xid, ...@@ -1051,7 +1051,8 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, int xid,
* anything else. * anything else.
*/ */
static int static int
cifs_rename_pending_delete(char *full_path, struct dentry *dentry, int xid) cifs_rename_pending_delete(char *full_path, struct dentry *dentry,
unsigned int xid)
{ {
int oplock = 0; int oplock = 0;
int rc; int rc;
...@@ -1171,7 +1172,7 @@ cifs_rename_pending_delete(char *full_path, struct dentry *dentry, int xid) ...@@ -1171,7 +1172,7 @@ cifs_rename_pending_delete(char *full_path, struct dentry *dentry, int xid)
int cifs_unlink(struct inode *dir, struct dentry *dentry) int cifs_unlink(struct inode *dir, struct dentry *dentry)
{ {
int rc = 0; int rc = 0;
int xid; unsigned int xid;
char *full_path = NULL; char *full_path = NULL;
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
struct cifsInodeInfo *cifs_inode; struct cifsInodeInfo *cifs_inode;
...@@ -1189,7 +1190,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry) ...@@ -1189,7 +1190,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
return PTR_ERR(tlink); return PTR_ERR(tlink);
tcon = tlink_tcon(tlink); tcon = tlink_tcon(tlink);
xid = GetXid(); xid = get_xid();
/* Unlink can be called from rename so we can not take the /* Unlink can be called from rename so we can not take the
* sb->s_vfs_rename_mutex here */ * sb->s_vfs_rename_mutex here */
...@@ -1265,7 +1266,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry) ...@@ -1265,7 +1266,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
unlink_out: unlink_out:
kfree(full_path); kfree(full_path);
kfree(attrs); kfree(attrs);
FreeXid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
return rc; return rc;
} }
...@@ -1273,7 +1274,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry) ...@@ -1273,7 +1274,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
{ {
int rc = 0, tmprc; int rc = 0, tmprc;
int xid; unsigned int xid;
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct tcon_link *tlink; struct tcon_link *tlink;
struct cifs_tcon *pTcon; struct cifs_tcon *pTcon;
...@@ -1289,7 +1290,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) ...@@ -1289,7 +1290,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
return PTR_ERR(tlink); return PTR_ERR(tlink);
pTcon = tlink_tcon(tlink); pTcon = tlink_tcon(tlink);
xid = GetXid(); xid = get_xid();
full_path = build_path_from_dentry(direntry); full_path = build_path_from_dentry(direntry);
if (full_path == NULL) { if (full_path == NULL) {
...@@ -1446,7 +1447,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) ...@@ -1446,7 +1447,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
*/ */
CIFS_I(inode)->time = 0; CIFS_I(inode)->time = 0;
kfree(full_path); kfree(full_path);
FreeXid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
return rc; return rc;
} }
...@@ -1454,7 +1455,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) ...@@ -1454,7 +1455,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
int cifs_rmdir(struct inode *inode, struct dentry *direntry) int cifs_rmdir(struct inode *inode, struct dentry *direntry)
{ {
int rc = 0; int rc = 0;
int xid; unsigned int xid;
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct tcon_link *tlink; struct tcon_link *tlink;
struct cifs_tcon *pTcon; struct cifs_tcon *pTcon;
...@@ -1463,7 +1464,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) ...@@ -1463,7 +1464,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
cFYI(1, "cifs_rmdir, inode = 0x%p", inode); cFYI(1, "cifs_rmdir, inode = 0x%p", inode);
xid = GetXid(); xid = get_xid();
full_path = build_path_from_dentry(direntry); full_path = build_path_from_dentry(direntry);
if (full_path == NULL) { if (full_path == NULL) {
...@@ -1506,13 +1507,14 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) ...@@ -1506,13 +1507,14 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
rmdir_exit: rmdir_exit:
kfree(full_path); kfree(full_path);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
static int static int
cifs_do_rename(int xid, struct dentry *from_dentry, const char *fromPath, cifs_do_rename(unsigned int xid, struct dentry *from_dentry,
struct dentry *to_dentry, const char *toPath) const char *fromPath, struct dentry *to_dentry,
const char *toPath)
{ {
struct cifs_sb_info *cifs_sb = CIFS_SB(from_dentry->d_sb); struct cifs_sb_info *cifs_sb = CIFS_SB(from_dentry->d_sb);
struct tcon_link *tlink; struct tcon_link *tlink;
...@@ -1571,7 +1573,8 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry, ...@@ -1571,7 +1573,8 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry,
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
FILE_UNIX_BASIC_INFO *info_buf_source = NULL; FILE_UNIX_BASIC_INFO *info_buf_source = NULL;
FILE_UNIX_BASIC_INFO *info_buf_target; FILE_UNIX_BASIC_INFO *info_buf_target;
int xid, rc, tmprc; unsigned int xid;
int rc, tmprc;
cifs_sb = CIFS_SB(source_dir->i_sb); cifs_sb = CIFS_SB(source_dir->i_sb);
tlink = cifs_sb_tlink(cifs_sb); tlink = cifs_sb_tlink(cifs_sb);
...@@ -1579,7 +1582,7 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry, ...@@ -1579,7 +1582,7 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry,
return PTR_ERR(tlink); return PTR_ERR(tlink);
tcon = tlink_tcon(tlink); tcon = tlink_tcon(tlink);
xid = GetXid(); xid = get_xid();
/* /*
* we already have the rename sem so we do not need to * we already have the rename sem so we do not need to
...@@ -1652,7 +1655,7 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry, ...@@ -1652,7 +1655,7 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry,
kfree(info_buf_source); kfree(info_buf_source);
kfree(fromName); kfree(fromName);
kfree(toName); kfree(toName);
FreeXid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
return rc; return rc;
} }
...@@ -1727,7 +1730,7 @@ int cifs_revalidate_file_attr(struct file *filp) ...@@ -1727,7 +1730,7 @@ int cifs_revalidate_file_attr(struct file *filp)
int cifs_revalidate_dentry_attr(struct dentry *dentry) int cifs_revalidate_dentry_attr(struct dentry *dentry)
{ {
int xid; unsigned int xid;
int rc = 0; int rc = 0;
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
struct super_block *sb = dentry->d_sb; struct super_block *sb = dentry->d_sb;
...@@ -1739,7 +1742,7 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry) ...@@ -1739,7 +1742,7 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry)
if (!cifs_inode_needs_reval(inode)) if (!cifs_inode_needs_reval(inode))
return rc; return rc;
xid = GetXid(); xid = get_xid();
/* can not safely grab the rename sem here if rename calls revalidate /* can not safely grab the rename sem here if rename calls revalidate
since that would deadlock */ since that would deadlock */
...@@ -1761,7 +1764,7 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry) ...@@ -1761,7 +1764,7 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry)
out: out:
kfree(full_path); kfree(full_path);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -1869,7 +1872,7 @@ static void cifs_setsize(struct inode *inode, loff_t offset) ...@@ -1869,7 +1872,7 @@ static void cifs_setsize(struct inode *inode, loff_t offset)
static int static int
cifs_set_file_size(struct inode *inode, struct iattr *attrs, cifs_set_file_size(struct inode *inode, struct iattr *attrs,
int xid, char *full_path) unsigned int xid, char *full_path)
{ {
int rc; int rc;
struct cifsFileInfo *open_file; struct cifsFileInfo *open_file;
...@@ -1971,7 +1974,7 @@ static int ...@@ -1971,7 +1974,7 @@ static int
cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
{ {
int rc; int rc;
int xid; unsigned int xid;
char *full_path = NULL; char *full_path = NULL;
struct inode *inode = direntry->d_inode; struct inode *inode = direntry->d_inode;
struct cifsInodeInfo *cifsInode = CIFS_I(inode); struct cifsInodeInfo *cifsInode = CIFS_I(inode);
...@@ -1984,7 +1987,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) ...@@ -1984,7 +1987,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
cFYI(1, "setattr_unix on file %s attrs->ia_valid=0x%x", cFYI(1, "setattr_unix on file %s attrs->ia_valid=0x%x",
direntry->d_name.name, attrs->ia_valid); direntry->d_name.name, attrs->ia_valid);
xid = GetXid(); xid = get_xid();
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM)
attrs->ia_valid |= ATTR_FORCE; attrs->ia_valid |= ATTR_FORCE;
...@@ -2104,14 +2107,14 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) ...@@ -2104,14 +2107,14 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
out: out:
kfree(args); kfree(args);
kfree(full_path); kfree(full_path);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
static int static int
cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
{ {
int xid; unsigned int xid;
uid_t uid = NO_CHANGE_32; uid_t uid = NO_CHANGE_32;
gid_t gid = NO_CHANGE_32; gid_t gid = NO_CHANGE_32;
struct inode *inode = direntry->d_inode; struct inode *inode = direntry->d_inode;
...@@ -2122,7 +2125,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) ...@@ -2122,7 +2125,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
__u32 dosattr = 0; __u32 dosattr = 0;
__u64 mode = NO_CHANGE_64; __u64 mode = NO_CHANGE_64;
xid = GetXid(); xid = get_xid();
cFYI(1, "setattr on file %s attrs->iavalid 0x%x", cFYI(1, "setattr on file %s attrs->iavalid 0x%x",
direntry->d_name.name, attrs->ia_valid); direntry->d_name.name, attrs->ia_valid);
...@@ -2132,14 +2135,14 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) ...@@ -2132,14 +2135,14 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
rc = inode_change_ok(inode, attrs); rc = inode_change_ok(inode, attrs);
if (rc < 0) { if (rc < 0) {
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
full_path = build_path_from_dentry(direntry); full_path = build_path_from_dentry(direntry);
if (full_path == NULL) { if (full_path == NULL) {
rc = -ENOMEM; rc = -ENOMEM;
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -2265,7 +2268,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) ...@@ -2265,7 +2268,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
cifs_setattr_exit: cifs_setattr_exit:
kfree(full_path); kfree(full_path);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
......
...@@ -34,7 +34,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) ...@@ -34,7 +34,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
{ {
struct inode *inode = filep->f_dentry->d_inode; struct inode *inode = filep->f_dentry->d_inode;
int rc = -ENOTTY; /* strange error - but the precedent */ int rc = -ENOTTY; /* strange error - but the precedent */
int xid; unsigned int xid;
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
#ifdef CONFIG_CIFS_POSIX #ifdef CONFIG_CIFS_POSIX
struct cifsFileInfo *pSMBFile = filep->private_data; struct cifsFileInfo *pSMBFile = filep->private_data;
...@@ -44,7 +44,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) ...@@ -44,7 +44,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
__u64 caps; __u64 caps;
#endif /* CONFIG_CIFS_POSIX */ #endif /* CONFIG_CIFS_POSIX */
xid = GetXid(); xid = get_xid();
cFYI(1, "ioctl file %p cmd %u arg %lu", filep, command, arg); cFYI(1, "ioctl file %p cmd %u arg %lu", filep, command, arg);
...@@ -105,6 +105,6 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) ...@@ -105,6 +105,6 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
break; break;
} }
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -181,7 +181,7 @@ CIFSFormatMFSymlink(u8 *buf, unsigned int buf_len, const char *link_str) ...@@ -181,7 +181,7 @@ CIFSFormatMFSymlink(u8 *buf, unsigned int buf_len, const char *link_str)
} }
static int static int
CIFSCreateMFSymLink(const int xid, struct cifs_tcon *tcon, CIFSCreateMFSymLink(const unsigned int xid, struct cifs_tcon *tcon,
const char *fromName, const char *toName, const char *fromName, const char *toName,
struct cifs_sb_info *cifs_sb) struct cifs_sb_info *cifs_sb)
{ {
...@@ -238,7 +238,7 @@ CIFSCreateMFSymLink(const int xid, struct cifs_tcon *tcon, ...@@ -238,7 +238,7 @@ CIFSCreateMFSymLink(const int xid, struct cifs_tcon *tcon,
} }
static int static int
CIFSQueryMFSymLink(const int xid, struct cifs_tcon *tcon, CIFSQueryMFSymLink(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName, char **symlinkinfo, const unsigned char *searchName, char **symlinkinfo,
const struct nls_table *nls_codepage, int remap) const struct nls_table *nls_codepage, int remap)
{ {
...@@ -307,7 +307,7 @@ CIFSCouldBeMFSymlink(const struct cifs_fattr *fattr) ...@@ -307,7 +307,7 @@ CIFSCouldBeMFSymlink(const struct cifs_fattr *fattr)
int int
CIFSCheckMFSymlink(struct cifs_fattr *fattr, CIFSCheckMFSymlink(struct cifs_fattr *fattr,
const unsigned char *path, const unsigned char *path,
struct cifs_sb_info *cifs_sb, int xid) struct cifs_sb_info *cifs_sb, unsigned int xid)
{ {
int rc; int rc;
int oplock = 0; int oplock = 0;
...@@ -390,7 +390,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode, ...@@ -390,7 +390,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
struct dentry *direntry) struct dentry *direntry)
{ {
int rc = -EACCES; int rc = -EACCES;
int xid; unsigned int xid;
char *fromName = NULL; char *fromName = NULL;
char *toName = NULL; char *toName = NULL;
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 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,7 +403,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
return PTR_ERR(tlink); return PTR_ERR(tlink);
pTcon = tlink_tcon(tlink); pTcon = tlink_tcon(tlink);
xid = GetXid(); xid = get_xid();
fromName = build_path_from_dentry(old_file); fromName = build_path_from_dentry(old_file);
toName = build_path_from_dentry(direntry); toName = build_path_from_dentry(direntry);
...@@ -455,7 +455,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode, ...@@ -455,7 +455,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
cifs_hl_exit: cifs_hl_exit:
kfree(fromName); kfree(fromName);
kfree(toName); kfree(toName);
FreeXid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
return rc; return rc;
} }
...@@ -465,14 +465,14 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd) ...@@ -465,14 +465,14 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
{ {
struct inode *inode = direntry->d_inode; struct inode *inode = direntry->d_inode;
int rc = -ENOMEM; int rc = -ENOMEM;
int xid; unsigned int xid;
char *full_path = NULL; char *full_path = NULL;
char *target_path = NULL; char *target_path = NULL;
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
struct tcon_link *tlink = NULL; struct tcon_link *tlink = NULL;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
xid = GetXid(); xid = get_xid();
tlink = cifs_sb_tlink(cifs_sb); tlink = cifs_sb_tlink(cifs_sb);
if (IS_ERR(tlink)) { if (IS_ERR(tlink)) {
...@@ -529,7 +529,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd) ...@@ -529,7 +529,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
target_path = ERR_PTR(rc); target_path = ERR_PTR(rc);
} }
FreeXid(xid); free_xid(xid);
if (tlink) if (tlink)
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
nd_set_link(nd, target_path); nd_set_link(nd, target_path);
...@@ -540,14 +540,14 @@ int ...@@ -540,14 +540,14 @@ int
cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname) cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
{ {
int rc = -EOPNOTSUPP; int rc = -EOPNOTSUPP;
int xid; unsigned int xid;
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
struct tcon_link *tlink; struct tcon_link *tlink;
struct cifs_tcon *pTcon; struct cifs_tcon *pTcon;
char *full_path = NULL; char *full_path = NULL;
struct inode *newinode = NULL; struct inode *newinode = NULL;
xid = GetXid(); xid = get_xid();
tlink = cifs_sb_tlink(cifs_sb); tlink = cifs_sb_tlink(cifs_sb);
if (IS_ERR(tlink)) { if (IS_ERR(tlink)) {
...@@ -594,7 +594,7 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname) ...@@ -594,7 +594,7 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
symlink_exit: symlink_exit:
kfree(full_path); kfree(full_path);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
......
...@@ -40,7 +40,7 @@ extern mempool_t *cifs_req_poolp; ...@@ -40,7 +40,7 @@ extern mempool_t *cifs_req_poolp;
since the cifs fs was mounted */ since the cifs fs was mounted */
unsigned int unsigned int
_GetXid(void) _get_xid(void)
{ {
unsigned int xid; unsigned int xid;
...@@ -58,7 +58,7 @@ _GetXid(void) ...@@ -58,7 +58,7 @@ _GetXid(void)
} }
void void
_FreeXid(unsigned int xid) _free_xid(unsigned int xid)
{ {
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
/* if (GlobalTotalActiveXid == 0) /* if (GlobalTotalActiveXid == 0)
......
...@@ -193,7 +193,7 @@ cifs_std_info_to_fattr(struct cifs_fattr *fattr, FIND_FILE_STANDARD_INFO *info, ...@@ -193,7 +193,7 @@ cifs_std_info_to_fattr(struct cifs_fattr *fattr, FIND_FILE_STANDARD_INFO *info,
we try to do FindFirst on (NTFS) directory symlinks */ we try to do FindFirst on (NTFS) directory symlinks */
/* /*
int get_symlink_reparse_path(char *full_path, struct cifs_sb_info *cifs_sb, int get_symlink_reparse_path(char *full_path, struct cifs_sb_info *cifs_sb,
int xid) unsigned int xid)
{ {
__u16 fid; __u16 fid;
int len; int len;
...@@ -220,7 +220,7 @@ int get_symlink_reparse_path(char *full_path, struct cifs_sb_info *cifs_sb, ...@@ -220,7 +220,7 @@ int get_symlink_reparse_path(char *full_path, struct cifs_sb_info *cifs_sb,
} }
*/ */
static int initiate_cifs_search(const int xid, struct file *file) static int initiate_cifs_search(const unsigned int xid, struct file *file)
{ {
__u16 search_flags; __u16 search_flags;
int rc = 0; int rc = 0;
...@@ -507,7 +507,7 @@ static int cifs_save_resume_key(const char *current_entry, ...@@ -507,7 +507,7 @@ static int cifs_save_resume_key(const char *current_entry,
assume that they are located in the findfirst return buffer.*/ assume that they are located in the findfirst return buffer.*/
/* We start counting in the buffer with entry 2 and increment for every /* We start counting in the buffer with entry 2 and increment for every
entry (do not increment for . or .. entry) */ entry (do not increment for . or .. entry) */
static int find_cifs_entry(const int xid, struct cifs_tcon *pTcon, static int find_cifs_entry(const unsigned int xid, struct cifs_tcon *pTcon,
struct file *file, char **ppCurrentEntry, int *num_to_ret) struct file *file, char **ppCurrentEntry, int *num_to_ret)
{ {
__u16 search_flags; __u16 search_flags;
...@@ -721,7 +721,8 @@ static int cifs_filldir(char *find_entry, struct file *file, filldir_t filldir, ...@@ -721,7 +721,8 @@ static int cifs_filldir(char *find_entry, struct file *file, filldir_t filldir,
int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
{ {
int rc = 0; int rc = 0;
int xid, i; unsigned int xid;
int i;
struct cifs_tcon *pTcon; struct cifs_tcon *pTcon;
struct cifsFileInfo *cifsFile = NULL; struct cifsFileInfo *cifsFile = NULL;
char *current_entry; char *current_entry;
...@@ -730,7 +731,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) ...@@ -730,7 +731,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
char *end_of_smb; char *end_of_smb;
unsigned int max_len; unsigned int max_len;
xid = GetXid(); xid = get_xid();
/* /*
* Ensure FindFirst doesn't fail before doing filldir() for '.' and * 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,7 +769,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
if (file->private_data == NULL) { if (file->private_data == NULL) {
rc = -EINVAL; rc = -EINVAL;
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
cifsFile = file->private_data; cifsFile = file->private_data;
...@@ -840,6 +841,6 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) ...@@ -840,6 +841,6 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
} /* end switch */ } /* end switch */
rddir2_exit: rddir2_exit:
FreeXid(xid); free_xid(xid);
return rc; return rc;
} }
...@@ -39,7 +39,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name) ...@@ -39,7 +39,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
{ {
int rc = -EOPNOTSUPP; int rc = -EOPNOTSUPP;
#ifdef CONFIG_CIFS_XATTR #ifdef CONFIG_CIFS_XATTR
int xid; unsigned int xid;
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct tcon_link *tlink; struct tcon_link *tlink;
struct cifs_tcon *pTcon; struct cifs_tcon *pTcon;
...@@ -60,7 +60,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name) ...@@ -60,7 +60,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
return PTR_ERR(tlink); return PTR_ERR(tlink);
pTcon = tlink_tcon(tlink); pTcon = tlink_tcon(tlink);
xid = GetXid(); xid = get_xid();
full_path = build_path_from_dentry(direntry); full_path = build_path_from_dentry(direntry);
if (full_path == NULL) { if (full_path == NULL) {
...@@ -88,7 +88,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name) ...@@ -88,7 +88,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
} }
remove_ea_exit: remove_ea_exit:
kfree(full_path); kfree(full_path);
FreeXid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
#endif #endif
return rc; return rc;
...@@ -99,7 +99,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name, ...@@ -99,7 +99,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
{ {
int rc = -EOPNOTSUPP; int rc = -EOPNOTSUPP;
#ifdef CONFIG_CIFS_XATTR #ifdef CONFIG_CIFS_XATTR
int xid; unsigned int xid;
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct tcon_link *tlink; struct tcon_link *tlink;
struct cifs_tcon *pTcon; struct cifs_tcon *pTcon;
...@@ -120,7 +120,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name, ...@@ -120,7 +120,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
return PTR_ERR(tlink); return PTR_ERR(tlink);
pTcon = tlink_tcon(tlink); pTcon = tlink_tcon(tlink);
xid = GetXid(); xid = get_xid();
full_path = build_path_from_dentry(direntry); full_path = build_path_from_dentry(direntry);
if (full_path == NULL) { if (full_path == NULL) {
...@@ -221,7 +221,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name, ...@@ -221,7 +221,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
set_ea_exit: set_ea_exit:
kfree(full_path); kfree(full_path);
FreeXid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
#endif #endif
return rc; return rc;
...@@ -232,7 +232,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name, ...@@ -232,7 +232,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
{ {
ssize_t rc = -EOPNOTSUPP; ssize_t rc = -EOPNOTSUPP;
#ifdef CONFIG_CIFS_XATTR #ifdef CONFIG_CIFS_XATTR
int xid; unsigned int xid;
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct tcon_link *tlink; struct tcon_link *tlink;
struct cifs_tcon *pTcon; struct cifs_tcon *pTcon;
...@@ -253,7 +253,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name, ...@@ -253,7 +253,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
return PTR_ERR(tlink); return PTR_ERR(tlink);
pTcon = tlink_tcon(tlink); pTcon = tlink_tcon(tlink);
xid = GetXid(); xid = get_xid();
full_path = build_path_from_dentry(direntry); full_path = build_path_from_dentry(direntry);
if (full_path == NULL) { if (full_path == NULL) {
...@@ -355,7 +355,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name, ...@@ -355,7 +355,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
get_ea_exit: get_ea_exit:
kfree(full_path); kfree(full_path);
FreeXid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
#endif #endif
return rc; return rc;
...@@ -365,7 +365,7 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size) ...@@ -365,7 +365,7 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
{ {
ssize_t rc = -EOPNOTSUPP; ssize_t rc = -EOPNOTSUPP;
#ifdef CONFIG_CIFS_XATTR #ifdef CONFIG_CIFS_XATTR
int xid; unsigned int xid;
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct tcon_link *tlink; struct tcon_link *tlink;
struct cifs_tcon *pTcon; struct cifs_tcon *pTcon;
...@@ -389,7 +389,7 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size) ...@@ -389,7 +389,7 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
return PTR_ERR(tlink); return PTR_ERR(tlink);
pTcon = tlink_tcon(tlink); pTcon = tlink_tcon(tlink);
xid = GetXid(); xid = get_xid();
full_path = build_path_from_dentry(direntry); full_path = build_path_from_dentry(direntry);
if (full_path == NULL) { if (full_path == NULL) {
...@@ -409,7 +409,7 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size) ...@@ -409,7 +409,7 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
list_ea_exit: list_ea_exit:
kfree(full_path); kfree(full_path);
FreeXid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
#endif #endif
return rc; return rc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册