From: Javier Gonzalez <javier@cnexlabs.com>
To: "Matias Bjørling" <mb@lightnvm.io>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] lightnvm: pblk: add helpers for chunk addresses
Date: Wed, 29 Aug 2018 13:10:50 +0000 [thread overview]
Message-ID: <A4C9F089-0BCF-4753-B3C7-AE166A14D489@cnexlabs.com> (raw)
In-Reply-To: <742b25cb-c871-2ef4-d34c-a81bce9283a8@lightnvm.io>
[-- Attachment #1: Type: text/plain, Size: 1578 bytes --]
> On 29 Aug 2018, at 14.36, Matias Bjørling <mb@lightnvm.io> wrote:
>
> On 08/29/2018 10:37 AM, Javier González wrote:
>> Implement helpers to go from ppas to a chunk within a line and an
>> address within a chunk.
>> These helpers will be used on the patches adding trace support in pblk,
>> which will be sent in this window.
>> Signed-off-by: Javier González <javier@cnexlabs.com>
>> ---
>> drivers/lightnvm/pblk.h | 31 +++++++++++++++++++++++++++++++
>> 1 file changed, 31 insertions(+)
>> diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h
>> index be67bbfa3d0a..1bfbd3315598 100644
>> --- a/drivers/lightnvm/pblk.h
>> +++ b/drivers/lightnvm/pblk.h
>> @@ -1034,6 +1034,37 @@ static inline struct ppa_addr addr_to_gen_ppa(struct pblk *pblk, u64 paddr,
>> return ppa;
>> }
>> +static inline struct nvm_chk_meta *pblk_dev_ppa_to_chunk(struct pblk *pblk,
>> + struct ppa_addr p)
>> +{
>> + struct nvm_tgt_dev *dev = pblk->dev;
>> + struct nvm_geo *geo = &dev->geo;
>> + struct pblk_line *line = &pblk->lines[pblk_ppa_to_line(p)];
>> + int pos = pblk_ppa_to_pos(geo, p);
>> +
>> + return &line->chks[pos];
>> +}
>> +
>> +static inline u64 pblk_dev_ppa_to_chunk_addr(struct pblk *pblk,
>> + struct ppa_addr p)
>> +{
>> + struct nvm_tgt_dev *dev = pblk->dev;
>> + struct nvm_geo *geo = &dev->geo;
>> + u64 caddr;
>> +
>> + if (geo->version == NVM_OCSSD_SPEC_12) {
>
> Please move this into core.
Wanted to wait until the rest of address conversions were moved, but you
can get a v2 for this.
Javier
[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2018-08-29 13:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-29 8:37 Javier González
2018-08-29 12:36 ` Matias Bjørling
2018-08-29 13:10 ` Javier Gonzalez [this message]
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=A4C9F089-0BCF-4753-B3C7-AE166A14D489@cnexlabs.com \
--to=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
all inboxes | Powered by JetHome®