diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-09-16 02:31:11 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-03 22:54:07 -0500 |
commit | ff01bb4832651c6d25ac509a06a10fcbd75c461c (patch) | |
tree | bbfdebd317db97d346df78293566f36e883b1be9 /drivers/block | |
parent | 94ea4158f1733e3b10cef067d535f504866e0c41 (diff) |
fs: move code out of buffer.c
Move invalidate_bdev, block_sync_page into fs/block_dev.c. Export
kill_bdev as well, so brd doesn't have to open code it. Reduce
buffer_head.h requirement accordingly.
Removed a rather large comment from invalidate_bdev, as it looked a bit
obsolete to bother moving. The small comment replacing it says enough.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/amiflop.c | 2 | ||||
-rw-r--r-- | drivers/block/brd.c | 9 | ||||
-rw-r--r-- | drivers/block/floppy.c | 1 | ||||
-rw-r--r-- | drivers/block/loop.c | 1 |
4 files changed, 5 insertions, 8 deletions
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c index 8eba86bba59..386146d792d 100644 --- a/drivers/block/amiflop.c +++ b/drivers/block/amiflop.c @@ -63,7 +63,7 @@ #include <linux/mutex.h> #include <linux/amifdreg.h> #include <linux/amifd.h> -#include <linux/buffer_head.h> +#include <linux/fs.h> #include <linux/blkdev.h> #include <linux/elevator.h> #include <linux/interrupt.h> diff --git a/drivers/block/brd.c b/drivers/block/brd.c index d22119d49e5..ec246437f5a 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -17,7 +17,7 @@ #include <linux/highmem.h> #include <linux/mutex.h> #include <linux/radix-tree.h> -#include <linux/buffer_head.h> /* invalidate_bh_lrus() */ +#include <linux/fs.h> #include <linux/slab.h> #include <asm/uaccess.h> @@ -402,14 +402,13 @@ static int brd_ioctl(struct block_device *bdev, fmode_t mode, error = -EBUSY; if (bdev->bd_openers <= 1) { /* - * Invalidate the cache first, so it isn't written - * back to the device. + * Kill the cache first, so it isn't written back to the + * device. * * Another thread might instantiate more buffercache here, * but there is not much we can do to close that race. */ - invalidate_bh_lrus(); - truncate_inode_pages(bdev->bd_inode->i_mapping, 0); + kill_bdev(bdev); brd_free_pages(brd); error = 0; } diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 9955a53733b..510fb10ec45 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -188,7 +188,6 @@ static int print_unex = 1; #include <linux/init.h> #include <linux/platform_device.h> #include <linux/mod_devicetable.h> -#include <linux/buffer_head.h> /* for invalidate_buffers() */ #include <linux/mutex.h> #include <linux/io.h> #include <linux/uaccess.h> diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 1e888c9e85b..f00257782fc 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -69,7 +69,6 @@ #include <linux/freezer.h> #include <linux/mutex.h> #include <linux/writeback.h> -#include <linux/buffer_head.h> /* for invalidate_bdev() */ #include <linux/completion.h> #include <linux/highmem.h> #include <linux/kthread.h> |