[Devel] [PATCH RHEL9 COMMIT] vhost-blk: remove excess vhost_blk_req.use_inline

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jan 9 17:58:35 MSK 2025


The commit is pushed to "branch-rh9-5.14.0-427.44.1.vz9.80.x-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh9-5.14.0-427.44.1.vz9.80.3
------>
commit 32d898bf69d52f8e38a0d1753ddd746d9c5020c2
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Mon Dec 30 13:39:49 2024 +0800

    vhost-blk: remove excess vhost_blk_req.use_inline
    
    We already have all information in vhost_blk_req.bio itself, so we can
    save place in vhost_blk_req.
    
    https://virtuozzo.atlassian.net/browse/PSBM-157752
    Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
    Reviewed-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
    
    ======
    Patchset description:
    vhost-blk: bounce buffer for unaligned requests
    
    Andrey Zhadchenko (2):
      vhost-blk: rework iov and bio handling
      vhost-blk: add bounce-buffer for non-aligned requests
    
    David Howells (1):
      iov_iter: Add a function to extract a page list from an iterator
    
    Pavel Tikhomirov (1):
      vhost-blk: remove excess vhost_blk_req.use_inline
    
    Feature: vhost-blk: in-kernel accelerator for virtio-blk guests
---
 drivers/vhost/blk.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/vhost/blk.c b/drivers/vhost/blk.c
index a289552d6f37..0c80967bfeee 100644
--- a/drivers/vhost/blk.c
+++ b/drivers/vhost/blk.c
@@ -54,7 +54,6 @@ enum {
 struct vhost_blk_req {
 	struct bio *inline_bio[NR_INLINE];
 	int req_bin;
-	bool use_inline;
 
 	struct llist_node llnode;
 
@@ -160,7 +159,7 @@ static void vhost_blk_req_done(struct bio *bio)
 
 static void vhost_blk_req_cleanup(struct vhost_blk_req *req)
 {
-	if (!req->use_inline)
+	if (req->bio != req->inline_bio)
 		kfree(req->bio);
 }
 
@@ -169,7 +168,6 @@ static int vhost_blk_bio_make_simple(struct vhost_blk_req *req,
 {
 	struct bio *bio;
 
-	req->use_inline = true;
 	req->bio = req->inline_bio;
 
 	bio = bio_alloc(bdev, 0, req->bi_opf, GFP_KERNEL);
@@ -207,9 +205,7 @@ static int vhost_blk_bio_make(struct vhost_blk_req *req,
 				   GFP_KERNEL);
 		if (!req->bio)
 			return -ENOMEM;
-		req->use_inline = false;
 	} else {
-		req->use_inline = true;
 		req->bio = req->inline_bio;
 	}
 


More information about the Devel mailing list