linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ritika Srivastava <ritika.srivastava@oracle.com>
To: linux-block@vger.kernel.org
Cc: axboe@kernel.dk, ritika.srivastava@oracle.com
Subject: [PATCH 1/2] block: Return blk_status_t instead of errno codes
Date: Wed, 29 Jul 2020 15:47:57 -0700	[thread overview]
Message-ID: <1596062878-4238-2-git-send-email-ritika.srivastava@oracle.com> (raw)
In-Reply-To: <1596062878-4238-1-git-send-email-ritika.srivastava@oracle.com>

Replace returning legacy errno codes with blk_status_t in
blk_cloned_rq_check_limits().

Signed-off-by: Ritika Srivastava <ritika.srivastava@oracle.com>
---
 block/blk-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 9bfaee0..d241ab8 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1220,14 +1220,14 @@ blk_qc_t submit_bio(struct bio *bio)
  *    limits when retrying requests on other queues. Those requests need
  *    to be checked against the new queue limits again during dispatch.
  */
-static int blk_cloned_rq_check_limits(struct request_queue *q,
+static blk_status_t blk_cloned_rq_check_limits(struct request_queue *q,
 				      struct request *rq)
 {
 	if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, req_op(rq))) {
 		printk(KERN_ERR "%s: over max size limit. (%u > %u)\n",
 			__func__, blk_rq_sectors(rq),
 			blk_queue_get_max_sectors(q, req_op(rq)));
-		return -EIO;
+		return BLK_STS_IOERR;
 	}
 
 	/*
@@ -1240,10 +1240,10 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
 	if (rq->nr_phys_segments > queue_max_segments(q)) {
 		printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",
 			__func__, rq->nr_phys_segments, queue_max_segments(q));
-		return -EIO;
+		return BLK_STS_IOERR;
 	}
 
-	return 0;
+	return BLK_STS_OK;
 }
 
 /**
-- 
1.8.3.1


  reply	other threads:[~2020-07-29 23:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 22:47 Return BLK_STS_NOTSUPP and blk_status_t from blk_cloned_rq_check_limits() Ritika Srivastava
2020-07-29 22:47 ` Ritika Srivastava [this message]
2020-08-14  6:26   ` [PATCH 1/2] block: Return blk_status_t instead of errno codes Christoph Hellwig
2020-08-26 17:03     ` Ritika Srivastava
2020-08-26 17:19       ` Jens Axboe
2020-08-26 17:23         ` Ritika Srivastava
2020-08-28 15:52           ` Ritika Srivastava
2020-08-28 15:52             ` Jens Axboe
2020-08-28 17:10               ` Ritika Srivastava
2020-08-31 15:38                 ` Jens Axboe
2020-08-31 23:02                   ` Ritika Srivastava
2020-07-29 22:47 ` [PATCH v2 2/2] block: return BLK_STS_NOTSUPP if operation is not supported Ritika Srivastava
2020-08-14  6:37   ` Christoph Hellwig
2020-08-17 18:10     ` Ritika Srivastava
2020-08-05 17:54 ` Return BLK_STS_NOTSUPP and blk_status_t from blk_cloned_rq_check_limits() Ritika Srivastava
2020-08-13 19:13   ` Ritika Srivastava
2020-09-01 20:17 Ritika Srivastava
2020-09-01 20:17 ` [PATCH 1/2] block: Return blk_status_t instead of errno codes Ritika Srivastava

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=1596062878-4238-2-git-send-email-ritika.srivastava@oracle.com \
    --to=ritika.srivastava@oracle.com \
    --cc=axboe@kernel.dk \
    --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 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).