Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3890720imu; Mon, 10 Dec 2018 09:23:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/WEMupyuDfTnuRbXleMczBCNu9x75GLnwAgIroNufo9aj5DG4mS5p1huYUPyvU9TTp080d2 X-Received: by 2002:aa7:8045:: with SMTP id y5mr13044283pfm.62.1544462608345; Mon, 10 Dec 2018 09:23:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544462608; cv=none; d=google.com; s=arc-20160816; b=J9zF+BzNhmR9aKMt0B2GWcZ3h0iN7IeezsqIiATXHHbMmjpeXDbUxkEFreZDSjlNCe qkNC1SNg7n5t+KBLAYGdbpbTmiEspbR9aSI1fwgtuaEoIc69jaUhem/VuF2jOXZdwdW7 5mHmSERyOxc9xzIbjVXmiWrC7qOGBWHxCEGHCX0UkyL9fBba/oesc7rSq92DFnNV9IvQ Nv3WvDLPdRfbezUKwgf5Nf91J7zDKb8Vdx8WoE84AswdLfe0ofolasrO4BsIQjICTkg5 y0SeA7OCCL+wbU1i4QxZ3CBtjL7MSoxRIKbRfYk4l2CD4o0zvYvvixW5TilCmYcOMm0X /z+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=XuQa8wn0hLZUtniZFcB7SCItuWNkDds69afAna+Lwj0=; b=invD5wGFAsRlb+RUnATOByTD0qyhmYa2R+xZPUnAI0uO4mkEI16kR2pOw0mHrtN5lw nrr5dBwuyIVCQIITOa6SYU/H2yRLD4ulfJ8/y2YGmBAsNrLdiwL+PU17YMfs7Z/jv8pf DHHs4N2hC7o5rjIvcRdJu6G6hLPN1m699eOv38zcRfX99USlAFDF5caMtOfh+iCzRU9K 02IFEaF7g8Z5AaiVk9ieJphCS/6QRrtnAD0zVufy00G2ZyQ8jfXanaveccKdX/H//1PL u8vjIxzbE/IgGlezyZC8J3tavxynMNS5tlQA/dIdcfQZ1vmhUqx2TUWEKBj/wdF5GxJM UFSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j65si9778551pge.444.2018.12.10.09.23.13; Mon, 10 Dec 2018 09:23:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728350AbeLJRNe (ORCPT + 99 others); Mon, 10 Dec 2018 12:13:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45074 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728322AbeLJRNd (ORCPT ); Mon, 10 Dec 2018 12:13:33 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A1762D7F8; Mon, 10 Dec 2018 17:13:33 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.234]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D53A105B1E1; Mon, 10 Dec 2018 17:13:30 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 07D912239C4; Mon, 10 Dec 2018 12:13:30 -0500 (EST) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: vgoyal@redhat.com, miklos@szeredi.hu, stefanha@redhat.com, dgilbert@redhat.com, sweil@redhat.com, swhiteho@redhat.com Subject: [PATCH 01/52] fuse: add skeleton virtio_fs.ko module Date: Mon, 10 Dec 2018 12:12:27 -0500 Message-Id: <20181210171318.16998-2-vgoyal@redhat.com> In-Reply-To: <20181210171318.16998-1-vgoyal@redhat.com> References: <20181210171318.16998-1-vgoyal@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 10 Dec 2018 17:13:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Hajnoczi Add a basic file system module for virtio-fs. Signed-off-by: Stefan Hajnoczi --- fs/fuse/Kconfig | 10 ++++++++++ fs/fuse/Makefile | 1 + fs/fuse/virtio_fs.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 fs/fuse/virtio_fs.c diff --git a/fs/fuse/Kconfig b/fs/fuse/Kconfig index 76f09ce7e5b2..0b1375126420 100644 --- a/fs/fuse/Kconfig +++ b/fs/fuse/Kconfig @@ -26,3 +26,13 @@ config CUSE If you want to develop or use a userspace character device based on CUSE, answer Y or M. + +config VIRTIO_FS + tristate "Virtio Filesystem" + depends on FUSE_FS + help + The Virtio Filesystem allows guests to mount file systems from the + host. + + If you want to share files between guests or with the host, answer Y + or M. diff --git a/fs/fuse/Makefile b/fs/fuse/Makefile index f7b807bc1027..47b78fac5809 100644 --- a/fs/fuse/Makefile +++ b/fs/fuse/Makefile @@ -4,5 +4,6 @@ obj-$(CONFIG_FUSE_FS) += fuse.o obj-$(CONFIG_CUSE) += cuse.o +obj-$(CONFIG_VIRTIO_FS) += virtio_fs.o fuse-objs := dev.o dir.o file.o inode.o control.o xattr.o acl.o readdir.o diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c new file mode 100644 index 000000000000..6b7d3973bd85 --- /dev/null +++ b/fs/fuse/virtio_fs.c @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * virtio-fs: Virtio Filesystem + * Copyright (C) 2018 Red Hat, Inc. + */ + +#include +#include + +MODULE_AUTHOR("Stefan Hajnoczi "); +MODULE_DESCRIPTION("Virtio Filesystem"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS_FS(KBUILD_MODNAME); + +static struct file_system_type virtio_fs_type = { + .owner = THIS_MODULE, + .name = KBUILD_MODNAME, + .mount = NULL, + .kill_sb = NULL, +}; + +static int __init virtio_fs_init(void) +{ + return register_filesystem(&virtio_fs_type); +} + +static void __exit virtio_fs_exit(void) +{ + unregister_filesystem(&virtio_fs_type); +} + +module_init(virtio_fs_init); +module_exit(virtio_fs_exit); -- 2.13.6