Re: [RFC PATCH 3/7] block: allow to bypass bio check before submitting bio
From: Ming Lei <hidden>
Date: 2022-02-09 11:57:28
On Wed, Feb 09, 2022 at 12:16:16AM -0800, Christoph Hellwig wrote:
On Wed, Feb 09, 2022 at 04:12:43PM +0800, Ming Lei wrote:quoted
On Mon, Jan 17, 2022 at 12:21:37AM -0800, Christoph Hellwig wrote:quoted
quoted
* systems and other upper level users of the block layer should use * submit_bio() instead. */ -void submit_bio_noacct(struct bio *bio) +void __submit_bio_noacct(struct bio *bio, bool check) { - if (unlikely(!submit_bio_checks(bio))) + if (unlikely(check && !submit_bio_checks(bio))) return;This doesn't make sense as an API - you can just move the checks into the caller that pass check=true.But submit_bio_checks() is local helper, and it is hard to make it public to drivers. Not mention there are lots of callers to submit_bio_noacct().What I mean is something like: -void submit_bio_noacct(struct bio *bio) +void submit_bio_noacct_nocheck(struct bio *bio) { - if (unlikely(!submit_bio_checks(bio))) - return ... +void submit_bio_noacct(struct bio *bio) +{ + if (unlikely(!submit_bio_checks(bio))) + return + submit_bio_noacct_nocheck(bio); +}
OK, that is also very similar with my local version. Thanks, Ming