Browse Source

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

Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
master
Pavel Shilovsky 9 years ago
committed by Steve French
parent
commit
6d5786a34d
  1. 7
      fs/cifs/cifs_dfs_ref.c
  2. 21
      fs/cifs/cifsacl.c
  3. 6
      fs/cifs/cifsfs.c
  4. 171
      fs/cifs/cifsproto.h
  5. 146
      fs/cifs/cifssmb.c
  6. 40
      fs/cifs/connect.c
  7. 43
      fs/cifs/dir.c
  8. 133
      fs/cifs/file.c
  9. 87
      fs/cifs/inode.c
  10. 6
      fs/cifs/ioctl.c
  11. 24
      fs/cifs/link.c
  12. 4
      fs/cifs/misc.c
  13. 15
      fs/cifs/readdir.c
  14. 24
      fs/cifs/xattr.c

7
fs/cifs/cifs_dfs_ref.c

@ -275,7 +275,8 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
struct cifs_sb_info *cifs_sb;
struct cifs_ses *ses;
char *full_path;
int xid, i;
unsigned int xid;
int i;
int rc;
struct vfsmount *mnt;
struct tcon_link *tlink;
@ -302,11 +303,11 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
}
ses = tlink_tcon(tlink)->ses;
xid = GetXid();
xid = get_xid();
rc = get_dfs_path(xid, ses, full_path + 1, cifs_sb->local_nls,
&num_referrals, &referrals,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
FreeXid(xid);
free_xid(xid);
cifs_put_tlink(tlink);

21
fs/cifs/cifsacl.c

@ -1153,15 +1153,16 @@ static struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
__u16 fid, u32 *pacllen)
{
struct cifs_ntsd *pntsd = NULL;
int xid, rc;
unsigned int xid;
int rc;
struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
if (IS_ERR(tlink))
return ERR_CAST(tlink);
xid = GetXid();
xid = get_xid();
rc = CIFSSMBGetCIFSACL(xid, tlink_tcon(tlink), fid, &pntsd, pacllen);
FreeXid(xid);
free_xid(xid);
cifs_put_tlink(tlink);
@ -1176,7 +1177,8 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
{
struct cifs_ntsd *pntsd = NULL;
int oplock = 0;
int xid, rc, create_options = 0;
unsigned int xid;
int rc, create_options = 0;
__u16 fid;
struct cifs_tcon *tcon;
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,
return ERR_CAST(tlink);
tcon = tlink_tcon(tlink);
xid = GetXid();
xid = get_xid();
if (backup_cred(cifs_sb))
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,
}
cifs_put_tlink(tlink);
FreeXid(xid);
free_xid(xid);
cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen);
if (rc)
@ -1230,7 +1232,8 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
struct inode *inode, const char *path, int aclflag)
{
int oplock = 0;
int xid, rc, access_flags, create_options = 0;
unsigned int xid;
int rc, access_flags, create_options = 0;
__u16 fid;
struct cifs_tcon *tcon;
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,
return PTR_ERR(tlink);
tcon = tlink_tcon(tlink);
xid = GetXid();
xid = get_xid();
if (backup_cred(cifs_sb))
create_options |= CREATE_OPEN_BACKUP_INTENT;
@ -1263,7 +1266,7 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
CIFSSMBClose(xid, tcon, fid);
out:
FreeXid(xid);
free_xid(xid);
cifs_put_tlink(tlink);
return rc;
}

6
fs/cifs/cifsfs.c

@ -158,9 +158,9 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
int rc = -EOPNOTSUPP;
int xid;
unsigned int xid;
xid = GetXid();
xid = get_xid();
buf->f_type = CIFS_MAGIC_NUMBER;
@ -197,7 +197,7 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
if (rc)
rc = SMBOldQFSInfo(xid, tcon, buf);
FreeXid(xid);
free_xid(xid);
return 0;
}

171
fs/cifs/cifsproto.h

