Abstract away platform specific superblock references

The zfsvfs->z_sb field is Linux specified and should be abstracted.

Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #9697
This commit is contained in:
Matthew Macy
2019-12-10 09:21:07 -08:00
committed by Brian Behlendorf
parent 7bda69a1a9
commit 362ae8d11f
3 changed files with 19 additions and 5 deletions
+12
View File
@@ -65,6 +65,12 @@
#include <linux/miscdevice.h>
#include <linux/slab.h>
boolean_t
zfs_vfs_held(zfsvfs_t *zfsvfs)
{
return (zfsvfs->z_sb != NULL);
}
int
zfs_vfs_ref(zfsvfs_t **zfvp)
{
@@ -75,6 +81,12 @@ zfs_vfs_ref(zfsvfs_t **zfvp)
return (0);
}
void
zfs_vfs_rele(zfsvfs_t *zfsvfs)
{
deactivate_super(zfsvfs->z_sb);
}
static int
zfsdev_state_init(struct file *filp)
{