fuse: split fuse_mount off of fuse_conn
authorMax Reitz <mreitz@redhat.com>
Wed, 6 May 2020 15:44:12 +0000 (17:44 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 18 Sep 2020 13:17:41 +0000 (15:17 +0200)
commitfcee216beb9c15c3e1466bb76575358415687c55
treef9116c10fcede619f7a8f80a5b62aa052bc192e4
parent8f622e9497bbbd5df4675edf782500cd9fe961ba
fuse: split fuse_mount off of fuse_conn

We want to allow submounts for the same fuse_conn, but with different
superblocks so that each of the submounts has its own device ID.  To do
so, we need to split all mount-specific information off of fuse_conn
into a new fuse_mount structure, so that multiple mounts can share a
single fuse_conn.

We need to take care only to perform connection-level actions once (i.e.
when the fuse_conn and thus the first fuse_mount are established, or
when the last fuse_mount and thus the fuse_conn are destroyed).  For
example, fuse_sb_destroy() must invoke fuse_send_destroy() until the
last superblock is released.

To do so, we keep track of which fuse_mount is the root mount and
perform all fuse_conn-level actions only when this fuse_mount is
involved.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/control.c
fs/fuse/cuse.c
fs/fuse/dax.c
fs/fuse/dev.c
fs/fuse/dir.c
fs/fuse/file.c
fs/fuse/fuse_i.h
fs/fuse/inode.c
fs/fuse/readdir.c
fs/fuse/virtio_fs.c
fs/fuse/xattr.c