• Akinobu Mita's avatar
    lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next() · 11052004
    Akinobu Mita authored
    This patchset introduces sg_pcopy_from_buffer() and sg_pcopy_to_buffer(),
    which copy data between a linear buffer and an SG list.
    
    The only difference between sg_pcopy_{from,to}_buffer() and
    sg_copy_{from,to}_buffer() is an additional argument that specifies the
    number of bytes to skip the SG list before copying.
    
    The main reason for introducing these functions is to fix a problem in
    scsi_debug module.  And there is a local function in crypto/talitos
    module, which can be replaced by sg_pcopy_to_buffer().
    
    This patch:
    
    sg_miter_get_next_page() is used to proceed page iterator to the next page
    if necessary, and will be used to implement the variants of
    sg_copy_{from,to}_buffer() later.
    Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
    Acked-by: default avatarTejun Heo <tj@kernel.org>
    Cc: Tejun Heo <tj@kernel.org>
    Cc: Imre Deak <imre.deak@intel.com>
    Cc: Herbert Xu <herbert@gondor.apana.org.au>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
    Cc: Douglas Gilbert <dgilbert@interlog.com>
    Cc: Horia Geanta <horia.geanta@freescale.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    11052004
scatterlist.c 15.7 KB