From patchwork Wed Mar 30 14:28:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenwei Tao X-Patchwork-Id: 8697231 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CA2CC9FC5B for ; Wed, 30 Mar 2016 14:29:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1C9420361 for ; Wed, 30 Mar 2016 14:29:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A99120383 for ; Wed, 30 Mar 2016 14:29:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752128AbcC3O3S (ORCPT ); Wed, 30 Mar 2016 10:29:18 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34634 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751217AbcC3O3R (ORCPT ); Wed, 30 Mar 2016 10:29:17 -0400 Received: by mail-pf0-f193.google.com with SMTP id n5so7467163pfn.1; Wed, 30 Mar 2016 07:29:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=IyaJ1pBkHlfH0k9+ScbfNIhEG+ax+PiebSe/bFsJBxA=; b=DvAICRJk50n/49pgkZlEpkw2LF0XvZElKA3E0uKZf38rc/XeckqAWUbAMUnmxtgtST 3lnpvl71qSJC3oJ2xJojlRhjO7gK8qnOoLLvPnQuzgN0t3R+B/bQfpu5pcbjweDQlyuM l6y21pqSHVN2BmZT6UwwNlTBpUnyyFtb4CkI8FR+U1cORLn4Yzlg+EjIwSasXVRc/Ihm Ku/SnzWs0zBPbjneWIvrXnipFyuZFrTMCmko5JpZ2yMpFRiPWWhTYbs0tZWjj6aAd7Dc robnwdrS4KFXtJ8lBI9i3hf4awGkQUDHN7jCcF7vAS53ceYJDaoiiIZn7IjYZk4j7vGz u2jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IyaJ1pBkHlfH0k9+ScbfNIhEG+ax+PiebSe/bFsJBxA=; b=NiV4TJ0Z1nxby7Fk6eYOunfS/63pKj0IFRNtHjJ4NNrvc8FnQwyzsSLqcz8h1cQkb8 FN9PDFpB1CLba7//QtmZTpFS7CDOJwWO4S0jGSB/B0psjSXm3w2nvD1hOjZWgR+175Oa OqGntcrQEPRVNcjFotsS3tgI56eJYB2wkgq9dI4NczwlLdvQc3+hbCjQLshlAKgOa3fF Rdv/EDpzZLMDPiZzEilXslRFBNjfMooHVFp0NKkvhOeXBAFMrI+uk29WeSB5APpeS/Dt 2ktFn+eF0uL6KlQhoKCHxXiyBk/HMho22W1gl4Sr7toivhxiXsDyk06C1NkQb1JtPCBR nYRQ== X-Gm-Message-State: AD7BkJKnB1Ol0wcEL8Ut2Ir8NfGHdEeJeEIcG/VSej+aIUOl3pmvv1vzFveYUJoQ09itRQ== X-Received: by 10.98.9.219 with SMTP id 88mr13944762pfj.0.1459348156632; Wed, 30 Mar 2016 07:29:16 -0700 (PDT) Received: from localhost.localdomain ([114.250.87.194]) by smtp.gmail.com with ESMTPSA id k65sm6507975pfb.30.2016.03.30.07.29.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Mar 2016 07:29:16 -0700 (PDT) From: Wenwei Tao To: mb@lightnvm.io Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Subject: [PATCH 1/2] lightnvm: use rrpc->nr_luns to calculate the rrpc area size Date: Wed, 30 Mar 2016 22:28:34 +0800 Message-Id: <1459348115-6072-1-git-send-email-ww.tao0320@gmail.com> X-Mailer: git-send-email 2.7.0.windows.2 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP rrpc->nr_sects is calculated after rrpc init luns succeeds, before that the value of rrpc->nr_sects is zero, so we cannot use it to calcuate rrpc area size, we use rrpc->nr_luns instead. Signed-off-by: Wenwei Tao --- drivers/lightnvm/rrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index 3ab6495..516a045 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -1223,7 +1223,7 @@ static int rrpc_area_init(struct rrpc *rrpc, sector_t *begin) { struct nvm_dev *dev = rrpc->dev; struct nvmm_type *mt = dev->mt; - sector_t size = rrpc->nr_sects * dev->sec_size; + sector_t size = dev->sec_size * dev->sec_per_lun * rrpc->nr_luns; size >>= 9;