diff options
Diffstat (limited to 'fs/super.c')
-rw-r--r-- | fs/super.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/fs/super.c b/fs/super.c index 6015c02296b7..cf001775617f 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -20,7 +20,7 @@ | |||
20 | * Heavily rewritten for 'one fs - one tree' dcache architecture. AV, Mar 2000 | 20 | * Heavily rewritten for 'one fs - one tree' dcache architecture. AV, Mar 2000 |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/module.h> | 23 | #include <linux/export.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/acct.h> | 25 | #include <linux/acct.h> |
26 | #include <linux/blkdev.h> | 26 | #include <linux/blkdev.h> |
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/backing-dev.h> | 32 | #include <linux/backing-dev.h> |
33 | #include <linux/rculist_bl.h> | 33 | #include <linux/rculist_bl.h> |
34 | #include <linux/cleancache.h> | 34 | #include <linux/cleancache.h> |
35 | #include <linux/fsnotify.h> | ||
35 | #include "internal.h" | 36 | #include "internal.h" |
36 | 37 | ||
37 | 38 | ||
@@ -250,7 +251,7 @@ void deactivate_locked_super(struct super_block *s) | |||
250 | { | 251 | { |
251 | struct file_system_type *fs = s->s_type; | 252 | struct file_system_type *fs = s->s_type; |
252 | if (atomic_dec_and_test(&s->s_active)) { | 253 | if (atomic_dec_and_test(&s->s_active)) { |
253 | cleancache_flush_fs(s); | 254 | cleancache_invalidate_fs(s); |
254 | fs->kill_sb(s); | 255 | fs->kill_sb(s); |
255 | 256 | ||
256 | /* caches are now gone, we can safely kill the shrinker now */ | 257 | /* caches are now gone, we can safely kill the shrinker now */ |
@@ -634,6 +635,28 @@ rescan: | |||
634 | EXPORT_SYMBOL(get_super); | 635 | EXPORT_SYMBOL(get_super); |
635 | 636 | ||
636 | /** | 637 | /** |
638 | * get_super_thawed - get thawed superblock of a device | ||
639 | * @bdev: device to get the superblock for | ||
640 | * | ||
641 | * Scans the superblock list and finds the superblock of the file system | ||
642 | * mounted on the device. The superblock is returned once it is thawed | ||
643 | * (or immediately if it was not frozen). %NULL is returned if no match | ||
644 | * is found. | ||
645 | */ | ||
646 | struct super_block *get_super_thawed(struct block_device *bdev) | ||
647 | { | ||
648 | while (1) { | ||
649 | struct super_block *s = get_super(bdev); | ||
650 | if (!s || s->s_frozen == SB_UNFROZEN) | ||
651 | return s; | ||
652 | up_read(&s->s_umount); | ||
653 | vfs_check_frozen(s, SB_FREEZE_WRITE); | ||
654 | put_super(s); | ||
655 | } | ||
656 | } | ||
657 | EXPORT_SYMBOL(get_super_thawed); | ||
658 | |||
659 | /** | ||
637 | * get_active_super - get an active reference to the superblock of a device | 660 | * get_active_super - get an active reference to the superblock of a device |
638 | * @bdev: device to get the superblock for | 661 | * @bdev: device to get the superblock for |
639 | * | 662 | * |