#include "zfs_comutil.h"
#ifdef HAVE_ZPL
-extern int sys_shutdown;
-
-/*
- * We need to keep a count of active fs's.
- * This is necessary to prevent our module
- * from being unloaded after a umount -f
- */
-static uint32_t zfs_active_fs_count = 0;
-
-static char *noatime_cancel[] = { MNTOPT_ATIME, NULL };
-static char *atime_cancel[] = { MNTOPT_NOATIME, NULL };
-static char *noxattr_cancel[] = { MNTOPT_XATTR, NULL };
-static char *xattr_cancel[] = { MNTOPT_NOXATTR, NULL };
-
-/*
- * MO_DEFAULT is not used since the default value is determined
- * by the equivalent property.
- */
-static mntopt_t mntopts[] = {
- { MNTOPT_NOXATTR, noxattr_cancel, NULL, 0, NULL },
- { MNTOPT_XATTR, xattr_cancel, NULL, 0, NULL },
- { MNTOPT_NOATIME, noatime_cancel, NULL, 0, NULL },
- { MNTOPT_ATIME, atime_cancel, NULL, 0, NULL }
-};
-
-static mntopts_t zfs_mntopts = {
- sizeof (mntopts) / sizeof (mntopt_t),
- mntopts
-};
/*ARGSUSED*/
int
* Data integrity is job one. We don't want a compromised kernel
* writing to the storage pool, so we never sync during panic.
*/
- if (panicstr)
- return (0);
-
- /*
- * SYNC_ATTR is used by fsflush() to force old filesystems like UFS
- * to sync metadata, which they would otherwise cache indefinitely.
- * Semantically, the only requirement is that the sync be initiated.
- * The DMU syncs out txgs frequently, so there's nothing to do.
- */
- if (flag & SYNC_ATTR)
+ if (unlikely(oops_in_progress))
return (0);
if (vfsp != NULL) {
ZFS_ENTER(zfsvfs);
dp = dmu_objset_pool(zfsvfs->z_os);
+#ifdef HAVE_SHUTDOWN
/*
* If the system is shutting down, then skip any
* filesystems which may exist on a suspended pool.
+ *
+ * XXX: This can be implemented using the Linux reboot
+ * notifiers: {un}register_reboot_notifier().
*/
if (sys_shutdown && spa_suspended(dp->dp_spa)) {
ZFS_EXIT(zfsvfs);
return (0);
}
+#endif /* HAVE_SHUTDOWN */
if (zfsvfs->z_log != NULL)
zil_commit(zfsvfs->z_log, 0);
kmem_free(zfsvfs, sizeof (zfsvfs_t));
}
+#ifdef HAVE_FUID_FEATURES
static void
zfs_set_fuid_feature(zfsvfs_t *zfsvfs)
{
}
zfsvfs->z_use_sa = USE_SA(zfsvfs->z_version, zfsvfs->z_os);
}
+#endif /* HAVE_FUID_FEATURES */
int
zfs_domount(vfs_t *vfsp, char *osname)
vfsp->vfs_fsid.val[0] = fsid_guid;
vfsp->vfs_fsid.val[1] = ((fsid_guid>>32) << 8);
+#ifdef HAVE_FUID_FEATURES
/*
* Set features for file system.
*/
vfs_set_feature(vfsp, VFSFT_CASEINSENSITIVE);
}
vfs_set_feature(vfsp, VFSFT_ZEROCOPY_SUPPORTED);
+#endif /* HAVE_FUID_FEATURES */
if (dmu_objset_is_snapshot(zfsvfs->z_os)) {
uint64_t pval;
if (error) {
dmu_objset_disown(zfsvfs->z_os, zfsvfs);
zfsvfs_free(zfsvfs);
- } else {
- atomic_add_32(&zfs_active_fs_count, 1);
}
return (error);
zfsvfs_t *zfsvfs = vfsp->vfs_data;
zfsvfs_free(zfsvfs);
-
- atomic_add_32(&zfs_active_fs_count, -1);
}
#endif /* HAVE_ZPL */
zfsvfs->z_version = newvers;
+#ifdef HAVE_FUID_FEATURES
if (zfsvfs->z_version >= ZPL_VERSION_FUID)
zfs_set_fuid_feature(zfsvfs);
+#endif /* HAVE_FUID_FEATURES */
return (0);
}