Re: [PATCH v6 2/4] block: add blk_interposer

From
Christoph Hellwig <hch@infradead.org>
Date
2021-03-10 10:05:53
Also in
dm-devel, linux-api, linux-block, lkml
Reply to
Sergei Shtepa, 2021-03-10
On Wed, Mar 10, 2021 at 07:53:13AM +0300, Sergei Shtepa wrote:
quoted
Please avoid the overly long line.
quoted
+	int ret = 0;
+
+	if (WARN_ON(!interposer))
WARN_ON_ONCE?
This function should be called quite rarely, and the absence of the interposer
parameter indicates that the function is being used incorrectly.
I would like to see this warning every time.
Yes.  Most kernel code would in fact just remove the check entirely
and let the kernel crash to indicate this.  Maybe that is an even
better option for such a grave API usage mistake.
quoted
quoted
+struct bdev_interposer {
+	ip_submit_bio_t ip_submit_bio;
+	struct block_device *bdev;
Do we need the ip_ prefix here?  Also we probably don't really the
the typedef for the function pointer.
Ok. Maybe submit_bio_hook would be better? or submit_bio_interposer.
Or interpose_bio?
Thread (13 messages) 13 messages, 2 authors, last reply 2021-03-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help