All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matias Bjørling" <mb@lightnvm.io>
To: Wenwei Tao <ww.tao0320@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH v2 1/2] lightnvm: specify target's logical address area
Date: Wed, 27 Jan 2016 20:46:26 +0100	[thread overview]
Message-ID: <56A91E92.6000409@lightnvm.io> (raw)
In-Reply-To: <CACygaLDfaV24aWUWFcsHCQaz-P3eSB5Ls=jP8Z0fJ_w=3Vo-cA@mail.gmail.com>

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

      reply	other threads:[~2016-01-27 19:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 12:33 [PATCH v2 1/2] lightnvm: specify target's logical address area Wenwei Tao
2016-01-26 12:33 ` [PATCH v2 2/2] lightnvm: add non-continuous lun target creation support Wenwei Tao
2016-01-27  9:44   ` Matias Bjørling
2016-01-28  8:50     ` Wenwei Tao
2016-01-28  9:09       ` Matias Bjørling
2016-01-28 10:19         ` Wenwei Tao
2016-01-26 14:52 ` [PATCH v2 1/2] lightnvm: specify target's logical address area Matias Bjørling
2016-01-27  2:21   ` Wenwei Tao
2016-01-27  5:52     ` Matias Bjørling
2016-01-27  6:06       ` Wenwei Tao
2016-01-27  9:36         ` Matias Bjørling
2016-01-27 12:47           ` Wenwei Tao
2016-01-27 13:26             ` Matias Bjørling
2016-01-27 14:58               ` Wenwei Tao
2016-01-27 19:46                 ` Matias Bjørling [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=56A91E92.6000409@lightnvm.io \
    --to=mb@lightnvm.io \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ww.tao0320@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.