Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9346beb9 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

bio-integrity: move the bio integrity profile check earlier in bio_integrity_prep



This makes the code more obvious, and moves the most likely branch first
in the function.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d424681c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -246,6 +246,9 @@ bool bio_integrity_prep(struct bio *bio)
	blk_status_t status;

	bi = bdev_get_integrity(bio->bi_bdev);
	if (!bi)
		return true;

	q = bdev_get_queue(bio->bi_bdev);
	if (bio_op(bio) != REQ_OP_READ && bio_op(bio) != REQ_OP_WRITE)
		return true;
@@ -257,9 +260,6 @@ bool bio_integrity_prep(struct bio *bio)
	if (bio_integrity(bio))
		return true;

	if (bi == NULL)
		return true;

	if (bio_data_dir(bio) == READ) {
		if (!bi->profile->verify_fn ||
		    !(bi->flags & BLK_INTEGRITY_VERIFY))