Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287761
b: refs/heads/master
c: 6b6dc83
h: refs/heads/master
i:
  287759: 76d44c9
v: v3
  • Loading branch information
Jan Kara authored and Al Viro committed Feb 14, 2012
1 parent 34046fd commit d30e1b4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 074b85175a43a23fdbde60f55feea636e0bf0f85
refs/heads/master: 6b6dc836a195e077e76977b6c020a73de411b46d
22 changes: 22 additions & 0 deletions trunk/fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,28 @@ struct super_block *get_super(struct block_device *bdev)

EXPORT_SYMBOL(get_super);

/**
* get_super_thawed - get thawed superblock of a device
* @bdev: device to get the superblock for
*
* Scans the superblock list and finds the superblock of the file system
* mounted on the device. The superblock is returned once it is thawed
* (or immediately if it was not frozen). %NULL is returned if no match
* is found.
*/
struct super_block *get_super_thawed(struct block_device *bdev)
{
while (1) {
struct super_block *s = get_super(bdev);
if (!s || s->s_frozen == SB_UNFROZEN)
return s;
up_read(&s->s_umount);
vfs_check_frozen(s, SB_FREEZE_WRITE);
put_super(s);
}
}
EXPORT_SYMBOL(get_super_thawed);

/**
* get_active_super - get an active reference to the superblock of a device
* @bdev: device to get the superblock for
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2496,6 +2496,7 @@ extern void get_filesystem(struct file_system_type *fs);
extern void put_filesystem(struct file_system_type *fs);
extern struct file_system_type *get_fs_type(const char *name);
extern struct super_block *get_super(struct block_device *);
extern struct super_block *get_super_thawed(struct block_device *);
extern struct super_block *get_active_super(struct block_device *bdev);
extern void drop_super(struct super_block *sb);
extern void iterate_supers(void (*)(struct super_block *, void *), void *);
Expand Down

0 comments on commit d30e1b4

Please sign in to comment.