All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: axboe@fb.com
Cc: linux-block@vger.kernel.org
Subject: [PATCH 1/7] block: remove bio_is_rw
Date: Thu, 20 Oct 2016 15:12:09 +0200	[thread overview]
Message-ID: <1476969135-32732-2-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1476969135-32732-1-git-send-email-hch@lst.de>

With the addition of the zoned operations the tests in this function
became incorrect.  But I think it's much better to just open code the
allow operations in the only caller anyway.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/bio-integrity.c |  2 +-
 include/linux/bio.h   | 11 -----------
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 63f72f0..5384713 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -172,7 +172,7 @@ bool bio_integrity_enabled(struct bio *bio)
 {
 	struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev);
 
-	if (!bio_is_rw(bio))
+	if (bio_op(bio) != REQ_OP_READ && bio_op(bio) != REQ_OP_WRITE)
 		return false;
 
 	/* Already protected? */
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 97cb48f..87ce64d 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -83,17 +83,6 @@ static inline bool bio_no_advance_iter(struct bio *bio)
 	       bio_op(bio) == REQ_OP_WRITE_SAME;
 }
 
-static inline bool bio_is_rw(struct bio *bio)
-{
-	if (!bio_has_data(bio))
-		return false;
-
-	if (bio_no_advance_iter(bio))
-		return false;
-
-	return true;
-}
-
 static inline bool bio_mergeable(struct bio *bio)
 {
 	if (bio->bi_opf & REQ_NOMERGE_FLAGS)
-- 
2.1.4


  reply	other threads:[~2016-10-20 13:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20 13:12 clean up block ops defintions Christoph Hellwig
2016-10-20 13:12 ` Christoph Hellwig [this message]
2016-10-20 13:12 ` [PATCH 2/7] block: REQ_NOMERGE is common to the bio and request Christoph Hellwig
2016-10-20 13:12 ` [PATCH 3/7] block: move REQ_RAHEAD to common flags Christoph Hellwig
2016-10-20 13:12 ` [PATCH 4/7] block: replace REQ_THROTTLED with a bio flag Christoph Hellwig
2016-10-20 13:12 ` [PATCH 5/7] block: split out request-only flags into a new namespace Christoph Hellwig
2016-10-20 13:12 ` [PATCH 6/7] block: better op and flags encoding Christoph Hellwig
     [not found]   ` <CAJVOszBmN+=PD7MBEgkhO-jo3_R7rJ+5V1LGbWqDW8U+D=Dbgw@mail.gmail.com>
2016-10-28  7:35     ` Christoph Hellwig
2016-10-20 13:12 ` [PATCH 7/7] block: add a proper block layer data direction encoding Christoph Hellwig
2016-10-25 12:01 ` clean up block ops defintions Christoph Hellwig
2016-10-28 14:40   ` Jens Axboe

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=1476969135-32732-2-git-send-email-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@fb.com \
    --cc=linux-block@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.