From patchwork Mon Feb 26 13:17:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= X-Patchwork-Id: 10242265 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 38C24602DC for ; Mon, 26 Feb 2018 13:19:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 279D52A000 for ; Mon, 26 Feb 2018 13:19:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BEF12A007; Mon, 26 Feb 2018 13:19:44 +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 61E932A000 for ; Mon, 26 Feb 2018 13:19:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753026AbeBZNTm (ORCPT ); Mon, 26 Feb 2018 08:19:42 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:54507 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753200AbeBZNRl (ORCPT ); Mon, 26 Feb 2018 08:17:41 -0500 Received: by mail-wm0-f65.google.com with SMTP id z81so17362059wmb.4 for ; Mon, 26 Feb 2018 05:17:40 -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=QhRyMujKBAsTP+zB0rhODIoh1cirHbNah1AFDVzHmsU=; b=Zk+lY5G30wh7EM06CR/eYrGlqway9h49H+/1zjVZKOmBY1bghtp2ijL/MhOA1wzi52 4Ewdt82xj0M7oggQu8GmRiCZjD1XHjqV6Z4WFuVfa9JkNyVn8UYwaP5lNdROoKt4PjIG gXYemndWwAKCShZzrsXb5gR6p9nQD2JoM0m0PalEcNN3oqNyu5r8a85tsJ65NeHqUQEN A+7iA12cxX45ZDtyCVmqyitXkCkNS2U7LBv26lyjGg6ZV6NQVYMgjJ6bIeswzYqeAYpP KErYNMeG6BHBNWdejmBRkwzte65DWxL8c2RizFmCQE5XoIMjFueBJAm+X4EOk4D208sX iH4w== 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=QhRyMujKBAsTP+zB0rhODIoh1cirHbNah1AFDVzHmsU=; b=B8V1lZnss+En2IP8gjUF+J3O0H5XcfpnP+3ijIayyKqTVOK5FHkfKYHcrIpEvndad5 UVPw14CZpCEAotwRz1Bn5psHKwIXXN/aaYgSVg2tAczdbGaYmhGC9pALA6hZqbiAHMBk T/bi3rx7F4xfS/GkVB1UMPO5Mm0z8232sBCcZT0wtQEu3B4w/Sf0Av7TAr2tHW1Pcx4M 2T7HrxWN+I2CgvUpL6sX0zzXyR5nJ1IdUz3DxzOtm3YmZnhfpjQOH26P4JPqDxZzS5FS Zhm5C67tsocl8VSBsueauOcizUv37vZLXRJKppJA8L6L2Xzwiil8fYIeqvY/1QLYQXTH pVJw== X-Gm-Message-State: APf1xPDMhke4eJHV7tzTOv37XAf8Obmp8o0gQ0PxGIIn3ymp6d5zQ9Ix 7llAO1uI1lyIQQd+9R3u9cUpzw== X-Google-Smtp-Source: AH8x224pIbtqfsCxEabKzJpo469u9lVjyscFDYUIX9tTo4WE5yjUk6vbjE0P162rwmY9wqUVxOngwQ== X-Received: by 10.80.169.92 with SMTP id m28mr14585395edc.131.1519651059769; Mon, 26 Feb 2018 05:17:39 -0800 (PST) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id g59sm7097451ede.19.2018.02.26.05.17.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Feb 2018 05:17:38 -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 12/19] lightnvn: pblk: use generic address format Date: Mon, 26 Feb 2018 14:17:11 +0100 Message-Id: <1519651038-16845-13-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519651038-16845-1-git-send-email-javier@cnexlabs.com> References: <1519651038-16845-1-git-send-email-javier@cnexlabs.com> 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 Use the generic address format on common address manipulations. Signed-off-by: Javier González --- drivers/lightnvm/pblk-core.c | 10 +++++----- drivers/lightnvm/pblk-map.c | 4 ++-- drivers/lightnvm/pblk-sysfs.c | 4 ++-- drivers/lightnvm/pblk.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c index 7c726003a8d2..1d7c6313f3d9 100644 --- a/drivers/lightnvm/pblk-core.c +++ b/drivers/lightnvm/pblk-core.c @@ -885,7 +885,7 @@ int pblk_line_erase(struct pblk *pblk, struct pblk_line *line) } ppa = pblk->luns[bit].bppa; /* set ch and lun */ - ppa.g.blk = line->id; + ppa.a.blk = line->id; atomic_dec(&line->left_eblks); WARN_ON(test_and_set_bit(bit, line->erase_bitmap)); @@ -1693,8 +1693,8 @@ static void __pblk_down_page(struct pblk *pblk, struct ppa_addr *ppa_list, int i; for (i = 1; i < nr_ppas; i++) - WARN_ON(ppa_list[0].g.lun != ppa_list[i].g.lun || - ppa_list[0].g.ch != ppa_list[i].g.ch); + WARN_ON(ppa_list[0].a.lun != ppa_list[i].a.lun || + ppa_list[0].a.ch != ppa_list[i].a.ch); #endif ret = down_timeout(&rlun->wr_sem, msecs_to_jiffies(30000)); @@ -1738,8 +1738,8 @@ void pblk_up_page(struct pblk *pblk, struct ppa_addr *ppa_list, int nr_ppas) int i; for (i = 1; i < nr_ppas; i++) - WARN_ON(ppa_list[0].g.lun != ppa_list[i].g.lun || - ppa_list[0].g.ch != ppa_list[i].g.ch); + WARN_ON(ppa_list[0].a.lun != ppa_list[i].a.lun || + ppa_list[0].a.ch != ppa_list[i].a.ch); #endif rlun = &pblk->luns[pos]; diff --git a/drivers/lightnvm/pblk-map.c b/drivers/lightnvm/pblk-map.c index 04e08d76ea5f..20dbaa89c9df 100644 --- a/drivers/lightnvm/pblk-map.c +++ b/drivers/lightnvm/pblk-map.c @@ -127,7 +127,7 @@ void pblk_map_erase_rq(struct pblk *pblk, struct nvm_rq *rqd, atomic_dec(&e_line->left_eblks); *erase_ppa = rqd->ppa_list[i]; - erase_ppa->g.blk = e_line->id; + erase_ppa->a.blk = e_line->id; spin_unlock(&e_line->lock); @@ -168,6 +168,6 @@ void pblk_map_erase_rq(struct pblk *pblk, struct nvm_rq *rqd, set_bit(bit, e_line->erase_bitmap); atomic_dec(&e_line->left_eblks); *erase_ppa = pblk->luns[bit].bppa; /* set ch and lun */ - erase_ppa->g.blk = e_line->id; + erase_ppa->a.blk = e_line->id; } } diff --git a/drivers/lightnvm/pblk-sysfs.c b/drivers/lightnvm/pblk-sysfs.c index d3b50741b691..ccfb3abd2773 100644 --- a/drivers/lightnvm/pblk-sysfs.c +++ b/drivers/lightnvm/pblk-sysfs.c @@ -39,8 +39,8 @@ static ssize_t pblk_sysfs_luns_show(struct pblk *pblk, char *page) sz += snprintf(page + sz, PAGE_SIZE - sz, "pblk: pos:%d, ch:%d, lun:%d - %d\n", i, - rlun->bppa.g.ch, - rlun->bppa.g.lun, + rlun->bppa.a.ch, + rlun->bppa.a.lun, active); } diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h index 46b29a492f74..6e1fcd1a538a 100644 --- a/drivers/lightnvm/pblk.h +++ b/drivers/lightnvm/pblk.h @@ -936,12 +936,12 @@ static inline int pblk_pad_distance(struct pblk *pblk) static inline int pblk_ppa_to_line(struct ppa_addr p) { - return p.g.blk; + return p.a.blk; } static inline int pblk_ppa_to_pos(struct nvm_geo *geo, struct ppa_addr p) { - return p.g.lun * geo->num_ch + p.g.ch; + return p.a.lun * geo->num_ch + p.a.ch; } static inline struct ppa_addr addr_to_gen_ppa(struct pblk *pblk, u64 paddr,