anolis-cloud-kernel/net/tls
David Howells c8b49a3879 iov_iter: Separate type from direction and use accessor functions
commit aa563d7bca upstream.

In the iov_iter struct, separate the iterator type from the iterator
direction and use accessor functions to access them in most places.

Convert a bunch of places to use switch-statements to access them rather
then chains of bitwise-AND statements.  This makes it easier to add further
iterator types.  Also, this can be more efficient as to implement a switch
of small contiguous integers, the compiler can use ~50% fewer compare
instructions than it has to use bitwise-and instructions.

Further, cease passing the iterator type into the iterator setup function.
The iterator function can set that itself.  Only the direction is required.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Reviewed-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Acked-by: Caspar Zhang <caspar@linux.alibaba.com>
2020-01-17 16:08:03 +08:00
..
Kconfig net/tls: Add generic NIC offload infrastructure 2018-05-01 09:42:47 -04:00
Makefile net/tls: Add generic NIC offload infrastructure 2018-05-01 09:42:47 -04:00
tls_device.c iov_iter: Separate type from direction and use accessor functions 2020-01-17 16:08:03 +08:00
tls_device_fallback.c net/tls: avoid NULL pointer deref on nskb->sk in fallback 2019-05-05 14:42:38 +02:00
tls_main.c net: tls, fix sk_write_space NULL write when tx disabled 2019-09-06 10:22:04 +02:00
tls_sw.c iov_iter: Use accessor function 2020-01-17 16:08:03 +08:00