aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsproto.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2011-05-19 16:22:52 -0400
committerSteve French <sfrench@us.ibm.com>2011-05-22 22:58:24 -0400
commit2c8f981d93f830c167c811f046b5107cc24b6e1b (patch)
tree8150cda7231acf1afc073b2eaaed0947d1937e16 /fs/cifs/cifsproto.h
parent71a8638480eb8fb6cfabe2ee9ca3fbc6e3453a14 (diff)
cifs: consolidate SendReceive response checks
Further consolidate the SendReceive code by moving the checks run over the packet into a separate function that all the SendReceive variants can call. We can also eliminate the check for a receive_len that's too big or too small. cifs_demultiplex_thread already checks that and disconnects the socket if that occurs, while setting the midStatus to MALFORMED. It'll never call this code if that's the case. Finally do a little cleanup. Use "goto out" on errors so that the flow of code in the normal case is more evident. Also switch the logErr variable in map_smb_to_linux_error to a bool. Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsproto.h')
-rw-r--r--fs/cifs/cifsproto.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 6e69e06a30b..7aa13111288 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -76,6 +76,8 @@ extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *,
76 int * /* bytes returned */ , const int long_op); 76 int * /* bytes returned */ , const int long_op);
77extern int SendReceiveNoRsp(const unsigned int xid, struct cifsSesInfo *ses, 77extern int SendReceiveNoRsp(const unsigned int xid, struct cifsSesInfo *ses,
78 struct smb_hdr *in_buf, int flags); 78 struct smb_hdr *in_buf, int flags);
79extern int cifs_check_receive(struct mid_q_entry *mid,
80 struct TCP_Server_Info *server, bool log_error);
79extern int SendReceive2(const unsigned int /* xid */ , struct cifsSesInfo *, 81extern int SendReceive2(const unsigned int /* xid */ , struct cifsSesInfo *,
80 struct kvec *, int /* nvec to send */, 82 struct kvec *, int /* nvec to send */,
81 int * /* type of buf returned */ , const int flags); 83 int * /* type of buf returned */ , const int flags);
@@ -99,7 +101,7 @@ extern int cifs_convert_address(struct sockaddr *dst, const char *src, int len);
99extern int cifs_set_port(struct sockaddr *addr, const unsigned short int port); 101extern int cifs_set_port(struct sockaddr *addr, const unsigned short int port);
100extern int cifs_fill_sockaddr(struct sockaddr *dst, const char *src, int len, 102extern int cifs_fill_sockaddr(struct sockaddr *dst, const char *src, int len,
101 const unsigned short int port); 103 const unsigned short int port);
102extern int map_smb_to_linux_error(struct smb_hdr *smb, int logErr); 104extern int map_smb_to_linux_error(struct smb_hdr *smb, bool logErr);
103extern void header_assemble(struct smb_hdr *, char /* command */ , 105extern void header_assemble(struct smb_hdr *, char /* command */ ,
104 const struct cifsTconInfo *, int /* length of 106 const struct cifsTconInfo *, int /* length of
105 fixed section (word count) in two byte units */); 107 fixed section (word count) in two byte units */);