diff options
Diffstat (limited to 'fs/block_dev.c')
| -rw-r--r-- | fs/block_dev.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 4346468139e8..0c361ea7e5a6 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
| @@ -17,11 +17,13 @@ | |||
| 17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
| 18 | #include <linux/blkpg.h> | 18 | #include <linux/blkpg.h> |
| 19 | #include <linux/buffer_head.h> | 19 | #include <linux/buffer_head.h> |
| 20 | #include <linux/writeback.h> | ||
| 20 | #include <linux/mpage.h> | 21 | #include <linux/mpage.h> |
| 21 | #include <linux/mount.h> | 22 | #include <linux/mount.h> |
| 22 | #include <linux/uio.h> | 23 | #include <linux/uio.h> |
| 23 | #include <linux/namei.h> | 24 | #include <linux/namei.h> |
| 24 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
| 26 | #include "internal.h" | ||
| 25 | 27 | ||
| 26 | struct bdev_inode { | 28 | struct bdev_inode { |
| 27 | struct block_device bdev; | 29 | struct block_device bdev; |
| @@ -1313,3 +1315,24 @@ void close_bdev_excl(struct block_device *bdev) | |||
| 1313 | } | 1315 | } |
| 1314 | 1316 | ||
| 1315 | EXPORT_SYMBOL(close_bdev_excl); | 1317 | EXPORT_SYMBOL(close_bdev_excl); |
| 1318 | |||
| 1319 | int __invalidate_device(struct block_device *bdev) | ||
| 1320 | { | ||
| 1321 | struct super_block *sb = get_super(bdev); | ||
| 1322 | int res = 0; | ||
| 1323 | |||
| 1324 | if (sb) { | ||
| 1325 | /* | ||
| 1326 | * no need to lock the super, get_super holds the | ||
| 1327 | * read mutex so the filesystem cannot go away | ||
| 1328 | * under us (->put_super runs with the write lock | ||
| 1329 | * hold). | ||
| 1330 | */ | ||
| 1331 | shrink_dcache_sb(sb); | ||
| 1332 | res = invalidate_inodes(sb); | ||
| 1333 | drop_super(sb); | ||
| 1334 | } | ||
| 1335 | invalidate_bdev(bdev, 0); | ||
| 1336 | return res; | ||
| 1337 | } | ||
| 1338 | EXPORT_SYMBOL(__invalidate_device); | ||
