]> git.ipfire.org Git - thirdparty/linux.git/commit - fs/cifs/smb2ops.c
iov_iter: Separate type from direction and use accessor functions
authorDavid Howells <dhowells@redhat.com>
Fri, 19 Oct 2018 23:57:56 +0000 (00:57 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 23 Oct 2018 23:41:07 +0000 (00:41 +0100)
commitaa563d7bca6e882ec2bdae24603c8f016401a144
tree874b10fc11da3178e4630f7a430e1b299d3b3806
parent00e23707442a75b404392cef1405ab4fd498de6b
iov_iter: Separate type from direction and use accessor functions

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>
40 files changed:
drivers/block/drbd/drbd_main.c
drivers/block/drbd/drbd_receiver.c
drivers/block/loop.c
drivers/block/nbd.c
drivers/fsi/fsi-sbefifo.c
drivers/isdn/mISDN/l1oip_core.c
drivers/misc/vmw_vmci/vmci_queue_pair.c
drivers/nvme/target/io-cmd-file.c
drivers/target/iscsi/iscsi_target_util.c
drivers/target/target_core_file.c
drivers/usb/usbip/usbip_common.c
drivers/xen/pvcalls-back.c
fs/9p/vfs_addr.c
fs/9p/vfs_dir.c
fs/9p/xattr.c
fs/afs/rxrpc.c
fs/ceph/file.c
fs/cifs/connect.c
fs/cifs/misc.c
fs/cifs/smb2ops.c
fs/cifs/transport.c
fs/dlm/lowcomms.c
fs/nfsd/vfs.c
fs/ocfs2/cluster/tcp.c
fs/orangefs/inode.c
fs/splice.c
include/linux/uio.h
lib/iov_iter.c
mm/page_io.c
net/9p/client.c
net/bluetooth/6lowpan.c
net/bluetooth/a2mp.c
net/bluetooth/smp.c
net/ceph/messenger.c
net/netfilter/ipvs/ip_vs_sync.c
net/smc/smc_clc.c
net/socket.c
net/sunrpc/svcsock.c
net/tipc/topsrv.c
net/tls/tls_device.c