diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2020-11-11 17:22:32 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2020-11-11 17:22:32 +0100 |
commit | 514b5e3ff45e6cfc39cfa7c094727d8e6d885986 (patch) | |
tree | d6f6ae05d63a074f6f5da8f5b79c58ba47bd96a6 /fs/fuse/virtio_fs.c | |
parent | b19d3d00d662cfb8bfdc809ec90344ec58b0bf31 (diff) |
fuse: get rid of fuse_mount refcount
Fuse mount now only ever has a refcount of one (before being freed) so the
count field is unnecessary.
Remove the refcounting and fold fuse_mount_put() into callers. The only
caller of fuse_mount_put() where fm->fc was NULL is fuse_dentry_automount()
and here the fuse_conn_put() can simply be omitted.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/virtio_fs.c')
-rw-r--r-- | fs/fuse/virtio_fs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 14d65db47778..62d89b9c30db 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -1445,15 +1445,18 @@ static int virtio_fs_get_tree(struct fs_context *fsc) fsc->s_fs_info = fm; sb = sget_fc(fsc, virtio_fs_test_super, set_anon_super_fc); - if (fsc->s_fs_info) - fuse_mount_put(fm); + if (fsc->s_fs_info) { + fuse_conn_put(fc); + kfree(fm); + } if (IS_ERR(sb)) return PTR_ERR(sb); if (!sb->s_root) { err = virtio_fs_fill_super(sb, fsc); if (err) { - fuse_mount_put(fm); + fuse_conn_put(fc); + kfree(fm); sb->s_fs_info = NULL; deactivate_locked_super(sb); return err; |