From patchwork Fri Oct 21 11:55:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 685054 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3t0kfk2Rnkz9t0t for ; Fri, 21 Oct 2016 22:56:30 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755092AbcJULzx (ORCPT ); Fri, 21 Oct 2016 07:55:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:52798 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754833AbcJULzu (ORCPT ); Fri, 21 Oct 2016 07:55:50 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9C00AACBD; Fri, 21 Oct 2016 11:55:47 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id BFC8F1E0820; Fri, 21 Oct 2016 13:55:46 +0200 (CEST) From: Jan Kara To: Jens Axboe Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, Jan Kara Subject: [PATCH 4/4] ext2: Use unmap_underlying_metadata_ext() instead of iteration Date: Fri, 21 Oct 2016 13:55:41 +0200 Message-Id: <1477050941-29682-5-git-send-email-jack@suse.cz> X-Mailer: git-send-email 2.6.6 In-Reply-To: <1477050941-29682-1-git-send-email-jack@suse.cz> References: <1477050941-29682-1-git-send-email-jack@suse.cz> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Use unmap_underlying_metadata_ext() instead of iterating through blocks one by one. Signed-off-by: Jan Kara --- fs/ext2/inode.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index d831e24dc885..335cd1e1f902 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -732,16 +732,13 @@ static int ext2_get_blocks(struct inode *inode, } if (IS_DAX(inode)) { - int i; - /* * We must unmap blocks before zeroing so that writeback cannot * overwrite zeros with stale data from block device page cache. */ - for (i = 0; i < count; i++) { - unmap_underlying_metadata(inode->i_sb->s_bdev, - le32_to_cpu(chain[depth-1].key) + i); - } + unmap_underlying_metadata_ext(inode->i_sb->s_bdev, + le32_to_cpu(chain[depth-1].key), + count); /* * block must be initialised before we put it in the tree * so that it's not found by another thread before it's