summaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorJeff Layton2011-10-19 21:29:49 +0200
committerJeff Layton2011-10-19 21:29:49 +0200
commit44d22d846fdc7c3e688fc1ff5ae6d06d08bb5656 (patch)
treea7c55381c4eee74c2be9a4dc0728f0a927367d04 /fs/cifs/connect.c
parentcifs: break out 3rd receive phase into separate function (diff)
downloadkernel-qcow2-linux-44d22d846fdc7c3e688fc1ff5ae6d06d08bb5656.tar.gz
kernel-qcow2-linux-44d22d846fdc7c3e688fc1ff5ae6d06d08bb5656.tar.xz
kernel-qcow2-linux-44d22d846fdc7c3e688fc1ff5ae6d06d08bb5656.zip
cifs: add a callback function to receive the rest of the frame
In order to handle larger SMBs for readpages and other calls, we want to be able to read into a preallocated set of buffers. Rather than changing all of the existing code to preallocate buffers however, we instead add a receive callback function to the MID. cifsd will call this function once the mid_q_entry has been identified in order to receive the rest of the SMB. If the mid can't be identified or the receive pointer is unset, then the standard 3rd phase receive function will be called. Reviewed-and-Tested-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index f05dedda37c6..eeee2f5d13ce 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -824,7 +824,11 @@ cifs_demultiplex_thread(void *p)
mid_entry = find_mid(server, smb_buffer);
- length = standard_receive3(server, mid_entry);
+ if (!mid_entry || !mid_entry->receive)
+ length = standard_receive3(server, mid_entry);
+ else
+ length = mid_entry->receive(server, mid_entry);
+
if (length < 0)
continue;