]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
cifs: avoid a kmalloc in smb2_send_recv/SendReceive2 for the common case
authorRonnie Sahlberg <lsahlber@redhat.com>
Tue, 21 Nov 2017 04:08:07 +0000 (15:08 +1100)
committerSteve French <smfrench@gmail.com>
Thu, 25 Jan 2018 01:49:05 +0000 (19:49 -0600)
commit3cecf4865cd3ea31272750edf38e73c59ff7540c
treee3d41786d5e4390eaae2b1def522ca9f65a47dff
parent305428acf02490dfaf68d2052d03fe2d74cad241
cifs: avoid a kmalloc in smb2_send_recv/SendReceive2 for the common case

In both functions, use an array of 8 (arbitrary but should be big enough
for all current uses) iov and avoid having to kmalloc the array
for the common case.

If 8 is too small, then fall back to the original behaviour and use
kmalloc/kfree.

This should not change any behaviour but should save us a tiny amount of
cpu cycles.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
fs/cifs/transport.c