• Jeff Layton's avatar
    libceph: add new iov_iter-based ceph_msg_data_type and ceph_osd_data_type · dee0c5f8
    Jeff Layton authored
    Add an iov_iter to the unions in ceph_msg_data and ceph_msg_data_cursor.
    Instead of requiring a list of pages or bvecs, we can just use an
    iov_iter directly, and avoid extra allocations.
    
    We assume that the pages represented by the iter are pinned such that
    they shouldn't incur page faults, which is the case for the iov_iters
    created by netfs.
    
    While working on this, Al Viro informed me that he was going to change
    iov_iter_get_pages to auto-advance the iterator as that pattern is more
    or less required for ITER_PIPE anyway. We emulate that here for now by
    advancing in the _next op and tracking that amount in the "lastlen"
    field.
    
    In the event that _next is called twice without an intervening
    _advance, we revert the iov_iter by the remaining lastlen before
    calling iov_iter_get_pages.
    
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: David Howells <dhowells@redhat.com>
    Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
    Reviewed-by: default avatarXiubo Li <xiubli@redhat.com>
    Reviewed-and-tested-by: default avatarLuís Henriques <lhenriques@suse.de>
    Reviewed-by: default avatarMilind Changire <mchangir@redhat.com>
    Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
    dee0c5f8
osd_client.c 154 KB