linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Javier González" <jg@lightnvm.io>
To: mb@lightnvm.io
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Javier González" <javier@cnexlabs.com>
Subject: [PATCH 09/20] lightnvm: remove unnecessary variables in rrpc
Date: Fri, 18 Nov 2016 15:43:31 +0100	[thread overview]
Message-ID: <1479480222-18790-10-git-send-email-javier@cnexlabs.com> (raw)
In-Reply-To: <1479480222-18790-1-git-send-email-javier@cnexlabs.com>

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 <javier@cnexlabs.com>
---
 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
-- 
2.7.4

  parent reply	other threads:[~2016-11-18 14:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 14:43 [PATCH 00/20] lightnvm: simplify media manager Javier González
2016-11-18 14:43 ` [PATCH 01/20] lightnvm: enable to send hint to erase command Javier González
2016-11-18 14:43 ` [PATCH 02/20] lightnvm: do not protect block 0 Javier González
2016-11-18 14:43 ` [PATCH 03/20] lightnvm: export set bad block table Javier González
2016-11-18 14:43 ` [PATCH 04/20] lightnvm: add ECC error codes Javier González
2016-11-18 14:43 ` [PATCH 05/20] lightnvm: rrpc: split bios of size > 256kb Javier González
2016-11-18 14:43 ` [PATCH 06/20] lightnvm: remove sysfs configuration interface Javier González
2016-11-18 14:43 ` [PATCH 07/20] lightnvm: cleanup unused target operations Javier González
2016-11-18 14:43 ` [PATCH 08/20] lightnvm: make address conversion functions global Javier González
2016-11-18 14:43 ` Javier González [this message]
2016-11-18 14:43 ` [PATCH 10/20] lightnvm: use constant name instead of value Javier González
2016-11-18 14:43 ` [PATCH 11/20] lightnvm: remove gen_lun abstraction Javier González
2016-11-18 14:43 ` [PATCH 12/20] lightnvm: manage lun partitions internally in mm Javier González
2016-11-18 14:43 ` [PATCH 13/20] lightnvm: move block provisioning to targets Javier González
2016-11-18 18:20   ` kbuild test robot
2016-11-18 14:43 ` [PATCH 14/20] lightnvm: remove get_lun operation on gennvm Javier González
2016-11-18 14:43 ` [PATCH 15/20] lightnvm: remove debug lun statistics from gennvm Javier González
2016-11-18 14:43 ` [PATCH 16/20] lightnvm: eliminate nvm_block abstraction on mm Javier González
2016-11-18 18:45   ` kbuild test robot
2016-11-18 14:43 ` [PATCH 17/20] lightnvm: eliminate nvm_lun abstraction in mm Javier González
2016-11-18 14:43 ` [PATCH 18/20] lightnvm: introduce helpers for generic ops in rrpc Javier González
2016-11-18 14:43 ` [PATCH 19/20] lightnvm: introduce max_phys_sects helper function Javier González
2016-11-18 14:43 ` [PATCH 20/20] lightnvm: use target nvm on target-specific ops Javier González
2016-11-21 11:29 ` [PATCH 00/20] lightnvm: simplify media manager Matias Bjørling

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=1479480222-18790-10-git-send-email-javier@cnexlabs.com \
    --to=jg@lightnvm.io \
    --cc=javier@cnexlabs.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mb@lightnvm.io \
    /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).