From patchwork Wed Feb 28 15:49:32 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: 10248781 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 D78BF60365 for ; Wed, 28 Feb 2018 17:08:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4DE128599 for ; Wed, 28 Feb 2018 17:08:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B995D28806; Wed, 28 Feb 2018 17:08:24 +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 D561C28599 for ; Wed, 28 Feb 2018 17:08:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933313AbeB1PuI (ORCPT ); Wed, 28 Feb 2018 10:50:08 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:54900 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933627AbeB1PuC (ORCPT ); Wed, 28 Feb 2018 10:50:02 -0500 Received: by mail-wm0-f65.google.com with SMTP id z81so5864303wmb.4 for ; Wed, 28 Feb 2018 07:50:01 -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=keaazHnGYse1nig0TAXoTOmdpGU9vCIj0GyMFe2hbDU=; b=H29znY8xgz2MNjYPN+MXUQljMO6E6tqN1/EPpiqBvNgZ2KnG/TTT9hoJc3wKylTbA9 cHYdsZhxUi5VLDaE+MQVbcQNHM1X1ZHkLU3U/oI2sIHijXyoCuQdnF00ijKRk+Pekz4D 5Li7rZFWr5DGnC9crs7tEldKCuwgLV0GUR6ygg3YK89jMxGGlgCEv4fFwEavVi/puaxA mzkbDwPaOHEeOklidBJAsDZPqWpG2HqXhGVoZ/+PkZYBPlk1pDqdUN6Wo3zIt9xMTKIY YVd6Knst2gVkOUhGrUCEl5T8az4cTylkVeENpZsDrMdF53AoYo3Cst4+ZvUr623RNT3e IRmw== 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=keaazHnGYse1nig0TAXoTOmdpGU9vCIj0GyMFe2hbDU=; b=G2Dhf2MaWKRrtElBSKzZlaL98i3wHQT/kLJQx4cMhwSlWkJO9fIU5bZV34n5i6qrOy h+dwyQeBUXDeQpwshdhClV31hqB9m6OwmphL4cefsdmgVgwtUURh6Miyq33So36hSDW8 xTNACmk9cdZjGemzZgc+YOPKPnRGDsVagD72/4Kj22GQ/PD6ELAuU458LjuQxEHEVZZE 9hq2wCJqFrw5gwSraRe4lLdCzfqJWpb57ZOxHRmQbEaqoBLHF7IRLSwYWR+RBN9knUaa g0c+r3XP+MO+GaeKoGuh2Xd2Mg8/VwyEFd9lzx+mSjkSwQXlKDijTT0odCwAuI06AdhH S2Eg== X-Gm-Message-State: APf1xPDlTRbVs+KlCp5vfOYLqf4Br0BBWCy4GooM7PGOL14xtbbOez7H sBEQSoUEQjN3+knOwYyjtV4MTQ== X-Google-Smtp-Source: AH8x227L0z7akIkiPfttFpP3MaNZt4BpeMhhKOca0/oYzWO3ywKL1YRlY/5P3H1mrslqwLpSFjFnjg== X-Received: by 10.80.135.230 with SMTP id 35mr24444823edz.1.1519833000742; Wed, 28 Feb 2018 07:50:00 -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.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Feb 2018 07:50:00 -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/15] lightnvn: pblk: use generic address format Date: Wed, 28 Feb 2018 16:49:32 +0100 Message-Id: <1519832975-25432-13-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 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 7d0bd33f11d9..2e10b18b61e3 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)); @@ -1686,8 +1686,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)); @@ -1731,8 +1731,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 cbb5b6edb7bf..a643dc623731 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 dd0089fe62b9..6ac64d9eb57e 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,