fs: Add helper to clean bdev aliases under a bh and use it
[sfrench/cifs-2.6.git] / fs / buffer.c
index f8beca55240a2ef048a4a6c4021082588ded3079..912d70169fca0f0b3621b055b5986e0b58fd682f 100644 (file)
@@ -1821,8 +1821,7 @@ int __block_write_full_page(struct inode *inode, struct page *page,
                        if (buffer_new(bh)) {
                                /* blockdev mappings never come here */
                                clear_buffer_new(bh);
-                               unmap_underlying_metadata(bh->b_bdev,
-                                                       bh->b_blocknr);
+                               clean_bdev_bh_alias(bh);
                        }
                }
                bh = bh->b_this_page;
@@ -2068,8 +2067,7 @@ int __block_write_begin_int(struct page *page, loff_t pos, unsigned len,
                        }
 
                        if (buffer_new(bh)) {
-                               unmap_underlying_metadata(bh->b_bdev,
-                                                       bh->b_blocknr);
+                               clean_bdev_bh_alias(bh);
                                if (PageUptodate(page)) {
                                        clear_buffer_new(bh);
                                        set_buffer_uptodate(bh);
@@ -2709,7 +2707,7 @@ int nobh_write_begin(struct address_space *mapping,
                if (!buffer_mapped(bh))
                        is_mapped_to_disk = 0;
                if (buffer_new(bh))
-                       unmap_underlying_metadata(bh->b_bdev, bh->b_blocknr);
+                       clean_bdev_bh_alias(bh);
                if (PageUptodate(page)) {
                        set_buffer_uptodate(bh);
                        continue;