Received: by 10.223.185.116 with SMTP id b49csp1624564wrg; Wed, 21 Feb 2018 23:49:30 -0800 (PST) X-Google-Smtp-Source: AH8x22763bzkoOyp28M7QooBaciVUkFiK9TVChgrwapn8xmGMYCwVGyh0dzcLRTPfbDwNQcdbMLB X-Received: by 10.99.145.194 with SMTP id l185mr4812374pge.394.1519285770669; Wed, 21 Feb 2018 23:49:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519285770; cv=none; d=google.com; s=arc-20160816; b=bRKu/KD1JxGgo6dghLrF673pk8/13pzi98O0yu6t2cZoOCkYSEjYQvF0IO1iXHcCxc a9ZZk2vzeBa+e/la1F17Eg1w+YJwoB91qlfETravT/meQzfyBThwQfd8FXCkRzruAvEQ fB+/eWwL3wHLabqNa6a+oNtbwK+U9WWw1VyPPUaYbWLhXeFzh5WdgQCMzgeS6wzrVlMp 7AoxMd9dc4rS+FV6ZcE2jn+YtBe4KOcWKvwqhFSSdq51DPM3PAqXBQ/hUAeeHgjh8gip P4xuP4sF/fh/edLK/6s2JKrRwffDxY2qqGXnVDNTq88Q4mE7qiTJvIpjrcVNiyBjX67u 9iGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=ICNRH/r28xcR2wTNiuaL+RzxvGXAGti/HUC66900Wec=; b=Tzhw6HkrWo3s3PBP8xoScnSUy9bpP7HKpFOuAEhmzmsgFUioc+g5QyzOjpKpERTXrB xtM1y4ujVDuKYvNHWHSiM7FTs6HLYpCpu5HHAoIJzR/JxHp/klh2psi6A0//mHX8I5lc wt4H1+YlCvzB600V7OhgClPwXOQFqliyK1DfwZ/OOW8J7Q3OJ2zjl+6c85ldxs7Zntmx KVdecfIjs/RvEbefa+6kNCSdK8A9bQF8ykKHp88uWgUrpC5+VJJu6ufhzqKha1//W27q QE9hvKuHjOl4xx/+Bd0tVdiEVgIqaQMlMz8/B1tstW3NxC/zq+PHh3uElSspHjUtNpY7 oR8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=W3jPuIie; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s81si801971pfs.57.2018.02.21.23.49.16; Wed, 21 Feb 2018 23:49:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=W3jPuIie; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752996AbeBVHsI (ORCPT + 99 others); Thu, 22 Feb 2018 02:48:08 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:35249 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752963AbeBVHsA (ORCPT ); Thu, 22 Feb 2018 02:48:00 -0500 Received: by mail-lf0-f67.google.com with SMTP id 70so6061183lfw.2 for ; Wed, 21 Feb 2018 23:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ICNRH/r28xcR2wTNiuaL+RzxvGXAGti/HUC66900Wec=; b=W3jPuIieJSg/cQ/DvOdMKmqAJOV4pvmH+QRcK9UXuchSuVe7pr6vJR+738qUGdbM/7 4XwYJ/z51LDb1ej9DYAqbwdsEDh20M8tqrsIg04BPV/1vhjqPRrrU7w2GFVn8dwG9Wjg ujKrJMT2/YY3KrB4IAxZQ5aDY4NnnxDwDz2efTdSlyWXzrAcbx7J+RWKWDiFcvqmquVA GgWl00BvfysoDxMH0NYiDb4enk0PK3Zq1nDzyGnVCYLfKGACYIILL0zpzmp5GfZWO2ZB pIm+QsTnSNbKK1MCorgtf5n5kGSJD1aJseWbjoGCJT3BJkILGf935r+KowcxwMdGUUQr XgTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ICNRH/r28xcR2wTNiuaL+RzxvGXAGti/HUC66900Wec=; b=RehaHlQlBbsdsqWBBB+i1ffeUK/QhEGQSkFggu5iAw/UcztsZ09OiUdDM2dABIs3QG 1NZ/U/Z5eriIyW5v1mrTdnzIdBVomZ0Sh7+jq3G7K52E9PLKucaiYdFxfZxAx+ppD3Gc VWf6myqtsR0OOPN3i6FqrjQBAMzpsSJvD3UcOobzk5W3TuyCk6mFILVhteGdiBxbYAMG nqIQqip8YtDL+EgAuYF/bOYbyyhtaY0jYtIl3lMZWJuFQn67lpq7DJRhbzLeYJ+eqAW1 3FwesxQ+YqZcCnhizlrIpTlI15YKXBFnw0f1HoKwyItIr4EiwDUTin0Eok+F1YTAKR17 3TZA== X-Gm-Message-State: APf1xPB7DSExS7jwzgqM+XjVNwdBVaOFPEwJcaqC4cl64jigvCfEti4K 98i6vHjiW/gpNyZAvW2IgcnAXA== X-Received: by 10.25.234.148 with SMTP id y20mr4093059lfi.53.1519285679142; Wed, 21 Feb 2018 23:47:59 -0800 (PST) Received: from [192.168.0.10] (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.googlemail.com with ESMTPSA id j7sm4616135lfh.46.2018.02.21.23.47.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 23:47:58 -0800 (PST) Subject: Re: [PATCH 10/20] lightnvm: pblk: rename ppaf* to addrf* To: =?UTF-8?Q?Javier_Gonz=c3=a1lez?= Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, =?UTF-8?Q?Javier_Gonz=c3=a1lez?= References: <1519205218-26994-1-git-send-email-javier@cnexlabs.com> <1519205218-26994-11-git-send-email-javier@cnexlabs.com> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: Date: Thu, 22 Feb 2018 08:47:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1519205218-26994-11-git-send-email-javier@cnexlabs.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/21/2018 10:26 AM, Javier González wrote: > In preparation for 2.0 support in pblk, rename variables referring to > the address format to addrf and reserve ppaf for the 1.2 path. > > Signed-off-by: Javier González > --- > drivers/lightnvm/pblk-init.c | 8 ++++---- > drivers/lightnvm/pblk-sysfs.c | 4 ++-- > drivers/lightnvm/pblk.h | 16 ++++++++-------- > 3 files changed, 14 insertions(+), 14 deletions(-) > > diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c > index 6bf51ef8f516..56b4afc27add 100644 > --- a/drivers/lightnvm/pblk-init.c > +++ b/drivers/lightnvm/pblk-init.c > @@ -80,7 +80,7 @@ static size_t pblk_trans_map_size(struct pblk *pblk) > { > int entry_size = 8; > > - if (pblk->ppaf_bitsize < 32) > + if (pblk->addrf_len < 32) > entry_size = 4; > > return entry_size * pblk->rl.nr_secs; > @@ -198,7 +198,7 @@ static int pblk_set_addrf_12(struct nvm_geo *geo, > return dst->blk_offset + src->blk_len; > } > > -static int pblk_set_ppaf(struct pblk *pblk) > +static int pblk_set_addrf(struct pblk *pblk) > { > struct nvm_tgt_dev *dev = pblk->dev; > struct nvm_geo *geo = &dev->geo; > @@ -210,7 +210,7 @@ static int pblk_set_ppaf(struct pblk *pblk) > return -EINVAL; > } > > - pblk->ppaf_bitsize = pblk_set_addrf_12(geo, (void *)&pblk->ppaf); > + pblk->addrf_len = pblk_set_addrf_12(geo, (void *)&pblk->addrf); > > return 0; > } > @@ -319,7 +319,7 @@ static int pblk_core_init(struct pblk *pblk) > if (!pblk->r_end_wq) > goto free_bb_wq; > > - if (pblk_set_ppaf(pblk)) > + if (pblk_set_addrf(pblk)) > goto free_r_end_wq; > > if (pblk_rwb_init(pblk)) > diff --git a/drivers/lightnvm/pblk-sysfs.c b/drivers/lightnvm/pblk-sysfs.c > index 81288aa9162a..d3b50741b691 100644 > --- a/drivers/lightnvm/pblk-sysfs.c > +++ b/drivers/lightnvm/pblk-sysfs.c > @@ -117,12 +117,12 @@ static ssize_t pblk_sysfs_ppaf(struct pblk *pblk, char *page) > struct nvm_addr_format_12 *geo_ppaf; > ssize_t sz = 0; > > - ppaf = (struct nvm_addr_format_12 *)&pblk->ppaf; > + ppaf = (struct nvm_addr_format_12 *)&pblk->addrf; > geo_ppaf = (struct nvm_addr_format_12 *)&geo->c.addrf; > > sz = snprintf(page, PAGE_SIZE, > "pblk:(s:%d)ch:%d/%d,lun:%d/%d,blk:%d/%d,pg:%d/%d,pl:%d/%d,sec:%d/%d\n", > - pblk->ppaf_bitsize, > + pblk->addrf_len, > ppaf->ch_offset, ppaf->ch_len, > ppaf->lun_offset, ppaf->lun_len, > ppaf->blk_offset, ppaf->blk_len, > diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h > index 4f7a365436f1..46b29a492f74 100644 > --- a/drivers/lightnvm/pblk.h > +++ b/drivers/lightnvm/pblk.h > @@ -570,8 +570,8 @@ struct pblk { > struct pblk_line_mgmt l_mg; /* Line management */ > struct pblk_line_meta lm; /* Line metadata */ > > - struct nvm_addr_format ppaf; > - int ppaf_bitsize; > + struct nvm_addr_format addrf; > + int addrf_len; > > struct pblk_rb rwb; > > @@ -948,7 +948,7 @@ static inline struct ppa_addr addr_to_gen_ppa(struct pblk *pblk, u64 paddr, > u64 line_id) > { > struct nvm_addr_format_12 *ppaf = > - (struct nvm_addr_format_12 *)&pblk->ppaf; > + (struct nvm_addr_format_12 *)&pblk->addrf; > struct ppa_addr ppa; > > ppa.ppa = 0; > @@ -966,7 +966,7 @@ static inline u64 pblk_dev_ppa_to_line_addr(struct pblk *pblk, > struct ppa_addr p) > { > struct nvm_addr_format_12 *ppaf = > - (struct nvm_addr_format_12 *)&pblk->ppaf; > + (struct nvm_addr_format_12 *)&pblk->addrf; > u64 paddr; > > paddr = (u64)p.g.ch << ppaf->ch_offset; > @@ -991,7 +991,7 @@ static inline struct ppa_addr pblk_ppa32_to_ppa64(struct pblk *pblk, u32 ppa32) > ppa64.c.is_cached = 1; > } else { > struct nvm_addr_format_12 *ppaf = > - (struct nvm_addr_format_12 *)&pblk->ppaf; > + (struct nvm_addr_format_12 *)&pblk->addrf; > > ppa64.g.ch = (ppa32 & ppaf->ch_mask) >> ppaf->ch_offset; > ppa64.g.lun = (ppa32 & ppaf->lun_mask) >> ppaf->lun_offset; > @@ -1015,7 +1015,7 @@ static inline u32 pblk_ppa64_to_ppa32(struct pblk *pblk, struct ppa_addr ppa64) > ppa32 |= 1U << 31; > } else { > struct nvm_addr_format_12 *ppaf = > - (struct nvm_addr_format_12 *)&pblk->ppaf; > + (struct nvm_addr_format_12 *)&pblk->addrf; > > ppa32 |= ppa64.g.ch << ppaf->ch_offset; > ppa32 |= ppa64.g.lun << ppaf->lun_offset; > @@ -1033,7 +1033,7 @@ static inline struct ppa_addr pblk_trans_map_get(struct pblk *pblk, > { > struct ppa_addr ppa; > > - if (pblk->ppaf_bitsize < 32) { > + if (pblk->addrf_len < 32) { > u32 *map = (u32 *)pblk->trans_map; > > ppa = pblk_ppa32_to_ppa64(pblk, map[lba]); > @@ -1049,7 +1049,7 @@ static inline struct ppa_addr pblk_trans_map_get(struct pblk *pblk, > static inline void pblk_trans_map_set(struct pblk *pblk, sector_t lba, > struct ppa_addr ppa) > { > - if (pblk->ppaf_bitsize < 32) { > + if (pblk->addrf_len < 32) { > u32 *map = (u32 *)pblk->trans_map; > > map[lba] = pblk_ppa64_to_ppa32(pblk, ppa); > Looks good. I'll pick up when rebased.