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>
Showing
- drivers/block/drbd/drbd_main.c 1 addition, 1 deletiondrivers/block/drbd/drbd_main.c
- drivers/block/drbd/drbd_receiver.c 1 addition, 1 deletiondrivers/block/drbd/drbd_receiver.c
- drivers/block/loop.c 4 additions, 5 deletionsdrivers/block/loop.c
- drivers/block/nbd.c 5 additions, 7 deletionsdrivers/block/nbd.c
- drivers/fsi/fsi-sbefifo.c 2 additions, 2 deletionsdrivers/fsi/fsi-sbefifo.c
- drivers/isdn/mISDN/l1oip_core.c 1 addition, 2 deletionsdrivers/isdn/mISDN/l1oip_core.c
- drivers/misc/vmw_vmci/vmci_queue_pair.c 3 additions, 3 deletionsdrivers/misc/vmw_vmci/vmci_queue_pair.c
- drivers/nvme/target/io-cmd-file.c 1 addition, 1 deletiondrivers/nvme/target/io-cmd-file.c
- drivers/target/iscsi/iscsi_target_util.c 2 additions, 4 deletionsdrivers/target/iscsi/iscsi_target_util.c
- drivers/target/target_core_file.c 3 additions, 3 deletionsdrivers/target/target_core_file.c
- drivers/usb/usbip/usbip_common.c 1 addition, 1 deletiondrivers/usb/usbip/usbip_common.c
- drivers/xen/pvcalls-back.c 4 additions, 4 deletionsdrivers/xen/pvcalls-back.c
- fs/9p/vfs_addr.c 2 additions, 2 deletionsfs/9p/vfs_addr.c
- fs/9p/vfs_dir.c 1 addition, 1 deletionfs/9p/vfs_dir.c
- fs/9p/xattr.c 2 additions, 2 deletionsfs/9p/xattr.c
- fs/afs/rxrpc.c 7 additions, 8 deletionsfs/afs/rxrpc.c
- fs/ceph/file.c 2 additions, 3 deletionsfs/ceph/file.c
- fs/cifs/connect.c 2 additions, 2 deletionsfs/cifs/connect.c
- fs/cifs/misc.c 1 addition, 1 deletionfs/cifs/misc.c
- fs/cifs/smb2ops.c 2 additions, 2 deletionsfs/cifs/smb2ops.c
Loading
Please register or sign in to comment