X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fzfs_vfsops.c;h=14411b8c4cfa95bce4501e95cb1f35a03f4437fd;hb=b516a07b997a8c3006788963f6b6128e505cf56c;hp=58d325f899ab17e9a5d1451cd3f5d32e8e7ece35;hpb=42ab36aa368b09dfec7214cc884b004ee934b2df;p=zfs.git diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c index 58d325f..14411b8 100644 --- a/module/zfs/zfs_vfsops.c +++ b/module/zfs/zfs_vfsops.c @@ -66,35 +66,6 @@ #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 @@ -104,16 +75,7 @@ zfs_sync(vfs_t *vfsp, short flag, cred_t *cr) * 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) { @@ -126,14 +88,19 @@ zfs_sync(vfs_t *vfsp, short flag, cred_t *cr) 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); @@ -1011,6 +978,7 @@ zfsvfs_free(zfsvfs_t *zfsvfs) kmem_free(zfsvfs, sizeof (zfsvfs_t)); } +#ifdef HAVE_FUID_FEATURES static void zfs_set_fuid_feature(zfsvfs_t *zfsvfs) { @@ -1025,6 +993,7 @@ 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) @@ -1066,6 +1035,7 @@ 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. */ @@ -1079,6 +1049,7 @@ zfs_domount(vfs_t *vfsp, char *osname) 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; @@ -1104,8 +1075,6 @@ out: if (error) { dmu_objset_disown(zfsvfs->z_os, zfsvfs); zfsvfs_free(zfsvfs); - } else { - atomic_add_32(&zfs_active_fs_count, 1); } return (error); @@ -1630,8 +1599,6 @@ zfs_freevfs(vfs_t *vfsp) zfsvfs_t *zfsvfs = vfsp->vfs_data; zfsvfs_free(zfsvfs); - - atomic_add_32(&zfs_active_fs_count, -1); } #endif /* HAVE_ZPL */ @@ -1714,8 +1681,10 @@ zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers) 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); }