From: axboe@kernel.dk (Jens Axboe)
Subject: [PATCH 1/8] lib: Introduce sgl_alloc() and sgl_free()
Date: Thu, 12 Oct 2017 16:52:51 -0600 [thread overview]
Message-ID: <ee12eeaf-9848-478d-4ebe-9d3497e248e0@kernel.dk> (raw)
In-Reply-To: <20171012224550.25440-2-bart.vanassche@wdc.com>
On 10/12/2017 04:45 PM, Bart Van Assche wrote:
> Many kernel drivers contain code that allocate and free both a
> scatterlist and the pages that populate that scatterlist.
> Introduce functions under lib/ that perform these tasks instead
> of duplicating this functionality in multiple drivers.
>
> Signed-off-by: Bart Van Assche <bart.vanassche at wdc.com>
> ---
> include/linux/sgl_alloc.h | 16 ++++++++
> lib/Kconfig | 4 ++
> lib/Makefile | 1 +
> lib/sgl_alloc.c | 102 ++++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 123 insertions(+)
> create mode 100644 include/linux/sgl_alloc.h
> create mode 100644 lib/sgl_alloc.c
>
> diff --git a/include/linux/sgl_alloc.h b/include/linux/sgl_alloc.h
> new file mode 100644
> index 000000000000..a0f719690c9e
> --- /dev/null
> +++ b/include/linux/sgl_alloc.h
> @@ -0,0 +1,16 @@
> +#ifndef _SGL_ALLOC_H_
> +#define _SGL_ALLOC_H_
> +
> +#include <linux/types.h> /* bool, gfp_t */
> +
> +struct scatterlist;
> +
> +struct scatterlist *sgl_alloc_order(unsigned long long length,
> + unsigned int order, unsigned int *nent_p,
> + gfp_t gfp, bool chainable);
> +struct scatterlist *sgl_alloc(unsigned long long length, unsigned int *nent_p,
> + gfp_t gfp);
> +void sgl_free_order(struct scatterlist *sgl, int order);
> +void sgl_free(struct scatterlist *sgl);
> +
> +#endif /* _SGL_ALLOC_H_ */
Should this just go into linux/scatterlist.h instead of creating a new header
file?
--
Jens Axboe
next parent reply other threads:[~2017-10-12 22:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171012224550.25440-1-bart.vanassche@wdc.com>
[not found] ` <20171012224550.25440-2-bart.vanassche@wdc.com>
2017-10-12 22:52 ` Jens Axboe [this message]
2017-10-12 23:00 ` [PATCH 1/8] lib: Introduce sgl_alloc() and sgl_free() Bart Van Assche
2017-10-13 8:44 ` Johannes Thumshirn
2017-10-13 14:20 ` Jens Axboe
2017-10-13 17:43 ` Randy Dunlap
2017-10-13 17:56 ` Bart Van Assche
[not found] ` <20171012224550.25440-4-bart.vanassche@wdc.com>
2017-10-13 8:41 ` [PATCH 3/8] nvmet/fc: Use " Johannes Thumshirn
[not found] ` <20171012224550.25440-5-bart.vanassche@wdc.com>
2017-10-13 8:42 ` [PATCH 4/8] nvmet/rdma: " Johannes Thumshirn
[not found] ` <20171012224550.25440-7-bart.vanassche@wdc.com>
2017-10-13 8:45 ` [PATCH 6/8] scsi/ipr: Use sgl_alloc_order() and sgl_free_order() Johannes Thumshirn
[not found] ` <20171012224550.25440-8-bart.vanassche@wdc.com>
2017-10-13 8:45 ` [PATCH 7/8] scsi/pmcraid: Remove an unused structure member Johannes Thumshirn
[not found] ` <20171012224550.25440-9-bart.vanassche@wdc.com>
2017-10-13 8:47 ` [PATCH 8/8] scsi/pmcraid: Use sgl_alloc_order() and sgl_free_order() Johannes Thumshirn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ee12eeaf-9848-478d-4ebe-9d3497e248e0@kernel.dk \
--to=axboe@kernel.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox