linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: mchristi@redhat.com
To: linux-fsdevel@vger.kernel.org, dm-devel@redhat.com,
	linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org, drbd-dev@lists.linbit.com
Cc: Mike Christie <mchristi@redhat.com>
Subject: [PATCH 04/32] block: prepare blkdev_issue_discard for bi_rw split
Date: Wed,  4 Nov 2015 10:32:59 -0600	[thread overview]
Message-ID: <1446654807-6935-5-git-send-email-mchristi@redhat.com> (raw)
In-Reply-To: <1446654807-6935-1-git-send-email-mchristi@redhat.com>

From: Mike Christie <mchristi@redhat.com>

The next patches will prepare the submit_bio users
for the split. There were a lot more users than
there were for submit_bio_wait, so if the conversion
was not a one liner, I broke it out into its own
patch.

This patch prepares blkdev_issue_discard.

There is some compat code left which will be dropped
in later patches in the series.
1. REQ_WRITE is still being set. This is because a lot
of code assumes it will be set for discard, flushes and
write sames.
2. submit_bio is still taking a bitmap. This is to make
the series git bisectable.

Signed-off-by: Mike Christie <mchristi@redhat.com>
---
 block/blk-lib.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/block/blk-lib.c b/block/blk-lib.c
index 9ebf653..0861c7a 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -42,7 +42,8 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
 {
 	DECLARE_COMPLETION_ONSTACK(wait);
 	struct request_queue *q = bdev_get_queue(bdev);
-	int type = REQ_WRITE | REQ_DISCARD;
+	int op = REQ_OP_DISCARD;
+	int op_flags = REQ_WRITE;
 	unsigned int granularity;
 	int alignment;
 	struct bio_batch bb;
@@ -63,7 +64,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
 	if (flags & BLKDEV_DISCARD_SECURE) {
 		if (!blk_queue_secdiscard(q))
 			return -EOPNOTSUPP;
-		type |= REQ_SECURE;
+		op_flags |= REQ_SECURE;
 	}
 
 	atomic_set(&bb.done, 1);
@@ -108,7 +109,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
 		sector = end_sect;
 
 		atomic_inc(&bb.done);
-		submit_bio(type, bio);
+		submit_bio(op | op_flags, bio);
 
 		/*
 		 * We can loop for a long time in here, if someone does
-- 
1.8.3.1


  parent reply	other threads:[~2015-11-04 16:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04 16:32 [RFC PATCH 00/32] separate operations from flags in the bio/request structs mchristi
2015-11-04 16:32 ` [PATCH 01/32] block/fs: add REQ_OP definitions mchristi
2015-11-04 16:32 ` [PATCH 02/32] block/fs/mm: prepare submit_bio_wait users for bi_rw split mchristi
2015-11-04 16:32 ` [PATCH 03/32] dio/btrfs: prep dio->submit_bio " mchristi
2015-11-04 16:32 ` mchristi [this message]
2015-11-04 16:33 ` [PATCH 05/32] drbd: prepare drbd " mchristi
2015-11-04 16:33 ` [PATCH 06/32] xen blkback: prepare " mchristi
2015-11-04 16:33 ` [PATCH 07/32] dm: " mchristi
2015-11-04 16:33 ` [PATCH 08/32] target: " mchristi
2015-11-04 16:33 ` [PATCH 09/32] btrfs: " mchristi
2015-11-04 16:49 ` [dm-devel] [RFC PATCH 00/32] separate operations from flags in the bio/request structs Bart Van Assche
2015-11-04 16:53   ` Mike Christie
2015-11-07 10:23     ` Christoph Hellwig
2015-11-11  7:53       ` Mike Christie
2015-11-11 11:28         ` Christoph Hellwig
2015-11-11 17:37           ` Mike Snitzer
2015-11-04 22:07 [RESEND RFC " mchristi
2015-11-04 22:08 ` [PATCH 04/32] block: prepare blkdev_issue_discard for bi_rw split mchristi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1446654807-6935-5-git-send-email-mchristi@redhat.com \
    --to=mchristi@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).