From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "hare@suse.de" <hare@suse.de>, "axboe@kernel.dk" <axboe@kernel.dk>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"nab@linux-iscsi.org" <nab@linux-iscsi.org>,
"sagi@grimberg.me" <sagi@grimberg.me>, "hch@lst.de" <hch@lst.de>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"hare@suse.com" <hare@suse.com>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>
Subject: Re: [PATCH v2 5/8] target: Use sgl_alloc_order() and sgl_free()
Date: Tue, 17 Oct 2017 14:31:11 +0000 [thread overview]
Message-ID: <1508250670.3596.2.camel@wdc.com> (raw)
In-Reply-To: <c5e05f84-2602-5c3f-521e-6f35601011cf@suse.de>
On Tue, 2017-10-17 at 08:14 +0200, Hannes Reinecke wrote:
> On 10/17/2017 12:49 AM, Bart Van Assche wrote:
> > [ ... ]
> > void target_free_sgl(struct scatterlist *sgl, int nents)
> > {
> > - struct scatterlist *sg;
> > - int count;
> > -
> > - for_each_sg(sgl, sg, nents, count)
> > - __free_page(sg_page(sg));
> > -
> > - kfree(sgl);
> > + sgl_free(sgl);
> > }
> > EXPORT_SYMBOL(target_free_sgl);
> >
> > @@ -2423,42 +2417,10 @@ int
> > target_alloc_sgl(struct scatterlist **sgl, unsigned int *nents, u32 length,
> > bool zero_page, bool chainable)
> > {
> > - [ ... ]
> > + *sgl = sgl_alloc_order(length, 0, chainable, gfp, nents);
> > + return *sgl ? 0 : -ENOMEM;
> > }
> > EXPORT_SYMBOL(target_alloc_sgl);
> >
> > The calling convention from target_alloc_sgl() is decidedly dodgy.
>
> Can't we convert it into returning the sgl, and remove the first parameter?
Hello Hannes,
Another option is to remove the target_alloc_sgl() and target_free_sgl() functions
and to make LIO target drivers call sgl_alloc_order() and sgl_free_order() directly.
Do you perhaps have a preference for one of these two approaches?
Thanks,
Bart.
next prev parent reply other threads:[~2017-10-17 14:31 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-16 22:49 [PATCH v2 0/8] Introduce sgl_alloc() and sgl_free() Bart Van Assche
2017-10-16 22:49 ` [PATCH v2 1/8] lib/scatterlist: " Bart Van Assche
2017-10-17 6:06 ` Hannes Reinecke
2017-10-17 9:20 ` Johannes Thumshirn
2017-10-16 22:49 ` [PATCH v2 2/8] crypto: scompress - use " Bart Van Assche
2017-10-17 6:07 ` Hannes Reinecke
2017-11-01 14:50 ` Bart Van Assche
2017-11-01 15:17 ` Ard Biesheuvel
2017-11-01 15:45 ` Bart Van Assche
2017-11-01 15:51 ` Ard Biesheuvel
2017-10-16 22:49 ` [PATCH v2 3/8] nvmet/fc: Use " Bart Van Assche
2017-10-17 6:07 ` Hannes Reinecke
2017-10-16 22:49 ` [PATCH v2 4/8] nvmet/rdma: " Bart Van Assche
2017-10-17 6:08 ` Hannes Reinecke
2017-10-16 22:49 ` [PATCH v2 5/8] target: Use sgl_alloc_order() " Bart Van Assche
2017-10-17 6:14 ` Hannes Reinecke
2017-10-17 14:31 ` Bart Van Assche [this message]
2017-10-16 22:49 ` [PATCH v2 6/8] scsi/ipr: Use sgl_alloc_order() and sgl_free_order() Bart Van Assche
2017-10-17 6:19 ` Hannes Reinecke
2017-10-18 20:57 ` Brian King
2017-10-30 20:37 ` Bart Van Assche
2017-10-30 21:01 ` Brian King
2017-11-01 11:13 ` Hannes Reinecke
2017-10-16 22:49 ` [PATCH v2 7/8] scsi/pmcraid: Remove an unused structure member Bart Van Assche
2017-10-17 6:21 ` Hannes Reinecke
2017-10-17 14:28 ` Bart Van Assche
2017-10-16 22:49 ` [PATCH v2 8/8] scsi/pmcraid: Use sgl_alloc_order() and sgl_free_order() Bart Van Assche
2017-10-17 6:22 ` Hannes Reinecke
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=1508250670.3596.2.camel@wdc.com \
--to=bart.vanassche@wdc.com \
--cc=axboe@kernel.dk \
--cc=hare@suse.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=sagi@grimberg.me \
/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;
as well as URLs for NNTP newsgroup(s).