git: 1d5100d9be2d - stable/13 - linuxkpi: Add `sg_alloc_table_from_pages_segment()`
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 16 Feb 2023 11:56:31 UTC
The branch stable/13 has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1d5100d9be2d97d2c74fe15f29a7a42cbada144b commit 1d5100d9be2d97d2c74fe15f29a7a42cbada144b Author: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> AuthorDate: 2023-02-10 15:37:31 +0000 Commit: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> CommitDate: 2023-02-16 11:55:20 +0000 linuxkpi: Add `sg_alloc_table_from_pages_segment()` Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38541 (cherry picked from commit f3490083b731700f2aa7c17ac6fe159826dc59a5) --- sys/compat/linuxkpi/common/include/linux/scatterlist.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h index d1a71258c27d..fe4bce06819d 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -427,6 +427,20 @@ sg_alloc_table_from_pages(struct sg_table *sgt, #endif } +static inline int +sg_alloc_table_from_pages_segment(struct sg_table *sgt, + struct page **pages, unsigned int count, unsigned int off, + unsigned long size, unsigned int max_segment, gfp_t gfp_mask) +{ +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51300 + return (PTR_ERR_OR_ZERO(__sg_alloc_table_from_pages(sgt, pages, count, off, size, + max_segment, NULL, 0, gfp_mask))); +#else + return (__sg_alloc_table_from_pages(sgt, pages, count, off, size, + max_segment, gfp_mask)); +#endif +} + static inline int sg_nents(struct scatterlist *sg) {