compat: backport sg page iterator a321e91b

This backports commit a321e91b which adds the
scatterlist simple page iterator.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains a321e91b
v3.9-rc1~46^2~149

commit a321e91b6d73ed011ffceed384c40d2785cf723b
Author: Imre Deak <imre.deak@intel.com>
Date:   Wed Feb 27 17:02:56 2013 -0800

    lib/scatterlist: add simple page iterator

    Add an iterator to walk through a scatter list a page at a time starting
    at a specific page offset.  As opposed to the mapping iterator this is
    meant to be small, performing well even in simple loops like collecting
    all pages on the scatterlist into an array or setting up an iommu table
    based on the pages' DMA address.

    Signed-off-by: Imre Deak <imre.deak@intel.com>
    Cc: Maxim Levitsky <maximlevitsky@gmail.com>
    Cc: Tejun Heo <tj@kernel.org>
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Tested-by: Stephen Warren <swarren@wwwdotorg.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
compat: fix backport_ prefix change on compat module

The commit a05e783c addressed the main compat module
routine name changes but failed to fix two calls. Fix
this.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
compat: backport sg_alloc_table_from_pages() from efc42bc9

This backports sg_alloc_table_from_pages() added via commit efc42bc9

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains efc42bc9
v3.6-rc1~57^2~11

commit efc42bc98058a36d761b16a114823db1a902ed05
Author: Tomasz Stanislawski <t.stanislaws@samsung.com>
Date:   Mon Jun 18 09:25:01 2012 +0200

    scatterlist: add sg_alloc_table_from_pages function

    This patch adds a new constructor for an sg table. The table is constructed
    from an array of struct pages. All contiguous chunks of the pages are merged
    into a single sg nodes. A user may provide an offset and a size of a buffer if
    the buffer is not page-aligned.

    The function is dedicated for DMABUF exporters which often perform conversion
    from an page array to a scatterlist. Moreover the scatterlist should be
    squashed in order to save memory and to speed-up the process of DMA mapping
    using dma_map_sg.

    The code is based on the patch 'v4l: vb2-dma-contig: add support for
    scatterlist in userptr mode' and hints from Laurent Pinchart.

    Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
    Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
    Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
    CC: Andrew Morton <akpm@linux-foundation.org>

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
compat: backport lib/scatterlist.c from 0db9299f

Backport the lib/scatterlist.c addition, this required
just removing the kmemleak stuff as that is not available
on older kernels.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 0db9299f
v2.6.25-rc1~1173^2~2

commit 0db9299f48ebd4a860d6ad4e1d36ac50671d48e7
Author: Jens Axboe <jens.axboe@oracle.com>
Date:   Fri Nov 30 09:16:50 2007 +0100

    SG: Move functions to lib/scatterlist.c and add sg chaining allocator helpers

    Manually doing chained sg lists is not trivial, so add some helpers
    to make sure that drivers get it right.

    Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.65              [  OK  ]
18  3.1.10              [  OK  ]
19  3.2.38              [  OK  ]
20  3.3.8               [  OK  ]
21  3.4.32              [  OK  ]
22  3.5.7               [  OK  ]
23  3.6.11              [  OK  ]
24  3.7.9               [  OK  ]
25  3.8.0               [  OK  ]
26  3.9-rc1             [  OK  ]

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>