[RFC PATCH 04/34] drdb: use bio_new() in submit_one_flush
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: linux-xfs@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, dm-devel@xxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, drbd-dev@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-nvme@xxxxxxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, target-devel@xxxxxxxxxxxxxxx, linux-fscrypt@xxxxxxxxxxxxxxx, jfs-discussion@xxxxxxxxxxxxxxxxxxxxx, linux-nilfs@xxxxxxxxxxxxxxx, ocfs2-devel@xxxxxxxxxxxxxx, linux-pm@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx
- Subject: [RFC PATCH 04/34] drdb: use bio_new() in submit_one_flush
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Wed, 27 Jan 2021 23:11:03 -0800
- In-reply-to: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com>
- Ironport-sdr: E9JrzyeQqe1pQFSde2SOQOK0XNlbDCUvLxewlnS1WtOFgxiUtsKegOXv/Mk3pz30DVu+yQBvUS UHCqVUPHXlFiYZ7LBFVTvMIvK/WtSuh7miKHhwAvehpGByCK5berzCtGLhphias34o15GcZKLA AcCe5g+pL3jvKhh+98SCfRtTbkF5cX2Uv99bemWfo6KnYMtuUNDWsydXC86vPvAj4OTavgFbN3 u37jr4rHTPwu5kiEj0vLZXT/488OtAjjfKZ/lUCVylJM3JjZPYT6CDp3ZUJdxH/S1Zw+2zO0DG Xmg=
- Ironport-sdr: 2pclH1G0KEXMBdYyJXwGIaiNxvPd8YeJd7/cw8NzdW/uA4XEF2scdf7sw8QvdtcnNzWWhRikAO rWD6sAP5mbN4ArPNu1kHS9i0WXu+Dt7wTDtCpGgIsdzUH63GucwPYvntzjU2Oz80TTe60grf3T OB+yjfwhmnzJaQo4ASI9jMkEXCQePbbFzD/wXC3yyPl4PlujZsT4Avyw2edMGHmqh2ROTGWZWZ Q4tOYIjAALAIwRmgGTAIbGFo0FE6LPaiNqvWkgFx5oE65sYn64X5y9P60fQsy3Xk2Q9aqObdv7 x3ZbEeUVDgpOBVOT/ms9aKtB
- Ironport-sdr: sJ1sB4+NIXrk86BqB2mBiNRkLb2CtaUtTUjLUptuVolKqncgiWgms0hBmEnyXBHOe2LGJgTWAc Mtkqx7/Ji/KEF3P2zVgoCc4AZmvUpaw07sB7pwwqNDwBZIjeJgdIawB6xDKz7hKZuinbJ6FPFN v+digmuqEID+qvvg+Pvdb6mLkPbYX8es6TqyRNtA6iTBnQbrstI0JA9CgrvLf0RhQ0DnF83KdI QwpSDAYi/vWthDgyxzldo4sKChZfQfmY/MjRYeTOvpJG4q5JRSujoZAO3KJfZIMHz0OJMVK9L1 YPQ=
- References: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com>
- Wdcironportexception: Internal
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
---
drivers/block/drbd/drbd_receiver.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index e1cd3427b28b..b86bbf725cbd 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1277,8 +1277,10 @@ static void one_flush_endio(struct bio *bio)
static void submit_one_flush(struct drbd_device *device, struct issue_flush_context *ctx)
{
- struct bio *bio = bio_alloc(GFP_NOIO, 0);
+ struct block_device *bdev = device->ldev->backing_bdev;
+ struct bio *bio = bio_new(bdev, 0, REQ_OP_FLUSH, REQ_PREFLUSH, 0, GFP_NOIO);
struct one_flush_context *octx = kmalloc(sizeof(*octx), GFP_NOIO);
+
if (!bio || !octx) {
drbd_warn(device, "Could not allocate a bio, CANNOT ISSUE FLUSH\n");
/* FIXME: what else can I do now? disconnecting or detaching
@@ -1296,10 +1298,8 @@ static void submit_one_flush(struct drbd_device *device, struct issue_flush_cont
octx->device = device;
octx->ctx = ctx;
- bio_set_dev(bio, device->ldev->backing_bdev);
bio->bi_private = octx;
bio->bi_end_io = one_flush_endio;
- bio->bi_opf = REQ_OP_FLUSH | REQ_PREFLUSH;
device->flush_jif = jiffies;
set_bit(FLUSH_PENDING, &device->flags);
--
2.22.1
[Index of Archives]
[linux Cryptography]
[Asterisk App Development]
[PJ SIP]
[Gnu Gatekeeper]
[IETF Sipping]
[Info Cyrus]
[ALSA User]
[Fedora Linux Users]
[Linux SCTP]
[DCCP]
[Gimp]
[Yosemite News]
[Deep Creek Hot Springs]
[Yosemite Campsites]
[ISDN Cause Codes]