Commit 6d5786a3 authored by Pavel Shilovsky's avatar Pavel Shilovsky Committed by Steve French

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

Acked-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarPavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
parent 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;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -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);
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment