Thread (7 messages) 7 messages, 2 authors, 2016-10-24
STALE3523d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 4/4] ext2: Use unmap_underlying_metadata_ext() instead of iteration

From: Jan Kara <jack@suse.cz>
Date: 2016-10-21 11:55:50
Also in: linux-fsdevel
Subsystem: ext2 file system, filesystems (vfs and infrastructure), the rest · Maintainers: Jan Kara, Alexander Viro, Christian Brauner, Linus Torvalds

Use unmap_underlying_metadata_ext() instead of iterating through blocks
one by one.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 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
-- 
2.6.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help