Re: [PATCH 6/6] block: Add 'BLK_MQ_RQ_QUEUE_DONE' return value
On 07/21/2016 07:53 AM, Christoph Hellwig wrote: > On Tue, Jul 19, 2016 at 03:20:39PM +0200, Hannes Reinecke wrote: >> Add a return value BLK_MQ_RQ_QUEUE_DONE to terminate a request >> without error. > > NAK. You can just do a blk_mq_end_request on the request and return > 0 from ->queue_rq. > Okay, will be doing so. Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 6/6] block: Add 'BLK_MQ_RQ_QUEUE_DONE' return value
On Tue, Jul 19, 2016 at 03:20:39PM +0200, Hannes Reinecke wrote: > Add a return value BLK_MQ_RQ_QUEUE_DONE to terminate a request > without error. NAK. You can just do a blk_mq_end_request on the request and return 0 from ->queue_rq. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 6/6] block: Add 'BLK_MQ_RQ_QUEUE_DONE' return value
On 7/19/16 22:20, Hannes Reinecke wrote: Add a return value BLK_MQ_RQ_QUEUE_DONE to terminate a request without error. Signed-off-by: Hannes Reinecke--- block/blk-mq.c | 1 + drivers/scsi/scsi_lib.c | 3 +++ include/linux/blk-mq.h | 1 + 3 files changed, 5 insertions(+) Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal -- Damien Le Moal, Ph.D. Sr. Manager, System Software Group, HGST Research, HGST, a Western Digital brand damien.lem...@hgst.com (+81) 0466-98-3593 (ext. 513593) 1 kirihara-cho, Fujisawa, Kanagawa, 252-0888 Japan www.hgst.com Western Digital Corporation (and its subsidiaries) E-mail Confidentiality Notice & Disclaimer: This e-mail and any files transmitted with it may contain confidential or legally privileged information of WDC and/or its affiliates, and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited. If you have received this e-mail in error, please notify the sender immediately and delete the e-mail in its entirety from your system. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 6/6] block: Add 'BLK_MQ_RQ_QUEUE_DONE' return value
Add a return value BLK_MQ_RQ_QUEUE_DONE to terminate a request without error. Signed-off-by: Hannes Reinecke--- block/blk-mq.c | 1 + drivers/scsi/scsi_lib.c | 3 +++ include/linux/blk-mq.h | 1 + 3 files changed, 5 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index 7df9c92..cd25d68 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -793,6 +793,7 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) pr_err("blk-mq: bad return on queue: %d\n", ret); case BLK_MQ_RQ_QUEUE_ERROR: rq->errors = -EIO; + case BLK_MQ_RQ_QUEUE_DONE: blk_mq_end_request(rq, rq->errors); break; } diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index f112926..d74108b 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1802,6 +1802,8 @@ static inline int prep_to_mq(int ret) return 0; case BLKPREP_DEFER: return BLK_MQ_RQ_QUEUE_BUSY; + case BLKPREP_DONE: + return BLK_MQ_RQ_QUEUE_DONE; default: return BLK_MQ_RQ_QUEUE_ERROR; } @@ -1945,6 +1947,7 @@ out: blk_mq_delay_queue(hctx, SCSI_QUEUE_DELAY); break; case BLK_MQ_RQ_QUEUE_ERROR: + case BLK_MQ_RQ_QUEUE_DONE: /* * Make sure to release all allocated ressources when * we hit an error, as we will never see this command diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 2498fdf..f7a9e97 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -151,6 +151,7 @@ enum { BLK_MQ_RQ_QUEUE_OK = 0,/* queued fine */ BLK_MQ_RQ_QUEUE_BUSY= 1,/* requeue IO for later */ BLK_MQ_RQ_QUEUE_ERROR = 2,/* end IO with error */ + BLK_MQ_RQ_QUEUE_DONE= 3,/* end IO w/o error */ BLK_MQ_F_SHOULD_MERGE = 1 << 0, BLK_MQ_F_TAG_SHARED = 1 << 1, -- 1.8.5.6 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html