| @@ -487,27 +487,29 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d | | | @@ -487,27 +487,29 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d |
487 | error = getnewvnode(VT_ZFS, zfsvfs->z_parent->z_vfs, | | 487 | error = getnewvnode(VT_ZFS, zfsvfs->z_parent->z_vfs, |
488 | zfs_vnodeop_p, NULL, &sharezp->z_vnode); | | 488 | zfs_vnodeop_p, NULL, &sharezp->z_vnode); |
489 | if (error) { | | 489 | if (error) { |
490 | kmem_cache_free(znode_cache, sharezp); | | 490 | kmem_cache_free(znode_cache, sharezp); |
491 | return error; | | 491 | return error; |
492 | } | | 492 | } |
493 | vp->v_type = VDIR; | | 493 | vp->v_type = VDIR; |
494 | | | 494 | |
495 | VERIFY(0 == zfs_acl_ids_create(sharezp, IS_ROOT_NODE, &vattr, | | 495 | VERIFY(0 == zfs_acl_ids_create(sharezp, IS_ROOT_NODE, &vattr, |
496 | kcred, NULL, &acl_ids)); | | 496 | kcred, NULL, &acl_ids)); |
497 | zfs_mknode(sharezp, &vattr, tx, kcred, IS_ROOT_NODE, | | 497 | zfs_mknode(sharezp, &vattr, tx, kcred, IS_ROOT_NODE, |
498 | &zp, 0, &acl_ids); | | 498 | &zp, 0, &acl_ids); |
499 | ASSERT3P(zp, ==, sharezp); | | 499 | ASSERT3P(zp, ==, sharezp); |
| | | 500 | #ifndef __NetBSD__ |
500 | ASSERT(!vn_in_dnlc(ZTOV(sharezp))); /* not valid to move */ | | 501 | ASSERT(!vn_in_dnlc(ZTOV(sharezp))); /* not valid to move */ |
| | | 502 | #endif |
501 | POINTER_INVALIDATE(&sharezp->z_zfsvfs); | | 503 | POINTER_INVALIDATE(&sharezp->z_zfsvfs); |
502 | error = zap_add(zfsvfs->z_os, MASTER_NODE_OBJ, | | 504 | error = zap_add(zfsvfs->z_os, MASTER_NODE_OBJ, |
503 | ZFS_SHARES_DIR, 8, 1, &sharezp->z_id, tx); | | 505 | ZFS_SHARES_DIR, 8, 1, &sharezp->z_id, tx); |
504 | zfsvfs->z_shares_dir = sharezp->z_id; | | 506 | zfsvfs->z_shares_dir = sharezp->z_id; |
505 | | | 507 | |
506 | zfs_acl_ids_free(&acl_ids); | | 508 | zfs_acl_ids_free(&acl_ids); |
507 | ZTOV(sharezp)->v_count = 0; | | 509 | ZTOV(sharezp)->v_count = 0; |
508 | dmu_buf_rele(sharezp->z_dbuf, NULL); | | 510 | dmu_buf_rele(sharezp->z_dbuf, NULL); |
509 | sharezp->z_dbuf = NULL; | | 511 | sharezp->z_dbuf = NULL; |
510 | kmem_cache_free(znode_cache, sharezp); | | 512 | kmem_cache_free(znode_cache, sharezp); |
511 | | | 513 | |
512 | return (error); | | 514 | return (error); |
513 | } | | 515 | } |