Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1319545
| From | Matias Bjørling <mb@lightnvm.io> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 1/2] lightnvm: specify target's logical address area |
| Date | 2016-01-27 20:50 +0100 |
| Message-ID | <qVEgj-6M-53@gated-at.bofh.it> (permalink) |
| References | (4 earlier) <qVrsK-7FL-25@gated-at.bofh.it> <qVuJZ-1sr-33@gated-at.bofh.it> <qVxHQ-3xq-3@gated-at.bofh.it> <qVykB-43Z-63@gated-at.bofh.it> <qVzJF-4Zj-33@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2 1/2] lightnvm: specify target's logical address area Wenwei Tao <ww.tao0320@gmail.com> - 2016-01-26 13:40 +0100
Re: [PATCH v2 1/2] lightnvm: specify target's logical address area Matias Bjørling <mb@lightnvm.io> - 2016-01-26 16:00 +0100
Re: [PATCH v2 1/2] lightnvm: specify target's logical address area Wenwei Tao <ww.tao0320@gmail.com> - 2016-01-27 03:30 +0100
Re: [PATCH v2 1/2] lightnvm: specify target's logical address area Matias Bjørling <mb@lightnvm.io> - 2016-01-27 07:00 +0100
Re: [PATCH v2 1/2] lightnvm: specify target's logical address area Wenwei Tao <ww.tao0320@gmail.com> - 2016-01-27 07:10 +0100
Re: [PATCH v2 1/2] lightnvm: specify target's logical address area Matias Bjørling <mb@lightnvm.io> - 2016-01-27 10:40 +0100
Re: [PATCH v2 1/2] lightnvm: specify target's logical address area Wenwei Tao <ww.tao0320@gmail.com> - 2016-01-27 13:50 +0100
Re: [PATCH v2 1/2] lightnvm: specify target's logical address area Matias Bjørling <mb@lightnvm.io> - 2016-01-27 14:30 +0100
Re: [PATCH v2 1/2] lightnvm: specify target's logical address area Wenwei Tao <ww.tao0320@gmail.com> - 2016-01-27 16:00 +0100
Re: [PATCH v2 1/2] lightnvm: specify target's logical address area Matias Bjørling <mb@lightnvm.io> - 2016-01-27 20:50 +0100
csiph-web