[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH 10/34] dm-zoned: use bio_new in dmz_rdwr_block



Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
---
 drivers/md/dm-zoned-metadata.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c
index fa0ee732c6e9..5b5ed5fce2ed 100644
--- a/drivers/md/dm-zoned-metadata.c
+++ b/drivers/md/dm-zoned-metadata.c
@@ -755,13 +755,11 @@ static int dmz_rdwr_block(struct dmz_dev *dev, int op,
        if (dmz_bdev_is_dying(dev))
                return -EIO;
 
-       bio = bio_alloc(GFP_NOIO, 1);
+       bio = bio_new(dev->bdev, dmz_blk2sect(block), op,
+                     REQ_SYNC | REQ_META | REQ_PRIO, 1, GFP_NOIO);
        if (!bio)
                return -ENOMEM;
 
-       bio->bi_iter.bi_sector = dmz_blk2sect(block);
-       bio_set_dev(bio, dev->bdev);
-       bio_set_op_attrs(bio, op, REQ_SYNC | REQ_META | REQ_PRIO);
        bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0);
        ret = submit_bio_wait(bio);
        bio_put(bio);
-- 
2.22.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.