ext2: Use clean_bdev_aliases() instead of iteration
authorJan Kara <jack@suse.cz>
Fri, 4 Nov 2016 17:08:14 +0000 (18:08 +0100)
committerJens Axboe <axboe@fb.com>
Fri, 4 Nov 2016 20:34:47 +0000 (14:34 -0600)
Use clean_bdev_aliases() instead of iterating through blocks one by one.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
fs/ext2/inode.c

index d831e24dc88534844aa03a98ba2963f9d3e4b3d0..eb11f7e2b8aaab10b34c09f259f6b58e610f1397 100644 (file)
@@ -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);
-               }
+               clean_bdev_aliases(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