Commit 61e74801 authored by Steve French's avatar Steve French

[CIFS] various minor cleanups pointed out by checkpatch script

Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 3de2091a
...@@ -36,7 +36,9 @@ Miklos Szeredi ...@@ -36,7 +36,9 @@ Miklos Szeredi
Kazeon team for various fixes especially for 2.4 version. Kazeon team for various fixes especially for 2.4 version.
Asser Ferno (Change Notify support) Asser Ferno (Change Notify support)
Shaggy (Dave Kleikamp) for inumerable small fs suggestions and some good cleanup Shaggy (Dave Kleikamp) for inumerable small fs suggestions and some good cleanup
Gunter Kukkukk (testing and suggestions for support of old servers)
Igor Mammedov (DFS support) Igor Mammedov (DFS support)
Jeff Layton (many, many fixes, as well as great work on the cifs Kerberos code)
Test case and Bug Report contributors Test case and Bug Report contributors
------------------------------------- -------------------------------------
......
...@@ -347,7 +347,6 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) ...@@ -347,7 +347,6 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m)
if (cifs_sb) { if (cifs_sb) {
tcon = cifs_sb->tcon; tcon = cifs_sb->tcon;
if (tcon) { if (tcon) {
/* BB add prepath to mount options displayed */
seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName); seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName);
if (tcon->ses) { if (tcon->ses) {
if (tcon->ses->userName) if (tcon->ses->userName)
...@@ -439,9 +438,8 @@ int cifs_xquota_set(struct super_block *sb, int quota_type, qid_t qid, ...@@ -439,9 +438,8 @@ int cifs_xquota_set(struct super_block *sb, int quota_type, qid_t qid,
xid = GetXid(); xid = GetXid();
if (pTcon) { if (pTcon) {
cFYI(1, ("set type: 0x%x id: %d", quota_type, qid)); cFYI(1, ("set type: 0x%x id: %d", quota_type, qid));
} else { } else
rc = -EIO; rc = -EIO;
}
FreeXid(xid); FreeXid(xid);
return rc; return rc;
...@@ -463,9 +461,8 @@ int cifs_xquota_get(struct super_block *sb, int quota_type, qid_t qid, ...@@ -463,9 +461,8 @@ int cifs_xquota_get(struct super_block *sb, int quota_type, qid_t qid,
xid = GetXid(); xid = GetXid();
if (pTcon) { if (pTcon) {
cFYI(1, ("set type: 0x%x id: %d", quota_type, qid)); cFYI(1, ("set type: 0x%x id: %d", quota_type, qid));
} else { } else
rc = -EIO; rc = -EIO;
}
FreeXid(xid); FreeXid(xid);
return rc; return rc;
...@@ -486,9 +483,8 @@ int cifs_xstate_set(struct super_block *sb, unsigned int flags, int operation) ...@@ -486,9 +483,8 @@ int cifs_xstate_set(struct super_block *sb, unsigned int flags, int operation)
xid = GetXid(); xid = GetXid();
if (pTcon) { if (pTcon) {
cFYI(1, ("flags: 0x%x operation: 0x%x", flags, operation)); cFYI(1, ("flags: 0x%x operation: 0x%x", flags, operation));
} else { } else
rc = -EIO; rc = -EIO;
}
FreeXid(xid); FreeXid(xid);
return rc; return rc;
...@@ -501,17 +497,16 @@ int cifs_xstate_get(struct super_block *sb, struct fs_quota_stat *qstats) ...@@ -501,17 +497,16 @@ int cifs_xstate_get(struct super_block *sb, struct fs_quota_stat *qstats)
struct cifs_sb_info *cifs_sb = CIFS_SB(sb); struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
struct cifsTconInfo *pTcon; struct cifsTconInfo *pTcon;
if (cifs_sb) { if (cifs_sb)
pTcon = cifs_sb->tcon; pTcon = cifs_sb->tcon;
} else { else
return -EIO; return -EIO;
}
xid = GetXid(); xid = GetXid();
if (pTcon) { if (pTcon) {
cFYI(1, ("pqstats %p", qstats)); cFYI(1, ("pqstats %p", qstats));
} else { } else
rc = -EIO; rc = -EIO;
}
FreeXid(xid); FreeXid(xid);
return rc; return rc;
......
...@@ -1922,7 +1922,7 @@ typedef struct smb_com_transaction2_get_dfs_refer_req { ...@@ -1922,7 +1922,7 @@ typedef struct smb_com_transaction2_get_dfs_refer_req {
/* DFS server target type */ /* DFS server target type */
#define DFS_TYPE_LINK 0x0000 /* also for sysvol targets */ #define DFS_TYPE_LINK 0x0000 /* also for sysvol targets */
#define DFS_TYPE_ROOT 0x0001 #define DFS_TYPE_ROOT 0x0001
/* Referral Entry Flags */ /* Referral Entry Flags */
#define DFS_NAME_LIST_REF 0x0200 #define DFS_NAME_LIST_REF 0x0200
......
...@@ -1382,13 +1382,13 @@ CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon, ...@@ -1382,13 +1382,13 @@ CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon,
if (cpu_to_le32(FILE_CREATE) == pSMBr->CreateAction) if (cpu_to_le32(FILE_CREATE) == pSMBr->CreateAction)
*pOplock |= CIFS_CREATE_ACTION; *pOplock |= CIFS_CREATE_ACTION;
if (pfile_info) { if (pfile_info) {
memcpy((char *)pfile_info, (char *)&pSMBr->CreationTime, memcpy((char *)pfile_info, (char *)&pSMBr->CreationTime,
36 /* CreationTime to Attributes */); 36 /* CreationTime to Attributes */);
/* the file_info buf is endian converted by caller */ /* the file_info buf is endian converted by caller */
pfile_info->AllocationSize = pSMBr->AllocationSize; pfile_info->AllocationSize = pSMBr->AllocationSize;
pfile_info->EndOfFile = pSMBr->EndOfFile; pfile_info->EndOfFile = pSMBr->EndOfFile;
pfile_info->NumberOfLinks = cpu_to_le32(1); pfile_info->NumberOfLinks = cpu_to_le32(1);
pfile_info->DeletePending = 0; pfile_info->DeletePending = 0;
} }
} }
...@@ -1558,7 +1558,7 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon, ...@@ -1558,7 +1558,7 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon,
pSMB->DataOffset = pSMB->DataOffset =
cpu_to_le16(offsetof(struct smb_com_write_req, Data) - 4); cpu_to_le16(offsetof(struct smb_com_write_req, Data) - 4);
if (buf) if (buf)
memcpy(pSMB->Data, buf, bytes_sent); memcpy(pSMB->Data, buf, bytes_sent);
else if (ubuf) { else if (ubuf) {
if (copy_from_user(pSMB->Data, ubuf, bytes_sent)) { if (copy_from_user(pSMB->Data, ubuf, bytes_sent)) {
cifs_buf_release(pSMB); cifs_buf_release(pSMB);
......
...@@ -2582,7 +2582,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, ...@@ -2582,7 +2582,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
__u16 action = le16_to_cpu(pSMBr->resp.Action); __u16 action = le16_to_cpu(pSMBr->resp.Action);
__u16 blob_len = le16_to_cpu(pSMBr->resp.SecurityBlobLength); __u16 blob_len = le16_to_cpu(pSMBr->resp.SecurityBlobLength);
if (action & GUEST_LOGIN) if (action & GUEST_LOGIN)
cFYI(1, (" Guest login")); /* BB mark SesInfo struct? */ cFYI(1, ("Guest login")); /* BB mark SesInfo struct? */
ses->Suid = smb_buffer_response->Uid; /* UID left in wire format ses->Suid = smb_buffer_response->Uid; /* UID left in wire format
(little endian) */ (little endian) */
cFYI(1, ("UID = %d ", ses->Suid)); cFYI(1, ("UID = %d ", ses->Suid));
...@@ -2728,13 +2728,11 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, ...@@ -2728,13 +2728,11 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
len)); len));
} }
} else { } else {
cERROR(1, cERROR(1, ("Security Blob Length extends beyond "
(" Security Blob Length extends beyond "
"end of SMB")); "end of SMB"));
} }
} else { } else {
cERROR(1, cERROR(1, ("Invalid Word count %d: ",
(" Invalid Word count %d: ",
smb_buffer_response->WordCount)); smb_buffer_response->WordCount));
rc = -EIO; rc = -EIO;
} }
...@@ -2892,7 +2890,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, ...@@ -2892,7 +2890,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
__u16 blob_len = le16_to_cpu(pSMBr->resp.SecurityBlobLength); __u16 blob_len = le16_to_cpu(pSMBr->resp.SecurityBlobLength);
if (action & GUEST_LOGIN) if (action & GUEST_LOGIN)
cFYI(1, (" Guest login")); cFYI(1, ("Guest login"));
/* Do we want to set anything in SesInfo struct when guest login? */ /* Do we want to set anything in SesInfo struct when guest login? */
bcc_ptr = pByteArea(smb_buffer_response); bcc_ptr = pByteArea(smb_buffer_response);
...@@ -2900,8 +2898,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, ...@@ -2900,8 +2898,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
SecurityBlob2 = (PCHALLENGE_MESSAGE) bcc_ptr; SecurityBlob2 = (PCHALLENGE_MESSAGE) bcc_ptr;
if (SecurityBlob2->MessageType != NtLmChallenge) { if (SecurityBlob2->MessageType != NtLmChallenge) {
cFYI(1, cFYI(1, ("Unexpected NTLMSSP message type received %d",
("Unexpected NTLMSSP message type received %d",
SecurityBlob2->MessageType)); SecurityBlob2->MessageType));
} else if (ses) { } else if (ses) {
ses->Suid = smb_buffer_response->Uid; /* UID left in le format */ ses->Suid = smb_buffer_response->Uid; /* UID left in le format */
...@@ -3073,8 +3070,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, ...@@ -3073,8 +3070,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
cERROR(1, ("No session structure passed in.")); cERROR(1, ("No session structure passed in."));
} }
} else { } else {
cERROR(1, cERROR(1, ("Invalid Word count %d:",
(" Invalid Word count %d:",
smb_buffer_response->WordCount)); smb_buffer_response->WordCount));
rc = -EIO; rc = -EIO;
} }
...@@ -3313,7 +3309,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, ...@@ -3313,7 +3309,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
__u16 action = le16_to_cpu(pSMBr->resp.Action); __u16 action = le16_to_cpu(pSMBr->resp.Action);
__u16 blob_len = le16_to_cpu(pSMBr->resp.SecurityBlobLength); __u16 blob_len = le16_to_cpu(pSMBr->resp.SecurityBlobLength);
if (action & GUEST_LOGIN) if (action & GUEST_LOGIN)
cFYI(1, (" Guest login")); /* BB Should we set anything cFYI(1, ("Guest login")); /* BB Should we set anything
in SesInfo struct ? */ in SesInfo struct ? */
/* if (SecurityBlob2->MessageType != NtLm??) { /* if (SecurityBlob2->MessageType != NtLm??) {
cFYI("Unexpected message type on auth response is %d")); cFYI("Unexpected message type on auth response is %d"));
......
...@@ -483,7 +483,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, ...@@ -483,7 +483,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
xid = GetXid(); xid = GetXid();
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));
/* check whether path exists */ /* check whether path exists */
...@@ -515,12 +515,11 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, ...@@ -515,12 +515,11 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
} }
if (direntry->d_inode != NULL) { if (direntry->d_inode != NULL) {
cFYI(1, (" non-NULL inode in lookup")); cFYI(1, ("non-NULL inode in lookup"));
} else { } else {
cFYI(1, (" NULL inode in lookup")); cFYI(1, ("NULL inode in lookup"));
} }
cFYI(1, cFYI(1, ("Full path: %s inode = 0x%p", full_path, direntry->d_inode));
(" Full path: %s inode = 0x%p", full_path, direntry->d_inode));
if (pTcon->unix_ext) if (pTcon->unix_ext)
rc = cifs_get_inode_info_unix(&newInode, full_path, rc = cifs_get_inode_info_unix(&newInode, full_path,
......
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