git: 2686b10db41c - main - linuxkpi: Add sg_init_one
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 11 Oct 2021 10:53:39 UTC
The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=2686b10db41c79dd1a0a0c33a7e0c0b67e0701cc commit 2686b10db41c79dd1a0a0c33a7e0c0b67e0701cc Author: Alex Richardson <arichardson@FreeBSD.org> AuthorDate: 2021-10-08 08:32:46 +0000 Commit: Alex Richardson <arichardson@FreeBSD.org> CommitDate: 2021-10-11 10:51:43 +0000 linuxkpi: Add sg_init_one Needed for the virtio-gpu driver. Reviewed By: #linuxkpi, manu, bz, hselasky Differential Revision: https://reviews.freebsd.org/D32366 --- sys/compat/linuxkpi/common/include/linux/scatterlist.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h index 13ee34cf9448..295ca2ba3cfd 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -182,6 +182,13 @@ sg_init_table(struct scatterlist *sg, unsigned int nents) sg_mark_end(&sg[nents - 1]); } +static inline void +sg_init_one(struct scatterlist *sg, const void *buf, unsigned int buflen) +{ + sg_init_table(sg, 1); + sg_set_buf(sg, buf, buflen); +} + static struct scatterlist * sg_kmalloc(unsigned int nents, gfp_t gfp_mask) {