Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751797AbdFIUat (ORCPT ); Fri, 9 Jun 2017 16:30:49 -0400 Received: from mga04.intel.com ([192.55.52.120]:51927 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751778AbdFIUar (ORCPT ); Fri, 9 Jun 2017 16:30:47 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,319,1493708400"; d="scan'208";a="866374121" Subject: [PATCH v3 06/14] filesystem-dax: convert to dax_flush() From: Dan Williams To: linux-nvdimm@lists.01.org Cc: Jan Kara , dm-devel@redhat.com, Matthew Wilcox , x86@kernel.org, linux-kernel@vger.kernel.org, Jeff Moyer , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, Ross Zwisler , hch@lst.de Date: Fri, 09 Jun 2017 13:24:18 -0700 Message-ID: <149703985873.20620.14408850278717601623.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <149703982465.20620.14881139332926778446.stgit@dwillia2-desk3.amr.corp.intel.com> References: <149703982465.20620.14881139332926778446.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1272 Lines: 33 Filesystem-DAX flushes caches whenever it writes to the address returned through dax_direct_access() and when writing back dirty radix entries. That flushing is only required in the pmem case, so the dax_flush() helper skips cache management work when the underlying driver does not specify a flush method. We still do all the dirty tracking since the radix entry will already be there for locking purposes. However, the work to clean the entry will be a nop for some dax drivers. Cc: Jan Kara Cc: Jeff Moyer Cc: Christoph Hellwig Cc: Matthew Wilcox Cc: Ross Zwisler Signed-off-by: Dan Williams --- fs/dax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index b459948de427..0933fc460ada 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -784,7 +784,7 @@ static int dax_writeback_one(struct block_device *bdev, } dax_mapping_entry_mkclean(mapping, index, pfn_t_to_pfn(pfn)); - wb_cache_pmem(kaddr, size); + dax_flush(dax_dev, pgoff, kaddr, size); /* * After we have flushed the cache, we can clear the dirty tag. There * cannot be new dirty data in the pfn after the flush has completed as