From patchwork Wed Dec 20 17:21:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 10126029 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 08C7260245 for ; Wed, 20 Dec 2017 17:25:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5511283BF for ; Wed, 20 Dec 2017 17:25:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D916628DD1; Wed, 20 Dec 2017 17:25:53 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable 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 5BAD7283BF for ; Wed, 20 Dec 2017 17:25:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755881AbdLTRZM (ORCPT ); Wed, 20 Dec 2017 12:25:12 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:46647 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755998AbdLTRWb (ORCPT ); Wed, 20 Dec 2017 12:22:31 -0500 Received: by mail-wm0-f67.google.com with SMTP id r78so11361414wme.5 for ; Wed, 20 Dec 2017 09:22:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IULpn1I8wDYqq5bdD4IRok8d8ISH1lEO13kVt2DODuM=; b=asLWZjeGTYZI1CjnTaQnzyo+xABlnfQEXyJ3BNkEesNuXu4KyIDFtThkpIbenMug93 +X+FkE8/Lo+vdQVkJn7LdMiMoBAk226gD82p2WfUdopqmPtKfiNaa4Kk8R++0U55NgeB w5k2M654G0H0/EjuNvsYn2PmdsdxH8OEFd1mU= 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=IULpn1I8wDYqq5bdD4IRok8d8ISH1lEO13kVt2DODuM=; b=r4atURajP/8Ews+kTEsdugoqoAHaYmidfvkvJRB9hMzokMFeblDdz2OP5+Beuq15y3 vFpBXgCerRSD3BhEOl+0VbC6hQeL1svZnXLbapyKuVYA0+crZNtCrqTLnjYv/d9n4F4x uAEr+HkMENlekyHxiiD3d53iz6L3HX7gSLebvzfSlMuoSHIAu11clmerS5abvW03ZQKT TMPpViqVu1W3sPH9TquRm0GSS1b6Z8UJWEBqZlmvCrmgtsInp2vPp31MB/pncsX1fjfE KQ10StUrtfmNhDW50GfB+P6GHKkKMrAmUuockpkN3deYhBdf8bAkEaPS4M/LLJqJIqni wIYw== X-Gm-Message-State: AKGB3mK2IhvcT1FWm9PS61fWFhA4faNaPwb72aNM2s7GRuuSCmPuW5Z0 eVsKfkCnzWyKaubXCg4DVd29SjST X-Google-Smtp-Source: ACJfBos2CCkOa0yAlF2Wqsh+x541bEtN7Q2vgKnOXIcs3HOuiaqGDgKghVamYiIeKFolUbKkIMAXMg== X-Received: by 10.80.144.72 with SMTP id z8mr6393996edz.105.1513790549723; Wed, 20 Dec 2017 09:22:29 -0800 (PST) Received: from skyninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id 26sm15339120eds.67.2017.12.20.09.22.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 09:22:29 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Hans Holmberg , =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 16/25] lightnvm: pblk: remove pblk_gc_stop Date: Wed, 20 Dec 2017 18:21:56 +0100 Message-Id: <20171220172205.26464-17-m@bjorling.me> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171220172205.26464-1-m@bjorling.me> References: <20171220172205.26464-1-m@bjorling.me> 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 From: Hans Holmberg pblk_gc_stop just sets pblk->gc->gc_active to zero, ignoring the flush parameter. This is plain confusing, so remove the function and set the gc active flag at the call points instead. Signed-off-by: Hans Holmberg Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-gc.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c index 9e3f22b..8f71898 100644 --- a/drivers/lightnvm/pblk-gc.c +++ b/drivers/lightnvm/pblk-gc.c @@ -526,22 +526,12 @@ void pblk_gc_should_start(struct pblk *pblk) } } -/* - * If flush_wq == 1 then no lock should be held by the caller since - * flush_workqueue can sleep - */ -static void pblk_gc_stop(struct pblk *pblk, int flush_wq) -{ - pblk->gc.gc_active = 0; - pr_debug("pblk: gc stop\n"); -} - void pblk_gc_should_stop(struct pblk *pblk) { struct pblk_gc *gc = &pblk->gc; if (gc->gc_active && !gc->gc_forced) - pblk_gc_stop(pblk, 0); + gc->gc_active = 0; } void pblk_gc_should_kick(struct pblk *pblk) @@ -667,7 +657,7 @@ void pblk_gc_exit(struct pblk *pblk) gc->gc_enabled = 0; del_timer_sync(&gc->gc_timer); - pblk_gc_stop(pblk, 1); + gc->gc_active = 0; if (gc->gc_ts) kthread_stop(gc->gc_ts);