Received: by 10.223.185.116 with SMTP id b49csp6423125wrg; Wed, 28 Feb 2018 09:09:05 -0800 (PST) X-Google-Smtp-Source: AH8x22405lBcDTzFkf+P63NTdzdonYNVnGzGzPyuERW+hEc6gshj9StF/JmlIHhkozeYHEX84F4M X-Received: by 2002:a17:902:654a:: with SMTP id d10-v6mr18343674pln.117.1519837745256; Wed, 28 Feb 2018 09:09:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519837745; cv=none; d=google.com; s=arc-20160816; b=YZ+Zy1d0DE8XAldqWov4RrL3GW8jyZPas4TbRwfO/oXizXJoI5EO/X8xMTGdijw+BW qgyIHluI6vnHUu0RgS6AYHgP5VT9bfaBk8re583630cLpAnXrm7tiNhUBmx0J3M1HkeO scAQy7SE1jbttC81PFLWo3wrAy0GmA7An18j5OF1+DsmIplRcyVjLdBShYA416KDBmeu 2QrFpq3o3j85/Ee7tOpcmWcDaHKEOgX4ZuSor6zyOgVxI4TmFDkchy2dbZdiB/R07yiz OThC6RcGR3VvLMKwh9VSjQLWycgTrkRSFn2AuExT08YA+gSYcd+FIu9lkplDeo3iHw/B Wa5A== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=1j3BSqUb+KvTnnn4r7FzIxWVjECemrSAPQTqi6BUo0I=; b=dri7gXEqkNmHkWMgfgjP64XzqFqcWJvRvLf+ZXTxUTCysxJtlsDZ5ZpU3RlRPeJwNA yz2p6ZNlGjJdihv/OjoQFSVAtuc+SjfrvMofYIJHsiHb1g8PVAePMIUY16yBvlNjwGLx ep8rZ0EgGWehxwQPHC3ivJ/22dqhy/yu26G9TpB28Lh8vmLewTDJfP34z1U4JcCB1zOU keEVc74/ut0e042KU9rAaqtBHQncBflFCJ2dm0MRCi/72OvgtyyX55Ry0GMjCmJr0IVj 1jlXue/BeTBrLbJ1lBMis6+9b2TFKuSHlua4aymygkJm0AWiYWkgdMaX1TFwPnFyXoNg PS2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=DR/3CIHJ; 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 x205si1196482pgx.402.2018.02.28.09.08.50; Wed, 28 Feb 2018 09:09:05 -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=DR/3CIHJ; 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 S933642AbeB1PuK (ORCPT + 99 others); Wed, 28 Feb 2018 10:50:10 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:53222 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933625AbeB1PuB (ORCPT ); Wed, 28 Feb 2018 10:50:01 -0500 Received: by mail-wm0-f66.google.com with SMTP id t3so5887815wmc.2 for ; Wed, 28 Feb 2018 07:50:00 -0800 (PST) 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=1j3BSqUb+KvTnnn4r7FzIxWVjECemrSAPQTqi6BUo0I=; b=DR/3CIHJJtyXjYJ0gSPsdDE6iBoLRLM4ypaR/lf7yacqyZNyNAr3/uz/nYZltOpSYR 1V8yMErdy3O1+MZ1TLpR5IrKSL3TswNQxkvayU/EBO5V2Npa78zX8qBY2x6jRiRLX9vU +6AX1ImvS6E9dDLQmjox3rfoS6ZaeagptDE0LwaEANHhCyKy59efnw72/XESdEbDBj6/ XAtVZ+HoJZL/16ec91AWaRfFa1p9FX9rJNz6esNGhtnxlZL5wNWZZr0owh6da7p4C1Pl A5dxxtF5WLVDX3aKUfu9XGCT6alddo+CUTjBaekn/26ai+WAcPsSRzVV25bjtavJXSjm 3cxQ== 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=1j3BSqUb+KvTnnn4r7FzIxWVjECemrSAPQTqi6BUo0I=; b=tfYlS+ANEze3aYQNOK0bZ5s6wfBSs6JY6LxbscwkGSFCiaq8T/w5y8ubL6IKK3qWk1 CxVldQNjAOZ9xjh4UaJZ6ktErDym40oyrlp5okpBaAcgoE2kM70RmIYTrJ5JZJ/MEN/E x6Mkci6a26epNCrqYQ2lrS3HCdyVHqEn18ZAOCZOQL1CrnoTRXc4hoOHZKYmcHef7oGI 7keSXLtbNCKRlq55THDaYGZwxienVIiFnr9n96CJcfHybGeeGv7YnV4dLFaya/ixgdVr Zrj279NmGvd87JaVhfxosNDdFyRS0v03rJ8s0fYQfYh6lsJu3Wfd9fgVR8RQZv2gMPJi RL5Q== X-Gm-Message-State: APf1xPAN8BVUFZwmxd3pAY0dsMUt8wgXobfRUQet4f6fBbGvaejwlEZs tJQiUr3ZkcNYWDTsY9RYaV2Www== X-Received: by 10.80.184.23 with SMTP id j23mr24259669ede.5.1519832999825; Wed, 28 Feb 2018 07:49:59 -0800 (PST) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id n2sm1953056edb.62.2018.02.28.07.49.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Feb 2018 07:49:59 -0800 (PST) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH 11/15] lightnvm: pblk: rename ppaf* to addrf* Date: Wed, 28 Feb 2018 16:49:31 +0100 Message-Id: <1519832975-25432-12-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519832975-25432-1-git-send-email-javier@cnexlabs.com> References: <1519832975-25432-1-git-send-email-javier@cnexlabs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 b67b5b11ae16..73b221c69cfd 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 462a787893d5..cbb5b6edb7bf 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->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 bae2cc758de8..dd0089fe62b9 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); -- 2.7.4