Browse Source

smb2: limit the read size

This fixes slow probing/seeking when using prefetch since it requests big data
size (16MB) for each read().

(cherry picked from commit 083a78510e)
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
pull/135/head
Thomas Guillem 7 years ago
parent
commit
2cad645b3d
  1. 6
      modules/access/smb2.c

6
modules/access/smb2.c

@ -241,6 +241,12 @@ FileRead(stream_t *access, void *buf, size_t len)
if (sys->eof)
return 0;
/* Limit the read size since smb2_read_async() will complete only after
* reading the whole requested data and not when whatever data is available
* (high read size means a faster I/O but a higher latency). */
if (len > 262144)
len = 262144;
sys->res.read.len = 0;
if (smb2_read_async(sys->smb2, sys->smb2fh, buf, len,
smb2_read_cb, access) < 0)

Loading…
Cancel
Save