diff options
Diffstat (limited to 'drivers/block/brd.c')
-rw-r--r-- | drivers/block/brd.c | 9 |
1 files changed, 4 insertions, 5 deletions
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 @@ | |||
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 | } |