Only reduce __zio_execute() stack usage in kernel space
[zfs.git] / module / zfs / zfs_vfsops.c
index 6d75326..175dca8 100644 (file)
@@ -584,7 +584,7 @@ zfs_sb_create(const char *osname, zfs_sb_t **zsbp)
        int i, error;
        uint64_t sa_obj;
 
-       zsb = kmem_zalloc(sizeof (zfs_sb_t), KM_SLEEP);
+       zsb = kmem_zalloc(sizeof (zfs_sb_t), KM_SLEEP | KM_NODEBUG);
 
        /*
         * We claim to always be readonly so we can open snapshots;
@@ -920,6 +920,7 @@ zfs_statvfs(struct dentry *dentry, struct kstatfs *statp)
 {
        zfs_sb_t *zsb = dentry->d_sb->s_fs_info;
        uint64_t refdbytes, availbytes, usedobjs, availobjs;
+       uint64_t fsid;
        uint32_t bshift;
 
        ZFS_ENTER(zsb);
@@ -927,6 +928,7 @@ zfs_statvfs(struct dentry *dentry, struct kstatfs *statp)
        dmu_objset_space(zsb->z_os,
            &refdbytes, &availbytes, &usedobjs, &availobjs);
 
+       fsid = dmu_objset_fsid_guid(zsb->z_os);
        /*
         * The underlying storage pool actually uses multiple block
         * size.  Under Solaris frsize (fragment size) is reported as
@@ -960,8 +962,8 @@ zfs_statvfs(struct dentry *dentry, struct kstatfs *statp)
         */
        statp->f_ffree = MIN(availobjs, availbytes >> DNODE_SHIFT);
        statp->f_files = statp->f_ffree + usedobjs;
-       statp->f_fsid.val[0] = dentry->d_sb->s_dev;
-       statp->f_fsid.val[1] = 0;
+       statp->f_fsid.val[0] = (uint32_t)fsid;
+       statp->f_fsid.val[1] = (uint32_t)(fsid >> 32);
        statp->f_type = ZFS_SUPER_MAGIC;
        statp->f_namelen = ZFS_MAXNAMELEN;
 
@@ -1039,12 +1041,6 @@ zfs_sb_teardown(zfs_sb_t *zsb, boolean_t unmounting)
        }
 
        /*
-        * Drain the iput_taskq to ensure all active references to the
-        * zfs_sb_t have been handled only then can it be safely destroyed.
-        */
-       taskq_wait(dsl_pool_iput_taskq(dmu_objset_pool(zsb->z_os)));
-
-       /*
         * Close the zil. NB: Can't close the zil while zfs_inactive
         * threads are blocked as zil_close can call zfs_inactive.
         */
@@ -1110,9 +1106,9 @@ zfs_sb_teardown(zfs_sb_t *zsb, boolean_t unmounting)
        /*
         * Evict cached data
         */
-       if (dmu_objset_is_dirty_anywhere(zsb->z_os))
-               if (!zfs_is_readonly(zsb))
-                       txg_wait_synced(dmu_objset_pool(zsb->z_os), 0);
+       if (dsl_dataset_is_dirty(dmu_objset_ds(zsb->z_os)) &&
+           !zfs_is_readonly(zsb))
+               txg_wait_synced(dmu_objset_pool(zsb->z_os), 0);
        (void) dmu_objset_evict_dbufs(zsb->z_os);
 
        return (0);