aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/buffer.c32
-rw-r--r--include/linux/buffer_head.h1
2 files changed, 0 insertions, 33 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 912d70169fca..1104ce8b4536 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1605,38 +1605,6 @@ void create_empty_buffers(struct page *page,
1605} 1605}
1606EXPORT_SYMBOL(create_empty_buffers); 1606EXPORT_SYMBOL(create_empty_buffers);
1607 1607
1608/*
1609 * We are taking a block for data and we don't want any output from any
1610 * buffer-cache aliases starting from return from that function and
1611 * until the moment when something will explicitly mark the buffer
1612 * dirty (hopefully that will not happen until we will free that block ;-)
1613 * We don't even need to mark it not-uptodate - nobody can expect
1614 * anything from a newly allocated buffer anyway. We used to used
1615 * unmap_buffer() for such invalidation, but that was wrong. We definitely
1616 * don't want to mark the alias unmapped, for example - it would confuse
1617 * anyone who might pick it with bread() afterwards...
1618 *
1619 * Also.. Note that bforget() doesn't lock the buffer. So there can
1620 * be writeout I/O going on against recently-freed buffers. We don't
1621 * wait on that I/O in bforget() - it's more efficient to wait on the I/O
1622 * only if we really need to. That happens here.
1623 */
1624void unmap_underlying_metadata(struct block_device *bdev, sector_t block)
1625{
1626 struct buffer_head *old_bh;
1627
1628 might_sleep();
1629
1630 old_bh = __find_get_block_slow(bdev, block);
1631 if (old_bh) {
1632 clear_buffer_dirty(old_bh);
1633 wait_on_buffer(old_bh);
1634 clear_buffer_req(old_bh);
1635 __brelse(old_bh);
1636 }
1637}
1638EXPORT_SYMBOL(unmap_underlying_metadata);
1639
1640/** 1608/**
1641 * clean_bdev_aliases: clean a range of buffers in block device 1609 * clean_bdev_aliases: clean a range of buffers in block device
1642 * @bdev: Block device to clean buffers in 1610 * @bdev: Block device to clean buffers in
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index d1ab91fc6d43..d67ab83823ad 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -168,7 +168,6 @@ int inode_has_buffers(struct inode *);
168void invalidate_inode_buffers(struct inode *); 168void invalidate_inode_buffers(struct inode *);
169int remove_inode_buffers(struct inode *inode); 169int remove_inode_buffers(struct inode *inode);
170int sync_mapping_buffers(struct address_space *mapping); 170int sync_mapping_buffers(struct address_space *mapping);
171void unmap_underlying_metadata(struct block_device *bdev, sector_t block);
172void clean_bdev_aliases(struct block_device *bdev, sector_t block, 171void clean_bdev_aliases(struct block_device *bdev, sector_t block,
173 sector_t len); 172 sector_t len);
174static inline void clean_bdev_bh_alias(struct buffer_head *bh) 173static inline void clean_bdev_bh_alias(struct buffer_head *bh)