virtiofsd: Store every lo_inode's parent_dev
commiteba8b096c17c5a74c5a00af4cf476a9b1b4d7393
authorMax Reitz <mreitz@redhat.com>
Wed, 9 Sep 2020 18:40:25 +0000 (9 20:40 +0200)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 26 Oct 2020 18:35:32 +0000 (26 18:35 +0000)
tree92b9a3739608d52486f3652e94f5f7d6df3482a0
parentede24b6be798000bbf554891e5b54a0f4848897f
virtiofsd: Store every lo_inode's parent_dev

We want to detect mount points in the shared tree.  We report them to
the guest by setting the FUSE_ATTR_SUBMOUNT flag in fuse_attr.flags, but
because the FUSE client will create a submount for every directory that
has this flag set, we must do this only for the actual mount points.

We can detect mount points by comparing a directory's st_dev with its
parent's st_dev.  To be able to do so, we need to store the parent's
st_dev in the lo_inode object.

Note that mount points need not necessarily be directories; a single
file can be a mount point as well.  However, for the sake of simplicity
let us ignore any non-directory mount points for now.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200909184028.262297-6-mreitz@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
tools/virtiofsd/passthrough_ll.c