diff mbox series

[1/9] block: define io_batch structure

Message ID 20211013165416.985696-2-axboe@kernel.dk (mailing list archive)
State New, archived
Headers show
Series Batched completions | expand

Commit Message

Jens Axboe Oct. 13, 2021, 4:54 p.m. UTC
This adds the io_batch structure, and a helper for defining one on the
stack. It's meant to be used for collecting requests for completion,
with a completion handler defined to be called at the end.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 include/linux/blkdev.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Christoph Hellwig Oct. 14, 2021, 5:45 a.m. UTC | #1
On Wed, Oct 13, 2021 at 10:54:08AM -0600, Jens Axboe wrote:
> This adds the io_batch structure, and a helper for defining one on the
> stack. It's meant to be used for collecting requests for completion,
> with a completion handler defined to be called at the end.

Isn't the name a little misleading given that it is all about
completions?

Also I wonder if this should be merged with the next patch as that's
sortof a logical unit.
Jens Axboe Oct. 14, 2021, 3:50 p.m. UTC | #2
On 10/13/21 11:45 PM, Christoph Hellwig wrote:
> On Wed, Oct 13, 2021 at 10:54:08AM -0600, Jens Axboe wrote:
>> This adds the io_batch structure, and a helper for defining one on the
>> stack. It's meant to be used for collecting requests for completion,
>> with a completion handler defined to be called at the end.
> 
> Isn't the name a little misleading given that it is all about
> completions?

It is for completions, but I'd rather just keep it short for now.

> 
> Also I wonder if this should be merged with the next patch as that's
> sortof a logical unit.

Actually was like that before, I can fold them again.
Christoph Hellwig Oct. 14, 2021, 4:06 p.m. UTC | #3
On Thu, Oct 14, 2021 at 09:50:10AM -0600, Jens Axboe wrote:
> On 10/13/21 11:45 PM, Christoph Hellwig wrote:
> > On Wed, Oct 13, 2021 at 10:54:08AM -0600, Jens Axboe wrote:
> >> This adds the io_batch structure, and a helper for defining one on the
> >> stack. It's meant to be used for collecting requests for completion,
> >> with a completion handler defined to be called at the end.
> > 
> > Isn't the name a little misleading given that it is all about
> > completions?
> 
> It is for completions, but I'd rather just keep it short for now.

I'd go for something like io_comp_batch or something like that at least.

> > Also I wonder if this should be merged with the next patch as that's
> > sortof a logical unit.
> 
> Actually was like that before, I can fold them again.

I'm fine either way.  Merged just seems a little more logical.
Jens Axboe Oct. 14, 2021, 6:14 p.m. UTC | #4
On 10/14/21 10:06 AM, Christoph Hellwig wrote:
> On Thu, Oct 14, 2021 at 09:50:10AM -0600, Jens Axboe wrote:
>> On 10/13/21 11:45 PM, Christoph Hellwig wrote:
>>> On Wed, Oct 13, 2021 at 10:54:08AM -0600, Jens Axboe wrote:
>>>> This adds the io_batch structure, and a helper for defining one on the
>>>> stack. It's meant to be used for collecting requests for completion,
>>>> with a completion handler defined to be called at the end.
>>>
>>> Isn't the name a little misleading given that it is all about
>>> completions?
>>
>> It is for completions, but I'd rather just keep it short for now.
> 
> I'd go for something like io_comp_batch or something like that at least.

OK, made it io_comp_batch.

>>> Also I wonder if this should be merged with the next patch as that's
>>> sortof a logical unit.
>>
>> Actually was like that before, I can fold them again.
> 
> I'm fine either way.  Merged just seems a little more logical.

I just folded it.
diff mbox series

Patch

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 2a8689e949b4..b39b19dbe7b6 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1298,4 +1298,14 @@  int fsync_bdev(struct block_device *bdev);
 int freeze_bdev(struct block_device *bdev);
 int thaw_bdev(struct block_device *bdev);
 
+struct io_batch {
+	struct request *req_list;
+	void (*complete)(struct io_batch *);
+};
+
+#define DEFINE_IO_BATCH(name)			\
+	struct io_batch name = {		\
+		.req_list = NULL		\
+	}
+
 #endif /* _LINUX_BLKDEV_H */