Received: by 10.223.185.116 with SMTP id b49csp6425571wrg; Wed, 28 Feb 2018 09:11:29 -0800 (PST) X-Google-Smtp-Source: AH8x2261ufxqFlM9dmplP4+J/Jo000RFKQTaY8eSAnYx/lw5lMrViuAjJs7aBYXGM+XlcjVVhbUq X-Received: by 10.98.224.208 with SMTP id d77mr18533687pfm.194.1519837889397; Wed, 28 Feb 2018 09:11:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519837889; cv=none; d=google.com; s=arc-20160816; b=i79nKhr5ddhPpDDMPL/ohksD5tCJ8Zz85ctXLSOWyLoAVcppcy2ZdaHFiu01Gn9JuA t61f4+um+d8wiEgnKHFMnyO7zV4AEXqP470LcvUW8EpfYvJN46B48PYTqddz1hO3JWNV MgHV4h+XPPkxNE8KirChhGTnXt515+vQfqP+fwyD/0RcZw21gKTTzQS6pUJpduDw0DsE Im+FRoNmUSxenFRZlSM4Zm0gn2tzpMv18ZmAXHxis76aRrewdpcBFQM2lfYxNkdlvSl4 i+jy9x++imhkxVPg6srw84efnYGI77i0b0KEygX+yDpOPD/JmWyqGjswcBz6RgFx37Dy E75A== 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=keaazHnGYse1nig0TAXoTOmdpGU9vCIj0GyMFe2hbDU=; b=dt9V3QLWUNOW8FFXs+k1qKB22If/4PXSzPr3lrKKXS2BfLSM2wppdrEhd1cO1MSxju FMFOSQimLnNf+/rVD7l1Zv2Mdx3BKqWN3CmKWcFbGbQ7hdEuqr9epCn7lwuSt1/ftjss nlIheoplfl4/ZgKFCSPuY58HcIC/S5NrpV2TfY8tTreTBH+aayGx84vyh9mDz+vimBEu 3f151sC3zoC1xJROQOXtx9AKtkaLtw9pseAMkMGBxSqsTGdjplDjZ2tiPor6Z5oB35I5 DTFu2xeWtnlaym+yGYrOagCVeIW5ZZbJga/7gI4WGzpaUUAZMuFQyqBtD7Ms/2+YWX+y FT0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=H29znY8x; 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 d13si1207713pgn.366.2018.02.28.09.11.14; Wed, 28 Feb 2018 09:11:29 -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=H29znY8x; 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 S932860AbeB1RJp (ORCPT + 99 others); Wed, 28 Feb 2018 12:09:45 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:50479 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933628AbeB1PuC (ORCPT ); Wed, 28 Feb 2018 10:50:02 -0500 Received: by mail-wm0-f65.google.com with SMTP id w128so5962806wmw.0 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=QJSdr6F36PX/dwih8HiU4ctB3XO0myaeSP+E/dAQLq4blvZYpKmh2bLK0kb7u9VTBT B/K3Pp4ZU/3/EQh41nmjVbzzETFPlrJ9AOQGCcWami89tM9lRpB2YREGqm6gmuwFlk3v Kjl9AfxGhU4jtHOs75unC6OWQDEjTLE6NB/YYXfS+PFZSoIljVJSYTuyw9sID7SLP0Bn 1ewEfCRLbdfduj3P8Ls191Goy7I9+EytVoVk2up18o30hL1Jg8VtTbLu4MPxi46YmKN+ LCMDDtYnyYwBA46QcemseXSZEt9qnXWdKtx6f55vMZujZRhLYJ/M0nCx42pkLNWosfmQ d40w== X-Gm-Message-State: APf1xPBcwt5XRhlVqCZk01P1yYn6yQIjgIfv+UmldZqcj+DvcByraTHl 8bMFZGvk/MURvbZSMvKQh4OWaA== 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 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 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, -- 2.7.4