diff options
author | Jeff Layton <jlayton@redhat.com> | 2011-05-19 22:22:52 +0200 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-05-23 04:58:24 +0200 |
commit | 2c8f981d93f830c167c811f046b5107cc24b6e1b (patch) | |
tree | 8150cda7231acf1afc073b2eaaed0947d1937e16 /fs/cifs/netmisc.c | |
parent | Merge branch 'viafb-next' of git://github.com/schandinat/linux-2.6 (diff) | |
download | linux-2c8f981d93f830c167c811f046b5107cc24b6e1b.tar.xz linux-2c8f981d93f830c167c811f046b5107cc24b6e1b.zip |
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/netmisc.c')
-rw-r--r-- | fs/cifs/netmisc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index 79b71c2c7c9d..73e47e84b61a 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c @@ -836,7 +836,7 @@ ntstatus_to_dos(__u32 ntstatus, __u8 *eclass, __u16 *ecode) } int -map_smb_to_linux_error(struct smb_hdr *smb, int logErr) +map_smb_to_linux_error(struct smb_hdr *smb, bool logErr) { unsigned int i; int rc = -EIO; /* if transport error smb error may not be set */ |