From b19d3d00d662cfb8bfdc809ec90344ec58b0bf31 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 11 Nov 2020 17:22:31 +0100 Subject: virtiofs: simplify sb setup Currently when acquiring an sb for virtiofs fuse_mount_get() is being called from virtio_fs_set_super() if a new sb is being filled and fuse_mount_put() is called unconditionally after sget_fc() returns. The exact same result can be obtained by checking whether fs_contex->s_fs_info was set to NULL (ref trasferred to sb->s_fs_info) and only calling fuse_mount_put() if the ref wasn't transferred (error or matching sb found). This allows getting rid of virtio_fs_set_super() and fuse_mount_get(). Signed-off-by: Miklos Szeredi --- fs/fuse/inode.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'fs/fuse/inode.c') diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 1a47afc95f80..654708574d5e 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -742,13 +742,6 @@ void fuse_mount_put(struct fuse_mount *fm) } EXPORT_SYMBOL_GPL(fuse_mount_put); -struct fuse_mount *fuse_mount_get(struct fuse_mount *fm) -{ - refcount_inc(&fm->count); - return fm; -} -EXPORT_SYMBOL_GPL(fuse_mount_get); - static struct inode *fuse_get_root_inode(struct super_block *sb, unsigned mode) { struct fuse_attr attr; -- cgit v1.2.3