[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 04/34] drdb: use bio_new() in submit_one_flush
- To: linux-xfs@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, dm-devel@xxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, drbd-dev@xxxxxxxxxxxxxxxx, 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
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Wed, 27 Jan 2021 23:11:03 -0800
- Cc: axboe@xxxxxxxxx, philipp.reisner@xxxxxxxxxx, lars.ellenberg@xxxxxxxxxx, konrad.wilk@xxxxxxxxxx, roger.pau@xxxxxxxxxx, minchan@xxxxxxxxxx, ngupta@xxxxxxxxxx, sergey.senozhatsky.work@xxxxxxxxx, agk@xxxxxxxxxx, snitzer@xxxxxxxxxx, hch@xxxxxx, sagi@xxxxxxxxxxx, chaitanya.kulkarni@xxxxxxx, martin.petersen@xxxxxxxxxx, viro@xxxxxxxxxxxxxxxxxx, tytso@xxxxxxx, jaegeuk@xxxxxxxxxx, ebiggers@xxxxxxxxxx, djwong@xxxxxxxxxx, shaggy@xxxxxxxxxx, konishi.ryusuke@xxxxxxxxx, mark@xxxxxxxxxx, jlbec@xxxxxxxxxxxx, joseph.qi@xxxxxxxxxxxxxxxxx, damien.lemoal@xxxxxxx, naohiro.aota@xxxxxxx, jth@xxxxxxxxxx, rjw@xxxxxxxxxxxxx, len.brown@xxxxxxxxx, pavel@xxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, hare@xxxxxxx, gustavoars@xxxxxxxxxx, tiwai@xxxxxxx, alex.shi@xxxxxxxxxxxxxxxxx, asml.silence@xxxxxxxxx, ming.lei@xxxxxxxxxx, tj@xxxxxxxxxx, osandov@xxxxxx, bvanassche@xxxxxxx, jefflexu@xxxxxxxxxxxxxxxxx
- Delivery-date: Thu, 28 Jan 2021 07:12:21 +0000
- Ironport-sdr: gdFFU5PZNAYOhnKxNZLzR/eMpHEKmd5S6QzV4b7iDR/oQnrAdr4QVw2tqljSiwQrUgX3C9YccN 3rixqsLpteMciiAzZ823QwdhSvvQZxCEvRF3wk+wvsWkwT9y6v92AFAk1DNzuqn8ZlojCVdDSv 71ObpD8V1BVRqckwnGU2vYGA9iep2DpypMt0BhJGTvqwIwnW+khuntXoHCq7QiCRySRyCR2hAJ dkYuyMwrCWiKHNubJGed7RHDxQgF9ErKvmj1H9AcmwfcYK/E3b3U/VwdGnMBe4/Zt9sB/0I6dl EoA=
- Ironport-sdr: TnX6CdAM0G669YD2/0mFLpB/iYawSSNiP4c9iqDMqX1DZp2e7WWQ+pnV/pFUq+AtYqBpnMTsRT Wp60HApwwH6w5mm2JeZy8nmGENxMsHWw8aec68dB1/c/65vLKBtUz03+jVpm+0B15nx5H1WRKq hfFj0rECp61vKw3Gb2eQTvjRW03bLiSeFBrRbBuic+qFBl450DZstf0FZg+DclUIPeJVfPrCZr cTwGdhS9YMFLzZ9umS/vxFaFCNAa6gXkI1FleVQCUiQGjtzyEBGWD7Af1BZa78h+C2gTPiw7cy h3GHNFwJLNg/0Vd9eG89nC2p
- Ironport-sdr: sJ1sB4+NIXrk86BqB2mBiNRkLb2CtaUtTUjLUptuVolKqncgiWgms0hBmEnyXBHOe2LGJgTWAc Mtkqx7/Ji/KEF3P2zVgoCc4AZmvUpaw07sB7pwwqNDwBZIjeJgdIawB6xDKz7hKZuinbJ6FPFN v+digmuqEID+qvvg+Pvdb6mLkPbYX8es6TqyRNtA6iTBnQbrstI0JA9CgrvLf0RhQ0DnF83KdI QwpSDAYi/vWthDgyxzldo4sKChZfQfmY/MjRYeTOvpJG4q5JRSujoZAO3KJfZIMHz0OJMVK9L1 YPQ=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- 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
|