Commit 6a68d1e1 authored by Miklos Szeredi's avatar Miklos Szeredi

fuse: add fuse_sb_destroy() helper

This is to avoid minor code duplication between fuse_kill_sb_anon() and
fuse_kill_sb_blk().
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent bd3bf1e8
...@@ -1541,7 +1541,7 @@ void fuse_conn_destroy(struct fuse_mount *fm) ...@@ -1541,7 +1541,7 @@ void fuse_conn_destroy(struct fuse_mount *fm)
} }
EXPORT_SYMBOL_GPL(fuse_conn_destroy); EXPORT_SYMBOL_GPL(fuse_conn_destroy);
static void fuse_kill_sb_anon(struct super_block *sb) static void fuse_sb_destroy(struct super_block *sb)
{ {
struct fuse_mount *fm = get_fuse_mount_super(sb); struct fuse_mount *fm = get_fuse_mount_super(sb);
bool last; bool last;
...@@ -1551,6 +1551,11 @@ static void fuse_kill_sb_anon(struct super_block *sb) ...@@ -1551,6 +1551,11 @@ static void fuse_kill_sb_anon(struct super_block *sb)
if (last) if (last)
fuse_conn_destroy(fm); fuse_conn_destroy(fm);
} }
}
static void fuse_kill_sb_anon(struct super_block *sb)
{
fuse_sb_destroy(sb);
kill_anon_super(sb); kill_anon_super(sb);
} }
...@@ -1567,14 +1572,7 @@ MODULE_ALIAS_FS("fuse"); ...@@ -1567,14 +1572,7 @@ MODULE_ALIAS_FS("fuse");
#ifdef CONFIG_BLOCK #ifdef CONFIG_BLOCK
static void fuse_kill_sb_blk(struct super_block *sb) static void fuse_kill_sb_blk(struct super_block *sb)
{ {
struct fuse_mount *fm = get_fuse_mount_super(sb); fuse_sb_destroy(sb);
bool last;
if (fm) {
last = fuse_mount_remove(fm);
if (last)
fuse_conn_destroy(fm);
}
kill_block_super(sb); kill_block_super(sb);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment