summaryrefslogtreecommitdiff
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2020-11-11 19:22:32 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2020-11-11 19:22:32 +0300
commit6a68d1e1514d77d05898780aea4e5ac587616e93 (patch)
tree5a2331ce6c606ac060982500c79ff5303d2d9aa9 /fs/fuse
parentbd3bf1e85bac1bd956365a0036a6817c3ffe20fb (diff)
downloadlinux-6a68d1e1514d77d05898780aea4e5ac587616e93.tar.xz
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: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/inode.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index dd45dec4dc39..e7e9005b9b66 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1541,7 +1541,7 @@ void fuse_conn_destroy(struct fuse_mount *fm)
}
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);
bool last;
@@ -1551,6 +1551,11 @@ static void fuse_kill_sb_anon(struct super_block *sb)
if (last)
fuse_conn_destroy(fm);
}
+}
+
+static void fuse_kill_sb_anon(struct super_block *sb)
+{
+ fuse_sb_destroy(sb);
kill_anon_super(sb);
}
@@ -1567,14 +1572,7 @@ MODULE_ALIAS_FS("fuse");
#ifdef CONFIG_BLOCK
static void fuse_kill_sb_blk(struct super_block *sb)
{
- struct fuse_mount *fm = get_fuse_mount_super(sb);
- bool last;
-
- if (fm) {
- last = fuse_mount_remove(fm);
- if (last)
- fuse_conn_destroy(fm);
- }
+ fuse_sb_destroy(sb);
kill_block_super(sb);
}