lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 29 Aug 2018 13:10:50 +0000
From:   Javier Gonzalez <javier@...xlabs.com>
To:     Matias Bjørling <mb@...htnvm.io>
CC:     "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] lightnvm: pblk: add helpers for chunk addresses

> On 29 Aug 2018, at 14.36, Matias Bjørling <mb@...htnvm.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@...xlabs.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

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists