From patchwork Thu Mar 29 22:05:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10316513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 52D1960383 for ; Thu, 29 Mar 2018 22:10:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BED02A542 for ; Thu, 29 Mar 2018 22:10:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 308C02A540; Thu, 29 Mar 2018 22:10:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 825522A53B for ; Thu, 29 Mar 2018 22:10:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752769AbeC2WKR (ORCPT ); Thu, 29 Mar 2018 18:10:17 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:39043 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752712AbeC2WHf (ORCPT ); Thu, 29 Mar 2018 18:07:35 -0400 Received: by mail-lf0-f68.google.com with SMTP id p142-v6so10346198lfd.6 for ; Thu, 29 Mar 2018 15:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KvkdyrN5kMvSYjmmQsq6EXkVIgnLCHorPae9WRvpJ8E=; b=yvckrqlcxlv5LCPymIXsAxeSDwxgL5lxUtEqlWv1f+7N0Q8HmGDarQ6S7WAMzon0kL +kBtb/4XVdUaToFt0p5EETaAL7o8OwQFy5/YOr+SN+nuLZSvZUMhpe+AJH7Lca13ma7h /UlPsZGbPNbFwmEUgVBObI5y3KJH9Oz0BKCP5B/nSD1X41n7gITZo8P5vhoztBKIk1z9 7LwovVsYHl9IL/8DYkGNDhGgIz94TGemNgAmAu1NnWOogWANtk4eJ61vbtR3U4IwWkra /iSrsAjiYZwtEQLgwJTdX6kXN5bPmA+e0l74QkvlFg8dRQMSNMm9me5SABuhrvxcZ2vz OUyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KvkdyrN5kMvSYjmmQsq6EXkVIgnLCHorPae9WRvpJ8E=; b=lIB8LXQoaiUp4+X2MI7gbHEOLWW5OG2to/j5mnrw/HE0vKRbwcH3X0FCoM9zIHWVHm l3BEGdzN4thoIwh1VZ3NPSXClKhHx7Y/H5HgYR2xXIXO8MUiVMnbEOgPItTAir0cXYIP 0NppbK/tZIgCl/AInOQcTpyh0YWmZBDkWeDYQqSPdkOhZA7r70TalGzvwr7/eSPKTm4D 5eQ5rhjDDN0TdeJcwM2zm9aPyIiD5YbXBxOk5B7qiJ0JUKTSXEBP3NLneg91vALhnU3T DwitPWfpDG2dDplM/HVt1O3AFeD22Sbw3SmUVHfxh0eSs/6iUaTqRiyDk38KIDL4cEC+ xuLA== X-Gm-Message-State: AElRT7HqTnRDk6ne7aUkj+Y/xbNMmVfqv9KszmXY6JbXwKMoFovQxqOf zcmMQkkTjK+hdp3KJ3VvVQsQ+A== X-Google-Smtp-Source: AIpwx4/Ngh0Z+Zj7BxicKz7LRk0uVqVDxreFVbKuJUR63TdMZe7f/LI34EjzBE0g7jEHsNSJy+9nGw== X-Received: by 10.46.134.25 with SMTP id a25mr6418726lji.87.1522361253647; Thu, 29 Mar 2018 15:07:33 -0700 (PDT) Received: from Macroninja.cnexlabs.com (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.gmail.com with ESMTPSA id i89-v6sm1365508lfk.12.2018.03.29.15.07.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 15:07:32 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, keith.busch@intel.com, javier@cnexlabs.com, =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 32/37] lightnvm: pblk: rename ppaf* to addrf* Date: Fri, 30 Mar 2018 00:05:19 +0200 Message-Id: <20180329220524.30363-33-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180329220524.30363-1-mb@lightnvm.io> References: <20180329220524.30363-1-mb@lightnvm.io> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Javier González 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 Signed-off-by: Matias Bjørling --- 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 34ff47705293..5b381700ef30 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; @@ -229,7 +229,7 @@ static int pblk_set_addrf_12(struct nvm_geo *geo, struct nvm_addrf_12 *dst) 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; @@ -241,7 +241,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; } @@ -377,7 +377,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; INIT_LIST_HEAD(&pblk->compl_list); diff --git a/drivers/lightnvm/pblk-sysfs.c b/drivers/lightnvm/pblk-sysfs.c index 2489ea0edfa0..fd2caad39d49 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_addrf_12 *geo_ppaf; ssize_t sz = 0; - ppaf = (struct nvm_addrf_12 *)&pblk->ppaf; + ppaf = (struct nvm_addrf_12 *)&pblk->addrf; geo_ppaf = (struct nvm_addrf_12 *)&geo->addrf; sz = snprintf(page, PAGE_SIZE, "g:(b:%d)blk:%d/%d,pg:%d/%d,lun:%d/%d,ch:%d/%d,pl:%d/%d,sec:%d/%d\n", - pblk->ppaf_bitsize, + pblk->addrf_len, ppaf->blk_offset, ppaf->blk_len, ppaf->pg_offset, ppaf->pg_len, ppaf->lun_offset, ppaf->lun_len, diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h index 6607c41b23c0..40aee9e48af4 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_addrf ppaf; - int ppaf_bitsize; + struct nvm_addrf addrf; + int addrf_len; struct pblk_rb rwb; @@ -947,7 +947,7 @@ static inline int pblk_ppa_to_pos(struct nvm_geo *geo, struct ppa_addr p) static inline struct ppa_addr addr_to_gen_ppa(struct pblk *pblk, u64 paddr, u64 line_id) { - struct nvm_addrf_12 *ppaf = (struct nvm_addrf_12 *)&pblk->ppaf; + struct nvm_addrf_12 *ppaf = (struct nvm_addrf_12 *)&pblk->addrf; struct ppa_addr ppa; ppa.ppa = 0; @@ -964,7 +964,7 @@ static inline struct ppa_addr addr_to_gen_ppa(struct pblk *pblk, u64 paddr, static inline u64 pblk_dev_ppa_to_line_addr(struct pblk *pblk, struct ppa_addr p) { - struct nvm_addrf_12 *ppaf = (struct nvm_addrf_12 *)&pblk->ppaf; + struct nvm_addrf_12 *ppaf = (struct nvm_addrf_12 *)&pblk->addrf; u64 paddr; paddr = (u64)p.g.ch << ppaf->ch_offset; @@ -988,7 +988,7 @@ static inline struct ppa_addr pblk_ppa32_to_ppa64(struct pblk *pblk, u32 ppa32) ppa64.c.line = ppa32 & ((~0U) >> 1); ppa64.c.is_cached = 1; } else { - struct nvm_addrf_12 *ppaf = (struct nvm_addrf_12 *)&pblk->ppaf; + struct nvm_addrf_12 *ppaf = (struct nvm_addrf_12 *)&pblk->addrf; ppa64.g.ch = (ppa32 & ppaf->ch_mask) >> ppaf->ch_offset; ppa64.g.lun = (ppa32 & ppaf->lun_mask) >> ppaf->lun_offset; @@ -1011,7 +1011,7 @@ static inline u32 pblk_ppa64_to_ppa32(struct pblk *pblk, struct ppa_addr ppa64) ppa32 |= ppa64.c.line; ppa32 |= 1U << 31; } else { - struct nvm_addrf_12 *ppaf = (struct nvm_addrf_12 *)&pblk->ppaf; + struct nvm_addrf_12 *ppaf = (struct nvm_addrf_12 *)&pblk->addrf; ppa32 |= ppa64.g.ch << ppaf->ch_offset; ppa32 |= ppa64.g.lun << ppaf->lun_offset; @@ -1029,7 +1029,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]); @@ -1045,7 +1045,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);