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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 27 Jan 2016 20:46:26 +0100
From:	Matias Bjørling <mb@...htnvm.io>
To:	Wenwei Tao <ww.tao0320@...il.com>
Cc:	linux-kernel@...r.kernel.org, linux-block@...r.kernel.org
Subject: Re: [PATCH v2 1/2] lightnvm: specify target's logical address area

On 01/27/2016 03:58 PM, Wenwei Tao wrote:
> static int nvm_core_init(struct nvm_dev *dev)
> {
>
> ...
> dev->sec_per_pg = grp->fpg_sz / grp->csecs;
> ...
> /* calculated values */
> dev->sec_per_pl = dev->sec_per_pg * dev->nr_planes;
> dev->sec_per_blk = dev->sec_per_pl * dev->pgs_per_blk;
> dev->sec_per_lun = dev->sec_per_blk * dev->blks_per_lun;
> ...
>
> }
>
> static int rrpc_luns_init(struct rrpc *rrpc, int lun_begin, int lun_end)
> {
>    ...
>    for (i = 0; i < rrpc->nr_luns; i++) {
>       ...
>      rrpc->nr_pages += dev->sec_per_lun;
>      ...
>    }
>   ...
> }
>
> I prefer rrpc->nr_pages to be the number of pages allocated to rrpc,
> but the code above indeed make me confuse about the sec and page
> thing.
> Hope I'm not misunderstand the code.
> ps: I'm not an expert on flash, if the confusion is caused by lack of
> knowledge about flash, pleas let me know.

rrpc->nr_pages should properly be rrpc->nr_sects, as it is indeed 
confusing that it is called a page, when we actually use it for number 
of sectors.

Pages refers to 4-64KB units, of which we have 1-16 sectors inside.

I have pushed an update to for-next that renames rrpc->nr_pages to 
rrpc->nr_sects. That should hopefully help future readers.

I also updated dev->total_pages to total_secs.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