summaryrefslogtreecommitdiff
path: root/include/linux/scatterlist.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-10-17 03:45:05 +0300
committerDave Airlie <airlied@redhat.com>2017-10-17 03:53:43 +0300
commitbd21a37d41c3b3088aeae59f54fd82de0ddb6fdd (patch)
tree985dc5b65d2adb36a3671e78a174b3aaac4b6f50 /include/linux/scatterlist.h
parentd7205d5c0f2b09d900231de9026b97105c37d343 (diff)
parent6c94804fde4415f3938778155d8e665e6870a46d (diff)
downloadlinux-bd21a37d41c3b3088aeae59f54fd82de0ddb6fdd.tar.xz
Merge remote-tracking branch 'pfdo/drm-next' into drm-next
Pull in drm-next for the object find API changes. Fix the one place the API crashes. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/linux/scatterlist.h')
-rw-r--r--include/linux/scatterlist.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 4b3286ac60c8..874b50c232de 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -21,6 +21,12 @@ struct scatterlist {
};
/*
+ * Since the above length field is an unsigned int, below we define the maximum
+ * length in bytes that can be stored in one scatterlist entry.
+ */
+#define SCATTERLIST_MAX_SEGMENT (UINT_MAX & PAGE_MASK)
+
+/*
* These macros should be used after a dma_map_sg call has been done
* to get bus addresses of each of the SG entries and their lengths.
* You should only work with the number of sg entries dma_map_sg
@@ -261,10 +267,13 @@ void sg_free_table(struct sg_table *);
int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int,
struct scatterlist *, gfp_t, sg_alloc_fn *);
int sg_alloc_table(struct sg_table *, unsigned int, gfp_t);
-int sg_alloc_table_from_pages(struct sg_table *sgt,
- struct page **pages, unsigned int n_pages,
- unsigned long offset, unsigned long size,
- gfp_t gfp_mask);
+int __sg_alloc_table_from_pages(struct sg_table *sgt, struct page **pages,
+ unsigned int n_pages, unsigned int offset,
+ unsigned long size, unsigned int max_segment,
+ gfp_t gfp_mask);
+int sg_alloc_table_from_pages(struct sg_table *sgt, struct page **pages,
+ unsigned int n_pages, unsigned int offset,
+ unsigned long size, gfp_t gfp_mask);
size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
size_t buflen, off_t skip, bool to_buffer);