From patchwork Wed Jan 9 05:31:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10753419 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4482614E5 for ; Wed, 9 Jan 2019 05:32:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F9A028DCE for ; Wed, 9 Jan 2019 05:32:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2098428DF3; Wed, 9 Jan 2019 05:32:21 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2535028DEF for ; Wed, 9 Jan 2019 05:32:20 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1C8A9211B5073; Tue, 8 Jan 2019 21:32:20 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=135.84.80.237; helo=sender-pp-092.zoho.com; envelope-from=yehs2007@zoho.com; receiver=linux-nvdimm@lists.01.org Received: from sender-pp-092.zoho.com (sender-pp-092.zoho.com [135.84.80.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7E345211B506D for ; Tue, 8 Jan 2019 21:32:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547011910; cv=none; d=zoho.com; s=zohoarc; b=D1bvQiE33wdc6DwxL+NxjEVKGDOIBmX+a67WChzSQfmO1uq4Jb1ELnkt0yDVO/wxW8svMSyIX9Au81xUJTPRC9rNc2v481HmwNFyR9/3eM65kDlgUmpvGU7gDP1MSobyNr3Kls48+mfRAKLW08jKsFDqQBcLzTxW7YVPAr34aOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1547011910; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=le5j2hLw5GH/PW3GIzsYH2jGxnhrLnZ93bpxcuJQ8Vk=; b=d+nujjZsNMbmscIeW4HtLKTRhnoKRdmLu7um1gv1P4q9TOtaRMo7VoBolhiCXp+R+++TlrdMrMzrZHa5VBCQXc27BHQgk69DxE68Huq6lWtbTNmq951dYFgD/T1wSNi1HYlovIRfhznRONhfSQxilkA1aOy9dPwt8tbcfZJEMgs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=yehs2007@zoho.com; dmarc=pass header.from= header.from= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:subject:date:message-id:in-reply-to:references; b=LhS5yzC5u2acAzldvuV+A7CeZiHE2dHqLVxe7bR4IGwd5nYm50Va49pVrSP99RhYSZwMvBHGeA1w 0oX53NaX71SPutTKNz4Nbwei4kjGQNMqVgF3tfjsclAV+7c+V7qW DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1547011910; s=default; d=zoho.com; i=yehs2007@zoho.com; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=897; bh=le5j2hLw5GH/PW3GIzsYH2jGxnhrLnZ93bpxcuJQ8Vk=; b=YZS1IfqEQkbCTAsk+rx98Uw+CswngQBkGYFjbuPl9MQtB/QTdH6FH8DJS/45cBIP p+g3iTJinGqVtpOXY+9kQeA/QX60aefBU+mzs0rOd75OSIB+hjbEAhS0QjBXlVexBBv bNKg8G3b3KGa69LrWwG9oZRNW1vC3zI44WeIPikQ= Received: from YEHS1XR956R00D1.lenovo.com (123.120.89.99 [123.120.89.99]) by mx.zohomail.com with SMTPS id 154701190890385.06785696697204; Tue, 8 Jan 2019 21:31:48 -0800 (PST) From: Huaisheng Ye To: snitzer@redhat.com, agk@redhat.com Subject: [RFC PATCH v2 2/4] dm-writecache: get rid of memory_data flush to writecache_flush_entry Date: Wed, 9 Jan 2019 13:31:25 +0800 Message-Id: <20190109053127.8128-3-yehs2007@zoho.com> X-Mailer: git-send-email 2.17.0.windows.1 In-Reply-To: <20190109053127.8128-1-yehs2007@zoho.com> References: <20190109053127.8128-1-yehs2007@zoho.com> X-ZohoMailClient: External X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jack@suse.cz, corbet@lwn.net, chengnt@lenovo.com, linux-nvdimm@lists.01.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, hch@lst.de MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP From: Huaisheng Ye writecache_flush_region only works when SSD mode. If wc->pmem_mode sets, writecache_flush_region doesn't need to be called in writecache_flush_entry. Signed-off-by: Huaisheng Ye --- drivers/md/dm-writecache.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 2d8e0c0..c69317c 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -688,8 +688,6 @@ static void writecache_poison_lists(struct dm_writecache *wc) static void writecache_flush_entry(struct dm_writecache *wc, struct wc_entry *e) { writecache_flush_region(wc, memory_entry(wc, e)); - if (WC_MODE_PMEM(wc)) - writecache_flush_region(wc, memory_data(wc, e)); } static bool writecache_entry_is_committed(struct dm_writecache *wc, struct wc_entry *e)