From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1358C433DB for ; Thu, 21 Jan 2021 08:44:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 567AB239A4 for ; Thu, 21 Jan 2021 08:44:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727283AbhAUInV (ORCPT ); Thu, 21 Jan 2021 03:43:21 -0500 Received: from verein.lst.de ([213.95.11.211]:59638 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727933AbhAUIm6 (ORCPT ); Thu, 21 Jan 2021 03:42:58 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 58AFE67373; Thu, 21 Jan 2021 09:41:50 +0100 (CET) Date: Thu, 21 Jan 2021 09:41:50 +0100 From: Christoph Hellwig To: Chao Leng Cc: linux-nvme@lists.infradead.org, kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-block@vger.kernel.org, axboe@kernel.dk Subject: Re: [PATCH v3 2/5] nvme-core: introduce complete failed request Message-ID: <20210121084150.GB25963@lst.de> References: <20210121070330.19701-1-lengchao@huawei.com> <20210121070330.19701-3-lengchao@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210121070330.19701-3-lengchao@huawei.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org > +static inline void nvme_complete_failed_req(struct request *req) I think the name is too generic, and the function also needs a little comment, especially as it forces a specific error code. > +{ > + nvme_req(req)->status = NVME_SC_HOST_PATH_ERROR; > + blk_mq_set_request_complete(req); > + nvme_complete_rq(req); > +} Also no need to mark this as an inline function. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC315C433DB for ; Thu, 21 Jan 2021 08:42:10 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 61A202399A for ; Thu, 21 Jan 2021 08:42:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 61A202399A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JxO3jZjizUmUTtkO3fVpvwj8bEjWwM6mc0esv1Wwym4=; b=raS0Yn2T+cqeRkoyB0bgv/3AM b/vXyAXnZXklePi2bZRtRhlERS6yY69uFepFhjXCMP3SrnWZ+SAMUDPXphP3e6HNthP921ldYdEOc MLLy95r2Hk+j1Xy0jB0FxjYNOxPwBAQn253LAGL1eOeB17Mmt5xA+Ro3pGq9PFkq1zLKd6Px1fsu1 aV7kilJHvrYcd+FZ2Vk+i464hiOQAhO4w1WXBhqMheGjLxK0LNGL4nYRo8DjbmlkYojUjdpmMi8ej BTgL+zhW27fsFE7CzJ5+4tYJ6QoYD3Imhq/OUxcRU3+kmZ6llTiPLEA6LkaFR2XmnoB6rZLZza8k2 IcAXC6BDQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2VXO-0006aI-TL; Thu, 21 Jan 2021 08:41:55 +0000 Received: from verein.lst.de ([213.95.11.211]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2VXN-0006ZZ-1I for linux-nvme@lists.infradead.org; Thu, 21 Jan 2021 08:41:53 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id 58AFE67373; Thu, 21 Jan 2021 09:41:50 +0100 (CET) Date: Thu, 21 Jan 2021 09:41:50 +0100 From: Christoph Hellwig To: Chao Leng Subject: Re: [PATCH v3 2/5] nvme-core: introduce complete failed request Message-ID: <20210121084150.GB25963@lst.de> References: <20210121070330.19701-1-lengchao@huawei.com> <20210121070330.19701-3-lengchao@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210121070330.19701-3-lengchao@huawei.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210121_034153_197311_CE727200 X-CRM114-Status: UNSURE ( 8.99 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: axboe@kernel.dk, linux-block@vger.kernel.org, sagi@grimberg.me, linux-nvme@lists.infradead.org, axboe@fb.com, kbusch@kernel.org, hch@lst.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org > +static inline void nvme_complete_failed_req(struct request *req) I think the name is too generic, and the function also needs a little comment, especially as it forces a specific error code. > +{ > + nvme_req(req)->status = NVME_SC_HOST_PATH_ERROR; > + blk_mq_set_request_complete(req); > + nvme_complete_rq(req); > +} Also no need to mark this as an inline function. _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme