diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-05-06 07:07:50 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-05-09 16:49:39 +0200 |
commit | 74dbbdd7fdc11763f4698d2f3e684cf4446951e6 (patch) | |
tree | f31d70174915b0d209fafeec35e996e8ed7e269d /include | |
parent | reiserfs: remove privroot hiding in lookup (diff) | |
download | linux-74dbbdd7fdc11763f4698d2f3e684cf4446951e6.tar.xz linux-74dbbdd7fdc11763f4698d2f3e684cf4446951e6.zip |
New helper: deactivate_locked_super()
Does equivalent of up_write(&s->s_umount); deactivate_super(s);
However, it does not does not unlock it until it's all over.
As the result, it's safe to use to dispose of new superblock on ->get_sb()
failure exits - nobody will see the sucker until it's all over.
Equivalent using up_write/deactivate_super is safe for that purpose
if superblock is either safe to use or has NULL ->s_root when we unlock.
Normally filesystems take the required precautions, but
a) we do have bugs in that area in some of them.
b) up_write/deactivate_super sequence is extremely common,
so the helper makes sense anyway.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 5bed436f4353..11484d08042c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1775,6 +1775,7 @@ void kill_block_super(struct super_block *sb); void kill_anon_super(struct super_block *sb); void kill_litter_super(struct super_block *sb); void deactivate_super(struct super_block *sb); +void deactivate_locked_super(struct super_block *sb); int set_anon_super(struct super_block *s, void *data); struct super_block *sget(struct file_system_type *type, int (*test)(struct super_block *,void *), |