Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2663268pxb; Tue, 9 Mar 2021 08:00:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNPesJ5LmsBO6mZu+L+/smYlkjZZ6hbWWpNQZbmVABVlOPekodv2CqjhrijdTIcMP0PPSm X-Received: by 2002:a17:906:3b47:: with SMTP id h7mr20754544ejf.377.1615305629119; Tue, 09 Mar 2021 08:00:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615305629; cv=none; d=google.com; s=arc-20160816; b=bMuNOigx69xU5hZb05moPv5g54hZ9akQy7HqoZQ8j11ITkiOHWxRUdwoorMi1pd63w Ds1JxzfvADMGIP57y3i3mYhHYMx240j5URU7BNiNjm60eIK1HnpcD1vh4A/KwpHX808s 9m+8jYZmRZ1MZlmQgQeHfUeGd6ARwOzvR29wwLoZ8xP1+Jir2h/gNsgi8iKoZ9MTtbfd ZVag3PgBBzRxI9p8nZhYU1RAU34nKabTdHx9Mhgy8ndFPObN1Z5xVSjCvFS4IXX2LgMw otiqGP83f2Iacb2ygWJmtOKdWvCkxd/L9s27G/TVgIIbOMr7xYLy+krX82eEe8cJgOYi h1ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YCa5USJ2jm70Z2UsFo8WsaOurKZNnFvLpmzM+RUjH7Q=; b=YJtjCvOavrvaNvBKG9pW0Dve3sJdLyTWiKpW9pDR2Tld2RCTaoTMiD7DU1helSOpM/ VEpb0QJtKVW6pL894Kg39UBgn+wgBcGcJiU9jPYdhnTzB7Af4UL99VfBSaswQbXLgfjh KdbAyXshCk5DptJlJUS/h3yimHmMEd2mifFTPnp1VDLZRsGb0XgSy2/lK8Wls7IOUl3u CWS6SHd8BJsWzjpYACnhiDQNpXxrwKHKnuGk3zbw7XFMKAeIF+H/V/KGetkumpJmEZks tkGuHNvi5g4xijQwy2BSRtV8pu4h/HXhvLE6NNtE5KCI0+KiWIMHtfKJ2pk9zCnNorSN wjzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=tOG8dHR4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu13si9030189edb.498.2021.03.09.08.00.05; Tue, 09 Mar 2021 08:00:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=tOG8dHR4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232014AbhCIP4Y (ORCPT + 99 others); Tue, 9 Mar 2021 10:56:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbhCIP4M (ORCPT ); Tue, 9 Mar 2021 10:56:12 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F971C06174A; Tue, 9 Mar 2021 07:56:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=YCa5USJ2jm70Z2UsFo8WsaOurKZNnFvLpmzM+RUjH7Q=; b=tOG8dHR47ixjkPXc3KpuPHwBJN 9VFDsIBs0iNabrNwVXnkHpEUdRE0Xw1VihxeUy1+Fk4KYBtVgcEksHwzR18mV15ZWijtKj5WiAj/5 7KOcX17CSbvl+aU8mkaAl7PIwJV8dwwIDpxTeRudfOZASKqLd2oSxE8ndV2Mhje3p8opZFyB+5AY6 3WCbnTsjVJ3yqS6hJgSLnrgXWlagzm2/jm1eIMY/fHzgbKF2asFhyKisFuX10Qwx8gBqZ5of7CTH3 ZHAvbig1z/NdDSn0Hj3VaXLltwy6s7eRmlDs/uoLyCyDcM4moI+4Km8Zi3CtzTIP32H3qV1JoiGlq YC8O2rHA==; Received: from [2001:4bb8:180:9884:c70:4a89:bc61:3] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lJehF-000lP8-0R; Tue, 09 Mar 2021 15:55:01 +0000 From: Christoph Hellwig To: Al Viro Cc: Andrew Morton , Daniel Vetter , Nadav Amit , "VMware, Inc." , "Michael S. Tsirkin" , David Hildenbrand , Minchan Kim , Nitin Gupta , Jason Gunthorpe , Alex Williamson , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 6/9] virtio_balloon: remove the balloon-kvm file system Date: Tue, 9 Mar 2021 16:53:45 +0100 Message-Id: <20210309155348.974875-7-hch@lst.de> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210309155348.974875-1-hch@lst.de> References: <20210309155348.974875-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- drivers/virtio/virtio_balloon.c | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index cae76ee5bdd688..1efb890cd3ff09 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -6,6 +6,7 @@ * Copyright 2008 Rusty Russell IBM Corporation */ +#include #include #include #include @@ -42,10 +43,6 @@ (1 << (VIRTIO_BALLOON_HINT_BLOCK_ORDER + PAGE_SHIFT)) #define VIRTIO_BALLOON_HINT_BLOCK_PAGES (1 << VIRTIO_BALLOON_HINT_BLOCK_ORDER) -#ifdef CONFIG_BALLOON_COMPACTION -static struct vfsmount *balloon_mnt; -#endif - enum virtio_balloon_vq { VIRTIO_BALLOON_VQ_INFLATE, VIRTIO_BALLOON_VQ_DEFLATE, @@ -805,18 +802,6 @@ static int virtballoon_migratepage(struct balloon_dev_info *vb_dev_info, return MIGRATEPAGE_SUCCESS; } - -static int balloon_init_fs_context(struct fs_context *fc) -{ - return init_pseudo(fc, BALLOON_KVM_MAGIC) ? 0 : -ENOMEM; -} - -static struct file_system_type balloon_fs = { - .name = "balloon-kvm", - .init_fs_context = balloon_init_fs_context, - .kill_sb = kill_anon_super, -}; - #endif /* CONFIG_BALLOON_COMPACTION */ static unsigned long shrink_free_pages(struct virtio_balloon *vb, @@ -909,17 +894,11 @@ static int virtballoon_probe(struct virtio_device *vdev) goto out_free_vb; #ifdef CONFIG_BALLOON_COMPACTION - balloon_mnt = kern_mount(&balloon_fs); - if (IS_ERR(balloon_mnt)) { - err = PTR_ERR(balloon_mnt); - goto out_del_vqs; - } - vb->vb_dev_info.migratepage = virtballoon_migratepage; - vb->vb_dev_info.inode = alloc_anon_inode_sb(balloon_mnt->mnt_sb); + vb->vb_dev_info.inode = alloc_anon_inode(); if (IS_ERR(vb->vb_dev_info.inode)) { err = PTR_ERR(vb->vb_dev_info.inode); - goto out_kern_unmount; + goto out_del_vqs; } vb->vb_dev_info.inode->i_mapping->a_ops = &balloon_aops; #endif @@ -1016,8 +995,6 @@ static int virtballoon_probe(struct virtio_device *vdev) out_iput: #ifdef CONFIG_BALLOON_COMPACTION iput(vb->vb_dev_info.inode); -out_kern_unmount: - kern_unmount(balloon_mnt); out_del_vqs: #endif vdev->config->del_vqs(vdev); @@ -1070,7 +1047,6 @@ static void virtballoon_remove(struct virtio_device *vdev) if (vb->vb_dev_info.inode) iput(vb->vb_dev_info.inode); - kern_unmount(balloon_mnt); #endif kfree(vb); } -- 2.30.1