From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Axboe Subject: Re: [PATCH 1/8] lib: Introduce sgl_alloc() and sgl_free() Date: Fri, 13 Oct 2017 08:20:57 -0600 Message-ID: References: <20171012224550.25440-1-bart.vanassche@wdc.com> <20171012224550.25440-2-bart.vanassche@wdc.com> <1507849209.14112.1.camel@wdc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1507849209.14112.1.camel@wdc.com> Content-Language: en-US Sender: linux-block-owner@vger.kernel.org To: Bart Van Assche Cc: "linux-scsi@vger.kernel.org" , "linux-block@vger.kernel.org" , "linux-nvme@lists.infradead.org" List-Id: linux-scsi@vger.kernel.org On 10/12/2017 05:00 PM, Bart Van Assche wrote: > On Thu, 2017-10-12 at 16:52 -0600, Jens Axboe wrote: >> On 10/12/2017 04:45 PM, Bart Van Assche wrote: >>> +++ b/include/linux/sgl_alloc.h >>> @@ -0,0 +1,16 @@ >>> +#ifndef _SGL_ALLOC_H_ >>> +#define _SGL_ALLOC_H_ >>> + >>> +#include /* 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? > > That's something I can change. I don't have a strong opinion about whether > these declarations should go into a new header file or into linux/scatterlist.h. I think you should make that change, keep things simpler. As Johannes suggested, you could move the code to lib/scatterlist.c as well. I would recommend keeping the kconfig option to only build it when needed, though. -- Jens Axboe