aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/brd.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-09-16 02:31:11 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-03 22:54:07 -0500
commitff01bb4832651c6d25ac509a06a10fcbd75c461c (patch)
treebbfdebd317db97d346df78293566f36e883b1be9 /drivers/block/brd.c
parent94ea4158f1733e3b10cef067d535f504866e0c41 (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/brd.c')
-rw-r--r--drivers/block/brd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index d22119d49e53..ec246437f5a4 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -17,7 +17,7 @@
17#include <linux/highmem.h> 17#include <linux/highmem.h>
18#include <linux/mutex.h> 18#include <linux/mutex.h>
19#include <linux/radix-tree.h> 19#include <linux/radix-tree.h>
20#include <linux/buffer_head.h> /* invalidate_bh_lrus() */ 20#include <linux/fs.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22 22
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
@@ -402,14 +402,13 @@ static int brd_ioctl(struct block_device *bdev, fmode_t mode,
402 error = -EBUSY; 402 error = -EBUSY;
403 if (bdev->bd_openers <= 1) { 403 if (bdev->bd_openers <= 1) {
404 /* 404 /*
405 * Invalidate the cache first, so it isn't written 405 * Kill the cache first, so it isn't written back to the
406 * back to the device. 406 * device.
407 * 407 *
408 * Another thread might instantiate more buffercache here, 408 * Another thread might instantiate more buffercache here,
409 * but there is not much we can do to close that race. 409 * but there is not much we can do to close that race.
410 */ 410 */
411 invalidate_bh_lrus(); 411 kill_bdev(bdev);
412 truncate_inode_pages(bdev->bd_inode->i_mapping, 0);
413 brd_free_pages(brd); 412 brd_free_pages(brd);
414 error = 0; 413 error = 0;
415 } 414 }