From patchwork Mon Nov 28 21:39:02 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: 9450557 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A21B16071C for ; Mon, 28 Nov 2016 21:43:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 943DB27BFC for ; Mon, 28 Nov 2016 21:43:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88FC427BFF; Mon, 28 Nov 2016 21:43:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 385BA27EE9 for ; Mon, 28 Nov 2016 21:43:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755802AbcK1Vks (ORCPT ); Mon, 28 Nov 2016 16:40:48 -0500 Received: from mail-wj0-f196.google.com ([209.85.210.196]:32966 "EHLO mail-wj0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755384AbcK1Vjr (ORCPT ); Mon, 28 Nov 2016 16:39:47 -0500 Received: by mail-wj0-f196.google.com with SMTP id kp2so15789216wjc.0 for ; Mon, 28 Nov 2016 13:39:47 -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-transfer-encoding; bh=q5iJro38GCiwujWGKpczqm6r48qlfvvsLf/Ye+ytBws=; b=ghKzTj5Zta6I87y0e7takUNrDnLaGebzC5zEQsy9za165GQeLpZ0QHi2E9HeaIbDc5 vuqJIInd28YIvLcDZ5tLoHB71Ehl9zBjp57ezL+Usi2OSZWQFt0wVVzxWQNbhKlbM1Yb Rzkiat/rveJCR91M6ZBIISBZ1LLF/yLoibVdc= 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-transfer-encoding; bh=q5iJro38GCiwujWGKpczqm6r48qlfvvsLf/Ye+ytBws=; b=YAxVsQ8jkQDbjpXFsURuCj4iVJfECClOl7yKKAb26l3stasn2jPL/CvzT+Ni5paHSz /H3eHrQClitMmhfDXi54eVyt8NCHXXaX0Nsen03SXN/DIhtoXMmkbV43N3w4fgW0JTs9 2bEEI0q//BgmU//kdGh13hS4fyL5TED86vgy4Y5CfdbMzAohyvc3WzrspYOiBCmlecTA IhZ7OUwJg3x2e99TLb4k3DzGbDulj5uwyAUH8xQKCeadKQyRxuz/EAax4bFJq4X1vZPD a+c2X+loNEMF0SJn/hm35TNBS4sZ0uZGhK3DMb188NYtR3hVR3GghfROLvvCOJF3mPPY cC+A== X-Gm-Message-State: AKaTC02SeEN4ICtSnEf9D///jrGqpB9gHdhQHSEZ3npNyN1Uz4TjClA+QkG5SVn6ceQk2w== X-Received: by 10.194.158.100 with SMTP id wt4mr24961997wjb.148.1480369186416; Mon, 28 Nov 2016 13:39:46 -0800 (PST) Received: from Macroninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id w79sm30825843wmw.0.2016.11.28.13.39.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Nov 2016 13:39:45 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: axboe@fb.com, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 11/23] lightnvm: remove unnecessary variables in rrpc Date: Mon, 28 Nov 2016 22:39:02 +0100 Message-Id: <20161128213914.12516-12-m@bjorling.me> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161128213914.12516-1-m@bjorling.me> References: <20161128213914.12516-1-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-Virus-Scanned: ClamAV using ClamSMTP From: Javier González Before vectored I/Os were supported on rrpc, the physical address was stored as part of the nvm_rqd request. This variable become obsolete when the ppa_list was introduced. Cleanup this variable. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/rrpc.c | 6 ------ drivers/lightnvm/rrpc.h | 3 --- 2 files changed, 9 deletions(-) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index 9253acc..34d2ebf 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -758,7 +758,6 @@ static int rrpc_read_ppalist_rq(struct rrpc *rrpc, struct bio *bio, static int rrpc_read_rq(struct rrpc *rrpc, struct bio *bio, struct nvm_rq *rqd, unsigned long flags) { - struct rrpc_rq *rrqd = nvm_rq_to_pdu(rqd); int is_gc = flags & NVM_IOTYPE_GC; sector_t laddr = rrpc_get_laddr(bio); struct rrpc_addr *gp; @@ -778,7 +777,6 @@ static int rrpc_read_rq(struct rrpc *rrpc, struct bio *bio, struct nvm_rq *rqd, } rqd->opcode = NVM_OP_HBREAD; - rrqd->addr = gp; return NVM_IO_OK; } @@ -821,7 +819,6 @@ static int rrpc_write_ppalist_rq(struct rrpc *rrpc, struct bio *bio, static int rrpc_write_rq(struct rrpc *rrpc, struct bio *bio, struct nvm_rq *rqd, unsigned long flags) { - struct rrpc_rq *rrqd = nvm_rq_to_pdu(rqd); struct rrpc_addr *p; int is_gc = flags & NVM_IOTYPE_GC; sector_t laddr = rrpc_get_laddr(bio); @@ -839,7 +836,6 @@ static int rrpc_write_rq(struct rrpc *rrpc, struct bio *bio, rqd->ppa_addr = rrpc_ppa_to_gaddr(rrpc->dev, p->addr); rqd->opcode = NVM_OP_HBWRITE; - rrqd->addr = p; return NVM_IO_OK; } @@ -1389,7 +1385,6 @@ static void *rrpc_init(struct nvm_dev *dev, struct gendisk *tdisk, INIT_WORK(&rrpc->ws_requeue, rrpc_requeue); rrpc->nr_luns = lun_end - lun_begin + 1; - rrpc->total_blocks = (unsigned long)dev->blks_per_lun * rrpc->nr_luns; rrpc->nr_sects = (unsigned long long)dev->sec_per_lun * rrpc->nr_luns; /* simple round-robin strategy */ @@ -1409,7 +1404,6 @@ static void *rrpc_init(struct nvm_dev *dev, struct gendisk *tdisk, } rrpc->poffset = dev->sec_per_lun * lun_begin; - rrpc->lun_offset = lun_begin; ret = rrpc_core_init(rrpc); if (ret) { diff --git a/drivers/lightnvm/rrpc.h b/drivers/lightnvm/rrpc.h index 5e87d52..bed49ba 100644 --- a/drivers/lightnvm/rrpc.h +++ b/drivers/lightnvm/rrpc.h @@ -48,7 +48,6 @@ struct rrpc_inflight_rq { struct rrpc_rq { struct rrpc_inflight_rq inflight_rq; - struct rrpc_addr *addr; unsigned long flags; }; @@ -92,14 +91,12 @@ struct rrpc { sector_t soffset; /* logical sector offset */ u64 poffset; /* physical page offset */ - int lun_offset; int nr_luns; struct rrpc_lun *luns; /* calculated values */ unsigned long long nr_sects; - unsigned long total_blocks; /* Write strategy variables. Move these into each for structure for each * strategy