[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZlL4rxKqcV5ePLXu@infradead.org>
Date: Sun, 26 May 2024 01:54:07 -0700
From: Christoph Hellwig <hch@...radead.org>
To: linan666@...weicloud.com
Cc: song@...nel.org, linux-raid@...r.kernel.org,
linux-kernel@...r.kernel.org, yukuai3@...wei.com,
yi.zhang@...wei.com, houtao1@...wei.com, yangerkun@...wei.com
Subject: Re: [PATCH] md: make md_flush_request() more readable
On Sun, May 26, 2024 at 02:56:22AM +0800, linan666@...weicloud.com wrote:
> - bio = NULL;
> - }
> - spin_unlock_irq(&mddev->lock);
> -
> - if (!bio) {
> + spin_unlock_irq(&mddev->lock);
> INIT_WORK(&mddev->flush_work, submit_flushes);
> queue_work(md_wq, &mddev->flush_work);
> } else {
> /* flush was performed for some other bio while we waited. */
> + spin_unlock_irq(&mddev->lock);
> if (bio->bi_iter.bi_size == 0)
> /* an empty barrier - all done */
This stil looks like a somwwhat odd flow Why not go all the way
and turn it into:
...
queue_work(md_wq, &mddev->flush_work);
return true;
}
/* flush was performed for some other bio while we waited. */
spin_unlock_irq(&mddev->lock);
if (bio->bi_iter.bi_size == 0) {
/* pure flush without data - all done */
bio_endio(bio);
return true;
}
bio->bi_opf &= ~REQ_PREFLUSH;
return false;
}
Powered by blists - more mailing lists