From patchwork Tue Jan 12 06:49:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 8014171 X-Patchwork-Delegate: axboe@kernel.dk Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3DE589F6FA for ; Tue, 12 Jan 2016 06:56:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FA1320379 for ; Tue, 12 Jan 2016 06:56:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 534D8201F4 for ; Tue, 12 Jan 2016 06:56:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753106AbcALGvT (ORCPT ); Tue, 12 Jan 2016 01:51:19 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:35705 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761164AbcALGuN (ORCPT ); Tue, 12 Jan 2016 01:50:13 -0500 Received: by mail-wm0-f53.google.com with SMTP id f206so239527594wmf.0 for ; Mon, 11 Jan 2016 22:50:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=Hg9VsNre4c16jlzc8nGdHA0NEwdr52UkqryaLSuEVWw=; b=udERau/6dqoIsd1CDrD2j6XXJW2em39yGS5u7xsjY8jWFbKkj+LE03oZaZOY2EeK/o M05Nm+kiap7yC+ZW0/+suikBlSlAw+2IsLbtDHHJ2cWjFV8vyEi8cGbRZLaMHcTDQPnd dwJ2KqFBCBh0Sx5lFAawFH9hY6iWrwGsCcYDI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=Hg9VsNre4c16jlzc8nGdHA0NEwdr52UkqryaLSuEVWw=; b=d9fpo5W43XOZujhArdNQHHqiJ3Ixt3ekasJG8+Ft6Z1xE24yiZAuFcj7NS47fOOI6c dSHtPQ9ChMZ2E51phbU+EZDzkbo6yVaK3oyqRjH+z30cVGYNt3B5DzBLvfzNo3XTcQfm KYR5L5tFXfnlexjpiVc6GDrzEAJeQLEgFcPhqP7FJJg4EKtVLU5CQqb+tQ9CbnQxKGRy XkSRLAN/eeZm7yGj/XIwT4jewzA4IYJ5DePd9vJGvfi9T6nPnSTTyVv1ZhbyGreFKPDF p37LiE2eGXEwCW/cOj4iJliEROmHywuaeHzkIGsJ+1DAhMReSsSTeSBvpm68GRweIvYw xC1A== X-Gm-Message-State: ALoCoQkVxq6XgG0OTXUEHfp5av+X9lmkI4bNv4XRJGh1h+QouF1DTMN5nIdNXmRTYYkiiRvx3oCcazx3abE3vlhfxyX4bOcjFQ== X-Received: by 10.194.103.198 with SMTP id fy6mr139836416wjb.48.1452581412581; Mon, 11 Jan 2016 22:50:12 -0800 (PST) Received: from localhost.localdomain (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id yz5sm70776886wjc.36.2016.01.11.22.50.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 22:50:11 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 15/25] lightnvm: move rq->error to nvm_rq->error Date: Tue, 12 Jan 2016 07:49:29 +0100 Message-Id: <1452581379-18162-16-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452581379-18162-1-git-send-email-m@bjorling.me> References: <1452581379-18162-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of passing request error into the LightNVM modules, incorporate it into the nvm_rq. Signed-off-by: Matias Bjørling --- drivers/lightnvm/core.c | 3 ++- drivers/lightnvm/gennvm.c | 6 +++--- drivers/lightnvm/rrpc.c | 2 +- include/linux/lightnvm.h | 4 +++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index cd674af..dad84dd 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -291,7 +291,8 @@ EXPORT_SYMBOL(nvm_erase_ppa); void nvm_end_io(struct nvm_rq *rqd, int error) { - rqd->end_io(rqd, error); + rqd->error = error; + rqd->end_io(rqd); } EXPORT_SYMBOL(nvm_end_io); diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c index 262da6d..4c15846 100644 --- a/drivers/lightnvm/gennvm.c +++ b/drivers/lightnvm/gennvm.c @@ -363,11 +363,11 @@ static void gennvm_mark_blk_bad(struct nvm_dev *dev, struct nvm_rq *rqd) gennvm_blk_set_type(dev, &rqd->ppa_addr, 2); } -static void gennvm_end_io(struct nvm_rq *rqd, int error) +static void gennvm_end_io(struct nvm_rq *rqd) { struct nvm_tgt_instance *ins = rqd->ins; - switch (error) { + switch (rqd->error) { case NVM_RSP_SUCCESS: case NVM_RSP_ERR_EMPTYPAGE: break; @@ -375,7 +375,7 @@ static void gennvm_end_io(struct nvm_rq *rqd, int error) gennvm_mark_blk_bad(rqd->dev, rqd); } - ins->tt->end_io(rqd, error); + ins->tt->end_io(rqd); } static int gennvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index ec7aacf..9a5d940 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -658,7 +658,7 @@ static void rrpc_end_io_write(struct rrpc *rrpc, struct rrpc_rq *rrqd, } } -static void rrpc_end_io(struct nvm_rq *rqd, int error) +static void rrpc_end_io(struct nvm_rq *rqd) { struct rrpc *rrpc = container_of(rqd->ins, struct rrpc, instance); struct rrpc_rq *rrqd = nvm_rq_to_pdu(rqd); diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index a83298f..9acc71a 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -149,7 +149,7 @@ struct ppa_addr { }; struct nvm_rq; -typedef void (nvm_end_io_fn)(struct nvm_rq *, int); +typedef void (nvm_end_io_fn)(struct nvm_rq *); struct nvm_rq { struct nvm_tgt_instance *ins; @@ -173,6 +173,8 @@ struct nvm_rq { uint8_t opcode; uint16_t nr_pages; uint16_t flags; + + int error; }; static inline struct nvm_rq *nvm_rq_from_pdu(void *pdu)