@ -37,20 +37,20 @@ extern struct smb_hdr *cifs_small_buf_get(void);
extern void cifs_small_buf_release(void *);
extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
unsigned int /* length */);
extern unsigned int _GetXid(void);
extern void _FreeXid(unsigned int);
#define GetXid() \
extern unsigned int _get_xid(void);
extern void _free_xid(unsigned int);
#define get_xid() \
({ \
int __xid = (int)_GetXid(); \
cFYI(1, "CIFS VFS: in %s as Xid: %d with uid: %d", \
unsigned int __xid = _get_xid(); \
cFYI(1, "CIFS VFS: in %s as Xid: %u with uid: %d", \
__func__, __xid, current_fsuid()); \
__xid; \
})
#define FreeXid(curr_xid) \
#define free_xid(curr_xid) \
do { \
_FreeXid(curr_xid); \
cFYI(1, "CIFS VFS: leaving %s (xid = %d) rc = %d", \
_free_xid(curr_xid); \
cFYI(1, "CIFS VFS: leaving %s (xid = %u) rc = %d", \
__func__, curr_xid, (int)rc); \
} while (0)
extern int init_cifs_idmap(void);
@ -123,10 +123,10 @@ extern void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock);
extern struct cifsFileInfo *cifs_new_fileinfo(__u16 fileHandle,
struct file *file, struct tcon_link *tlink,
__u32 oplock);
extern int cifs_posix_open(char *full_path, struct inode **pinode,
struct super_block *sb,
int mode, unsigned int f_flags,
__u32 *poplock, __u16 *pnetfid, int xid);
extern int cifs_posix_open(char *full_path, struct inode **inode,
struct super_block *sb, int mode,
unsigned int f_flags, __u32 *oplock, __u16 *netfid,
unsigned int xid);
void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr);
extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr,
FILE_UNIX_BASIC_INFO *info,
@ -139,11 +139,12 @@ extern int cifs_get_file_info(struct file *filp);
extern int cifs_get_inode_info(struct inode **pinode,
const unsigned char *search_path,
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_inode_info_unix(struct inode **pinode,
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,
struct cifs_fattr *fattr, struct inode *inode,
const char *path, const __u16 *pfid);
@ -188,88 +189,90 @@ extern int CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
const char *tree, struct cifs_tcon *tcon,
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,
__u16 *searchHandle, __u16 search_flags,
struct cifs_search_info *psrch_inf,
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,
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);
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);
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,
FILE_ALL_INFO *findData,
int legacy /* whether to use old info level */,
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,
FILE_ALL_INFO *findData,
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);
extern int CIFSSMBUnixQPathInfo(const int xid,
extern int CIFSSMBUnixQPathInfo(const unsigned int xid,
struct cifs_tcon *tcon,
const unsigned char *searchName,
FILE_UNIX_BASIC_INFO *pFindData,
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,
struct dfs_info3_param **target_nodes,
unsigned int *number_of_nodes_in_array,
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 struct nls_table *nls_codepage,
unsigned int *pnum_referrals,
struct dfs_info3_param **preferrals,
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 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);
extern int SMBOldQFSInfo(const int xid, struct cifs_tcon *tcon,
extern int SMBOldQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
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);
extern int CIFSSMBQFSAttributeInfo(const int xid,
extern int CIFSSMBQFSAttributeInfo(const unsigned int xid,
struct cifs_tcon *tcon);
extern int CIFSSMBQFSDeviceInfo(const int xid, struct cifs_tcon *tcon);
extern int CIFSSMBQFSUnixInfo(const int xid, struct cifs_tcon *tcon);
extern int CIFSSMBQFSPosixInfo(const int xid, struct cifs_tcon *tcon,
extern int CIFSSMBQFSDeviceInfo(const unsigned int xid, struct cifs_tcon *tcon);
extern int CIFSSMBQFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon);
extern int CIFSSMBQFSPosixInfo(const unsigned int xid, struct cifs_tcon *tcon,
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 struct nls_table *nls_codepage,
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,
__u32 pid_of_opener);
extern int CIFSSMBSetFileDisposition(const int xid, struct cifs_tcon *tcon,
bool delete_file, __u16 fid, __u32 pid_of_opener);
extern int CIFSSMBSetFileDisposition(const unsigned int xid,
struct cifs_tcon *tcon,
bool delete_file, __u16 fid,
__u32 pid_of_opener);
#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,
const struct nls_table *nls_codepage);
#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,
bool setAllocationSizeFlag,
const struct nls_table *nls_codepage,
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,
bool AllocSizeFlag);
@ -283,108 +286,110 @@ struct cifs_unix_set_info_args {
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,
u16 fid, u32 pid_of_opener);
extern int CIFSSMBUnixSetPathInfo(const int xid, struct cifs_tcon *pTcon,
char *fileName,
const struct cifs_unix_set_info_args *args,
const struct nls_table *nls_codepage,
int remap_special_chars);
extern int CIFSSMBUnixSetPathInfo(const unsigned int xid,
struct cifs_tcon *tcon, char *file_name,
const struct cifs_unix_set_info_args *args,
const struct nls_table *nls_codepage,
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 struct nls_table *nls_codepage,
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,
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 struct nls_table *nls_codepage,
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 struct nls_table *nls_codepage,
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 struct nls_table *nls_codepage,
int remap_special_chars);
extern int CIFSSMBRenameOpenFile(const int xid, struct cifs_tcon *pTcon,
int netfid, const char *target_name,
const struct nls_table *nls_codepage,
int remap_special_chars);
extern int CIFSCreateHardLink(const int xid,
extern int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *tcon,
int netfid, const char *target_name,
const struct nls_table *nls_codepage,
int remap_special_chars);
extern int CIFSCreateHardLink(const unsigned int xid,
struct cifs_tcon *tcon,
const char *fromName, const char *toName,
const struct nls_table *nls_codepage,
int remap_special_chars);
extern int CIFSUnixCreateHardLink(const int xid,
extern int CIFSUnixCreateHardLink(const unsigned int xid,
struct cifs_tcon *tcon,
const char *fromName, const char *toName,
const struct nls_table *nls_codepage,
int remap_special_chars);
extern int CIFSUnixCreateSymLink(const int xid,
extern int CIFSUnixCreateSymLink(const unsigned int xid,
struct cifs_tcon *tcon,
const char *fromName, const char *toName,
const struct nls_table *nls_codepage);
extern int CIFSSMBUnixQuerySymLink(const int xid,
extern int CIFSSMBUnixQuerySymLink(const unsigned int xid,
struct cifs_tcon *tcon,
const unsigned char *searchName, char **syminfo,
const struct nls_table *nls_codepage);
#ifdef CONFIG_CIFS_SYMLINK_EXPERIMENTAL
extern int CIFSSMBQueryReparseLinkInfo(const int xid,
extern int CIFSSMBQueryReparseLinkInfo(const unsigned int xid,
struct cifs_tcon *tcon,
const unsigned char *searchName,
char *symlinkinfo, const int buflen, __u16 fid,
const struct nls_table *nls_codepage);
#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 int access_flags, const int omode,
__u16 *netfid, int *pOplock, FILE_ALL_INFO *,
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 int access_flags, const int omode,
__u16 *netfid, int *pOplock, FILE_ALL_INFO *,
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,
FILE_UNIX_BASIC_INFO *pRetData,
__u32 *pOplock, const char *name,
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);
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);
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,
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,
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,
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 struct nls_table *nls_codepage,
int remap_special_chars);
extern int cifs_lockv(const int xid, struct cifs_tcon *tcon, const __u16 netfid,
const __u8 lock_type, const __u32 num_unlock,
const __u32 num_lock, LOCKING_ANDX_RANGE *buf);
extern int CIFSSMBLock(const int xid, struct cifs_tcon *tcon,
extern int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
const __u16 netfid, const __u8 lock_type,
const __u32 num_unlock, const __u32 num_lock,
LOCKING_ANDX_RANGE *buf);
extern int CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
const __u16 netfid, const __u32 netpid, const __u64 len,
const __u64 offset, const __u32 numUnlock,
const __u32 numLock, const __u8 lockType,
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 loff_t start_offset, const __u64 len,
struct file_lock *, const __u16 lock_type,
@ -417,46 +422,46 @@ extern int calc_lanman_hash(const char *password, const char *cryptkey,
bool encrypt, char *lnm_session_key);
#endif /* CIFS_WEAK_PW_HASH */
#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,
__u32 filter, struct file *file, int multishot,
const struct nls_table *nls_codepage);
#endif /* was needed for dnotify, and will be needed for inotify when VFS fix */
extern int CIFSSMBCopy(int xid,
extern int CIFSSMBCopy(unsigned int xid,
struct cifs_tcon *source_tcon,
const char *fromName,
const __u16 target_tid,
const char *toName, const int flags,
const struct nls_table *nls_codepage,
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 *ea_name, char *EAData,
size_t bufsize, const struct nls_table *nls_codepage,
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 void *ea_value, const __u16 ea_value_len,
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);
extern int CIFSSMBSetCIFSACL(const int, struct cifs_tcon *, __u16,
extern int CIFSSMBSetCIFSACL(const unsigned int, struct cifs_tcon *, __u16,
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,
char *acl_inf, const int buflen, const int acl_type,
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 char *local_acl, const int buflen, const int acl_type,
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);
extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb);
extern bool CIFSCouldBeMFSymlink(const struct cifs_fattr *fattr);
extern int CIFSCheckMFSymlink(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);
extern int mdfour(unsigned char *, unsigned char *, int);
extern int E_md4hash(const unsigned char *passwd, unsigned char *p16,
const struct nls_table *codepage);

146
fs/cifs/cifssmb.c

@ -828,8 +828,9 @@ session_already_dead:
}
int
CIFSPOSIXDelFile(const int xid, struct cifs_tcon *tcon, const char *fileName,
__u16 type, const struct nls_table *nls_codepage, int remap)
CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon,
const char *fileName, __u16 type,
const struct nls_table *nls_codepage, int remap)
{
TRANSACTION2_SPI_REQ *pSMB = NULL;
TRANSACTION2_SPI_RSP *pSMBr = NULL;
@ -903,8 +904,9 @@ PsxDelete:
}
int
CIFSSMBDelFile(const int xid, struct cifs_tcon *tcon, const char *fileName,
const struct nls_table *nls_codepage, int remap)
CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon,
const char *fileName, const struct nls_table *nls_codepage,
int remap)
{
DELETE_FILE_REQ *pSMB = NULL;
DELETE_FILE_RSP *pSMBr = NULL;
@ -948,8 +950,9 @@ DelFileRetry:
}
int
CIFSSMBRmDir(const int xid, struct cifs_tcon *tcon, const char *dirName,
const struct nls_table *nls_codepage, int remap)
CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon,
const char *dirName, const struct nls_table *nls_codepage,
int remap)
{
DELETE_DIRECTORY_REQ *pSMB = NULL;
DELETE_DIRECTORY_RSP *pSMBr = NULL;
@ -991,7 +994,7 @@ RmDirRetry:
}
int
CIFSSMBMkDir(const int xid, struct cifs_tcon *tcon,
CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon,
const char *name, const struct nls_table *nls_codepage, int remap)
{
int rc = 0;
@ -1034,10 +1037,11 @@ MkDirRetry:
}
int
CIFSPOSIXCreate(const int xid, struct cifs_tcon *tcon, __u32 posix_flags,
__u64 mode, __u16 *netfid, FILE_UNIX_BASIC_INFO *pRetData,
__u32 *pOplock, const char *name,
const struct nls_table *nls_codepage, int remap)
CIFSPOSIXCreate(const unsigned int xid, struct cifs_tcon *tcon,
__u32 posix_flags, __u64 mode, __u16 *netfid,
FILE_UNIX_BASIC_INFO *pRetData, __u32 *pOplock,
const char *name, const struct nls_table *nls_codepage,
int remap)
{
TRANSACTION2_SPI_REQ *pSMB = NULL;
TRANSACTION2_SPI_RSP *pSMBr = NULL;
@ -1200,7 +1204,7 @@ access_flags_to_smbopen_mode(const int access_flags)
}
int
SMBLegacyOpen(const int xid, struct cifs_tcon *tcon,
SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon,
const char *fileName, const int openDisposition,
const int access_flags, const int create_options, __u16 *netfid,
int *pOplock, FILE_ALL_INFO *pfile_info,
@ -1307,7 +1311,7 @@ OldOpenRetry:
}
int
CIFSSMBOpen(const int xid, struct cifs_tcon *tcon,
CIFSSMBOpen(const unsigned int xid, struct cifs_tcon *tcon,
const char *fileName, const int openDisposition,
const int access_flags, const int create_options, __u16 *netfid,
int *pOplock, FILE_ALL_INFO *pfile_info,
@ -1657,8 +1661,8 @@ cifs_async_readv(struct cifs_readdata *rdata)
}
int
CIFSSMBRead(const int xid, struct cifs_io_parms *io_parms, unsigned int *nbytes,
char **buf, int *pbuf_type)
CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
unsigned int *nbytes, char **buf, int *pbuf_type)
{
int rc = -EACCES;
READ_REQ *pSMB = NULL;
@ -1769,7 +1773,7 @@ CIFSSMBRead(const int xid, struct cifs_io_parms *io_parms, unsigned int *nbytes,
int
CIFSSMBWrite(const int xid, struct cifs_io_parms *io_parms,
CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
unsigned int *nbytes, const char *buf,
const char __user *ubuf, const int long_op)
{
@ -2136,7 +2140,7 @@ async_writev_out:
}
int
CIFSSMBWrite2(const int xid, struct cifs_io_parms *io_parms,
CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
unsigned int *nbytes, struct kvec *iov, int n_vec,
const int long_op)
{
@ -2244,8 +2248,8 @@ CIFSSMBWrite2(const int xid, struct cifs_io_parms *io_parms,
return rc;
}
int cifs_lockv(const int xid, struct cifs_tcon *tcon, const __u16 netfid,
const __u8 lock_type, const __u32 num_unlock,
int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
const __u16 netfid, const __u8 lock_type, const __u32 num_unlock,
const __u32 num_lock, LOCKING_ANDX_RANGE *buf)
{
int rc = 0;
@ -2286,7 +2290,7 @@ int cifs_lockv(const int xid, struct cifs_tcon *tcon, const __u16 netfid,
}
int
CIFSSMBLock(const int xid, struct cifs_tcon *tcon,
CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
const __u16 smb_file_id, const __u32 netpid, const __u64 len,
const __u64 offset, const __u32 numUnlock,
const __u32 numLock, const __u8 lockType,
@ -2356,7 +2360,7 @@ CIFSSMBLock(const int xid, struct cifs_tcon *tcon,
}
int
CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon,
CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
const __u16 smb_file_id, const __u32 netpid,
const loff_t start_offset, const __u64 len,
struct file_lock *pLockData, const __u16 lock_type,
@ -2492,7 +2496,7 @@ plk_err_exit:
int
CIFSSMBClose(const int xid, struct cifs_tcon *tcon, int smb_file_id)
CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
{
int rc = 0;
CLOSE_REQ *pSMB = NULL;
@ -2525,7 +2529,7 @@ CIFSSMBClose(const int xid, struct cifs_tcon *tcon, int smb_file_id)
}
int
CIFSSMBFlush(const int xid, struct cifs_tcon *tcon, int smb_file_id)
CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
{
int rc = 0;
FLUSH_REQ *pSMB = NULL;
@ -2546,7 +2550,7 @@ CIFSSMBFlush(const int xid, struct cifs_tcon *tcon, int smb_file_id)
}
int
CIFSSMBRename(const int xid, struct cifs_tcon *tcon,
CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon,
const char *fromName, const char *toName,
const struct nls_table *nls_codepage, int remap)
{
@ -2613,7 +2617,7 @@ renameRetry:
return rc;
}
int CIFSSMBRenameOpenFile(const int xid, struct cifs_tcon *pTcon,
int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *pTcon,
int netfid, const char *target_name,
const struct nls_table *nls_codepage, int remap)
{
@ -2695,9 +2699,9 @@ int CIFSSMBRenameOpenFile(const int xid, struct cifs_tcon *pTcon,
}
int
CIFSSMBCopy(const int xid, struct cifs_tcon *tcon, const char *fromName,
const __u16 target_tid, const char *toName, const int flags,
const struct nls_table *nls_codepage, int remap)
CIFSSMBCopy(const unsigned int xid, struct cifs_tcon *tcon,
const char *fromName, const __u16 target_tid, const char *toName,
const int flags, const struct nls_table *nls_codepage, int remap)
{
int rc = 0;
COPY_REQ *pSMB = NULL;
@ -2763,7 +2767,7 @@ copyRetry:
}
int
CIFSUnixCreateSymLink(const int xid, struct cifs_tcon *tcon,
CIFSUnixCreateSymLink(const unsigned int xid, struct cifs_tcon *tcon,
const char *fromName, const char *toName,
const struct nls_table *nls_codepage)
{
@ -2852,7 +2856,7 @@ createSymLinkRetry:
}
int
CIFSUnixCreateHardLink(const int xid, struct cifs_tcon *tcon,
CIFSUnixCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
const char *fromName, const char *toName,
const struct nls_table *nls_codepage, int remap)
{
@ -2937,7 +2941,7 @@ createHardLinkRetry:
}
int
CIFSCreateHardLink(const int xid, struct cifs_tcon *tcon,
CIFSCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
const char *fromName, const char *toName,
const struct nls_table *nls_codepage, int remap)
{
@ -3009,7 +3013,7 @@ winCreateHardLinkRetry:
}
int
CIFSSMBUnixQuerySymLink(const int xid, struct cifs_tcon *tcon,
CIFSSMBUnixQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName, char **symlinkinfo,
const struct nls_table *nls_codepage)
{
@ -3114,7 +3118,7 @@ querySymLinkRetry:
* it is not compiled in by default until callers fixed up and more tested.
*/
int
CIFSSMBQueryReparseLinkInfo(const int xid, struct cifs_tcon *tcon,
CIFSSMBQueryReparseLinkInfo(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName,
char *symlinkinfo, const int buflen, __u16 fid,
const struct nls_table *nls_codepage)
@ -3351,7 +3355,7 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL,
}
int
CIFSSMBGetPosixACL(const int xid, struct cifs_tcon *tcon,
CIFSSMBGetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName,
char *acl_inf, const int buflen, const int acl_type,
const struct nls_table *nls_codepage, int remap)
@ -3440,7 +3444,7 @@ queryAclRetry:
}
int
CIFSSMBSetPosixACL(const int xid, struct cifs_tcon *tcon,
CIFSSMBSetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *fileName,
const char *local_acl, const int buflen,
const int acl_type,
@ -3520,7 +3524,7 @@ setACLerrorExit:
/* BB fix tabs in this function FIXME BB */
int
CIFSGetExtAttr(const int xid, struct cifs_tcon *tcon,
CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
const int netfid, __u64 *pExtAttrBits, __u64 *pMask)
{
int rc = 0;
@ -3695,7 +3699,7 @@ validate_ntransact(char *buf, char **ppparm, char **ppdata,
/* Get Security Descriptor (by handle) from remote server for a file or dir */
int
CIFSSMBGetCIFSACL(const int xid, struct cifs_tcon *tcon, __u16 fid,
CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
struct cifs_ntsd **acl_inf, __u32 *pbuflen)
{
int rc = 0;
@ -3787,7 +3791,7 @@ qsec_out:
}
int
CIFSSMBSetCIFSACL(const int xid, struct cifs_tcon *tcon, __u16 fid,
CIFSSMBSetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
struct cifs_ntsd *pntsd, __u32 acllen, int aclflag)
{
__u16 byte_count, param_count, data_count, param_offset, data_offset;
@ -3851,7 +3855,7 @@ setCifsAclRetry:
/* Legacy Query Path Information call for lookup to old servers such
as Win9x/WinME */
int SMBQueryInformation(const int xid, struct cifs_tcon *tcon,
int SMBQueryInformation(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName,
FILE_ALL_INFO *pFinfo,
const struct nls_table *nls_codepage, int remap)
@ -3920,7 +3924,7 @@ QInfRetry:
}
int
CIFSSMBQFileInfo(const int xid, struct cifs_tcon *tcon,
CIFSSMBQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
u16 netfid, FILE_ALL_INFO *pFindData)
{
struct smb_t2_qfi_req *pSMB = NULL;
@ -3987,7 +3991,7 @@ QFileInfoRetry:
}
int
CIFSSMBQPathInfo(const int xid, struct cifs_tcon *tcon,
CIFSSMBQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName,
FILE_ALL_INFO *pFindData,
int legacy /* old style infolevel */,
@ -4088,7 +4092,7 @@ QPathInfoRetry:
}
int
CIFSSMBUnixQFileInfo(const int xid, struct cifs_tcon *tcon,
CIFSSMBUnixQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
u16 netfid, FILE_UNIX_BASIC_INFO *pFindData)
{
struct smb_t2_qfi_req *pSMB = NULL;
@ -4157,7 +4161,7 @@ UnixQFileInfoRetry:
}
int
CIFSSMBUnixQPathInfo(const int xid, struct cifs_tcon *tcon,
CIFSSMBUnixQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName,
FILE_UNIX_BASIC_INFO *pFindData,
const struct nls_table *nls_codepage, int remap)
@ -4243,7 +4247,7 @@ UnixQPathInfoRetry:
/* xid, tcon, searchName and codepage are input parms, rest are returned */
int
CIFSFindFirst(const int xid, struct cifs_tcon *tcon,
CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon,
const char *searchName,
const struct nls_table *nls_codepage,
__u16 *pnetfid, __u16 search_flags,
@ -4388,8 +4392,9 @@ findFirstRetry:
return rc;
}
int CIFSFindNext(const int xid, struct cifs_tcon *tcon, __u16 searchHandle,
__u16 search_flags, struct cifs_search_info *psrch_inf)
int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
__u16 searchHandle, __u16 search_flags,
struct cifs_search_info *psrch_inf)
{
TRANSACTION2_FNEXT_REQ *pSMB = NULL;
TRANSACTION2_FNEXT_RSP *pSMBr = NULL;
@ -4523,7 +4528,7 @@ FNext2_err_exit:
}
int
CIFSFindClose(const int xid, struct cifs_tcon *tcon,
CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
const __u16 searchHandle)
{
int rc = 0;
@ -4555,7 +4560,7 @@ CIFSFindClose(const int xid, struct cifs_tcon *tcon,
}
int
CIFSGetSrvInodeNumber(const int xid, struct cifs_tcon *tcon,
CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName,
__u64 *inode_number,
const struct nls_table *nls_codepage, int remap)
@ -4762,7 +4767,7 @@ parse_DFS_referrals_exit:
}
int
CIFSGetDFSRefer(const int xid, struct cifs_ses *ses,
CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
const unsigned char *searchName,
struct dfs_info3_param **target_nodes,
unsigned int *num_of_nodes,
@ -4877,7 +4882,8 @@ GetDFSRefExit:
/* Query File System Info such as free space to old servers such as Win 9x */
int
SMBOldQFSInfo(const int xid, struct cifs_tcon *tcon, struct kstatfs *FSData)
SMBOldQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
struct kstatfs *FSData)
{
/* level 0x01 SMB_QUERY_FILE_SYSTEM_INFO */
TRANSACTION2_QFSI_REQ *pSMB = NULL;
@ -4956,7 +4962,8 @@ oldQFSInfoRetry:
}
int
CIFSSMBQFSInfo(const int xid, struct cifs_tcon *tcon, struct kstatfs *FSData)
CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
struct kstatfs *FSData)
{
/* level 0x103 SMB_QUERY_FILE_SYSTEM_INFO */
TRANSACTION2_QFSI_REQ *pSMB = NULL;
@ -5035,7 +5042,7 @@ QFSInfoRetry:
}
int
CIFSSMBQFSAttributeInfo(const int xid, struct cifs_tcon *tcon)
CIFSSMBQFSAttributeInfo(const unsigned int xid, struct cifs_tcon *tcon)
{
/* level 0x105 SMB_QUERY_FILE_SYSTEM_INFO */
TRANSACTION2_QFSI_REQ *pSMB = NULL;
@ -5105,7 +5112,7 @@ QFSAttributeRetry:
}
int
CIFSSMBQFSDeviceInfo(const int xid, struct cifs_tcon *tcon)
CIFSSMBQFSDeviceInfo(const unsigned int xid, struct cifs_tcon *tcon)
{
/* level 0x104 SMB_QUERY_FILE_SYSTEM_INFO */
TRANSACTION2_QFSI_REQ *pSMB = NULL;
@ -5176,7 +5183,7 @@ QFSDeviceRetry:
}
int
CIFSSMBQFSUnixInfo(const int xid, struct cifs_tcon *tcon)
CIFSSMBQFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon)
{
/* level 0x200 SMB_QUERY_CIFS_UNIX_INFO */
TRANSACTION2_QFSI_REQ *pSMB = NULL;
@ -5246,7 +5253,7 @@ QFSUnixRetry:
}
int
CIFSSMBSetFSUnixInfo(const int xid, struct cifs_tcon *tcon, __u64 cap)
CIFSSMBSetFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon, __u64 cap)
{
/* level 0x200 SMB_SET_CIFS_UNIX_INFO */
TRANSACTION2_SETFSI_REQ *pSMB = NULL;
@ -5320,7 +5327,7 @@ SETFSUnixRetry:
int
CIFSSMBQFSPosixInfo(const int xid, struct cifs_tcon *tcon,
CIFSSMBQFSPosixInfo(const unsigned int xid, struct cifs_tcon *tcon,
struct kstatfs *FSData)
{
/* level 0x201 SMB_QUERY_CIFS_POSIX_INFO */
@ -5413,8 +5420,8 @@ QFSPosixRetry:
in Samba which this routine can run into */
int
CIFSSMBSetEOF(const int xid, struct cifs_tcon *tcon, const char *fileName,
__u64 size, bool SetAllocation,
CIFSSMBSetEOF(const unsigned int xid, struct cifs_tcon *tcon,
const char *fileName, __u64 size, bool SetAllocation,
const struct nls_table *nls_codepage, int remap)
{
struct smb_com_transaction2_spi_req *pSMB = NULL;
@ -5502,7 +5509,7 @@ SetEOFRetry:
}
int
CIFSSMBSetFileSize(const int xid, struct cifs_tcon *tcon, __u64 size,
CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon, __u64 size,
__u16 fid, __u32 pid_of_opener, bool SetAllocation)
{
struct smb_com_transaction2_sfi_req *pSMB = NULL;
@ -5584,7 +5591,7 @@ CIFSSMBSetFileSize(const int xid, struct cifs_tcon *tcon, __u64 size,
time and resort to the original setpathinfo level which takes the ancient
DOS time format with 2 second granularity */
int
CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon,
CIFSSMBSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
const FILE_BASIC_INFO *data, __u16 fid, __u32 pid_of_opener)
{
struct smb_com_transaction2_sfi_req *pSMB = NULL;
@ -5647,7 +5654,7 @@ CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon,
}
int
CIFSSMBSetFileDisposition(const int xid, struct cifs_tcon *tcon,
CIFSSMBSetFileDisposition(const unsigned int xid, struct cifs_tcon *tcon,
bool delete_file, __u16 fid, __u32 pid_of_opener)
{
struct smb_com_transaction2_sfi_req *pSMB = NULL;
@ -5703,7 +5710,7 @@ CIFSSMBSetFileDisposition(const int xid, struct cifs_tcon *tcon,
}
int
CIFSSMBSetPathInfo(const int xid, struct cifs_tcon *tcon,
CIFSSMBSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
const char *fileName, const FILE_BASIC_INFO *data,
const struct nls_table *nls_codepage, int remap)
{
@ -5787,7 +5794,7 @@ SetTimesRetry:
handling it anyway and NT4 was what we thought it would be needed for
Do not delete it until we prove whether needed for Win9x though */
int
CIFSSMBSetAttrLegacy(int xid, struct cifs_tcon *tcon, char *fileName,
CIFSSMBSetAttrLegacy(unsigned int xid, struct cifs_tcon *tcon, char *fileName,
__u16 dos_attrs, const struct nls_table *nls_codepage)
{
SETATTR_REQ *pSMB = NULL;
@ -5875,7 +5882,7 @@ cifs_fill_unix_set_info(FILE_UNIX_BASIC_INFO *data_offset,
}
int
CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon,
CIFSSMBUnixSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
const struct cifs_unix_set_info_args *args,
u16 fid, u32 pid_of_opener)
{
@ -5939,7 +5946,8 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon,
}
int
CIFSSMBUnixSetPathInfo(const int xid, struct cifs_tcon *tcon, char *fileName,
CIFSSMBUnixSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
char *fileName,
const struct cifs_unix_set_info_args *args,
const struct nls_table *nls_codepage, int remap)
{
@ -6026,7 +6034,7 @@ setPermsRetry:
* the data isn't copied to it, but the length is returned.
*/
ssize_t
CIFSSMBQAllEAs(const int xid, struct cifs_tcon *tcon,
CIFSSMBQAllEAs(const unsigned int xid, struct cifs_tcon *tcon,
const unsigned char *searchName, const unsigned char *ea_name,
char *EAData, size_t buf_size,
const struct nls_table *nls_codepage, int remap)
@ -6209,8 +6217,8 @@ QAllEAsOut:
}
int
CIFSSMBSetEA(const int xid, struct cifs_tcon *tcon, const char *fileName,
const char *ea_name, const void *ea_value,
CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
const char *fileName, const char *ea_name, const void *ea_value,
const __u16 ea_value_len, const struct nls_table *nls_codepage,
int remap)
{
@ -6336,7 +6344,7 @@ SetEARetry:
* incompatible for network fs clients, we could instead simply
* expose this config flag by adding a future cifs (and smb2) notify ioctl.
*/
int CIFSSMBNotify(const int xid, struct cifs_tcon *tcon,
int CIFSSMBNotify(const unsigned int xid, struct cifs_tcon *tcon,
const int notify_subdirs, const __u16 netfid,
__u32 filter, struct file *pfile, int multishot,
const struct nls_table *nls_codepage)

40
fs/cifs/connect.c

@ -2267,9 +2267,9 @@ cifs_put_smb_ses(struct cifs_ses *ses)
spin_unlock(&cifs_tcp_ses_lock);
if (ses->status == CifsGood && server->ops->logoff) {
xid = GetXid();
xid = get_xid();
server->ops->logoff(xid, ses);
_FreeXid(xid);
_free_xid(xid);
}
sesInfoFree(ses);
cifs_put_tcp_session(server);
@ -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_in6 *addr6 = (struct sockaddr_in6 *)&server->dstaddr;
xid = GetXid();
xid = get_xid();
ses = cifs_find_smb_ses(server, volume_info);
if (ses) {
@ -2424,7 +2424,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
mutex_unlock(&ses->session_mutex);
/* problem -- put our ses reference */
cifs_put_smb_ses(ses);
FreeXid(xid);
free_xid(xid);
return ERR_PTR(rc);
}
if (ses->need_reconnect) {
@ -2435,7 +2435,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
mutex_unlock(&ses->session_mutex);
/* problem -- put our reference */
cifs_put_smb_ses(ses);
FreeXid(xid);
free_xid(xid);
return ERR_PTR(rc);
}
}
@ -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 */
cifs_put_tcp_session(server);
FreeXid(xid);
free_xid(xid);
return ses;
}
@ -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);
spin_unlock(&cifs_tcp_ses_lock);
FreeXid(xid);
free_xid(xid);
return ses;
get_ses_fail:
sesInfoFree(ses);
FreeXid(xid);
free_xid(xid);
return ERR_PTR(rc);
}
@ -2555,10 +2555,10 @@ cifs_put_tcon(struct cifs_tcon *tcon)
list_del_init(&tcon->tcon_list);
spin_unlock(&cifs_tcp_ses_lock);
xid = GetXid();
xid = get_xid();
if (ses->server->ops->tree_disconnect)
ses->server->ops->tree_disconnect(xid, tcon);
_FreeXid(xid);
_free_xid(xid);
cifs_fscache_release_super_cookie(tcon);
tconInfoFree(tcon);
@ -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
* 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,
volume_info->local_nls);
FreeXid(xid);
free_xid(xid);
cFYI(1, "Tcon rc = %d", rc);
if (rc)
goto out_fail;
@ -2764,7 +2764,7 @@ out:
}
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,
struct dfs_info3_param **referrals, int remap)
{
@ -3067,7 +3067,7 @@ ip_connect(struct TCP_Server_Info *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)
{
/* 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)
}
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)
{
int rc;
@ -3485,7 +3485,7 @@ build_unc_path_to_root(const struct smb_vol *vol,
* determine whether there were referrals.
*/
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,
int check_prefix)
{
@ -3595,7 +3595,7 @@ int
cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
{
int rc;
int xid;
unsigned int xid;
struct cifs_ses *pSesInfo;
struct cifs_tcon *tcon;
struct TCP_Server_Info *srvTcp;
@ -3618,7 +3618,7 @@ try_mount_again:
else if (pSesInfo)
cifs_put_smb_ses(pSesInfo);
FreeXid(xid);
free_xid(xid);
}
#endif
rc = 0;
@ -3628,7 +3628,7 @@ try_mount_again:
full_path = NULL;
tlink = NULL;
xid = GetXid();
xid = get_xid();
/* get a reference to a tcp session */
srvTcp = cifs_get_tcp_session(volume_info);
@ -3781,7 +3781,7 @@ mount_fail_check:
}
out:
FreeXid(xid);
free_xid(xid);
return rc;
}

43
fs/cifs/dir.c

@ -157,10 +157,10 @@ check_name(struct dentry *direntry)
/* 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,
int xid, struct tcon_link *tlink, unsigned oflags,
umode_t mode, __u32 *oplock, __u16 *fileHandle,
int *created)
static int
cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
struct tcon_link *tlink, unsigned oflags, umode_t mode,
__u32 *oplock, __u16 *fileHandle, int *created)
{
int rc = -ENOENT;
int create_options = CREATE_NOT_DIR;
@ -382,7 +382,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
int *opened)
{
int rc;
int xid;
unsigned int xid;
struct tcon_link *tlink;
struct cifs_tcon *tcon;
__u16 fileHandle;
@ -412,7 +412,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
if (rc)
return rc;
xid = GetXid();
xid = get_xid();
cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p",