Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/cddl/osnet/dist/uts/common/fs/zfs Remove vnode crea...
details: https://anonhg.NetBSD.org/src/rev/9f20c0686eb2
branches: trunk
changeset: 334748:9f20c0686eb2
user: hannken <hannken%NetBSD.org@localhost>
date: Fri Dec 05 09:12:29 2014 +0000
description:
Remove vnode creation from zfs_create_fs() and zfs_create_share_dir()
as a vnode is not needed here.
Inspired by FreeBSD r253603.
diffstat:
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c | 28 +----------------
1 files changed, 2 insertions(+), 26 deletions(-)
diffs (80 lines):
diff -r e4e53b92c17b -r 9f20c0686eb2 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c Fri Dec 05 04:52:01 2014 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c Fri Dec 05 09:12:29 2014 +0000
@@ -121,6 +121,8 @@
ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs));
+ zp->z_vnode = NULL;
+
list_link_init(&zp->z_link_node);
mutex_init(&zp->z_lock, NULL, MUTEX_DEFAULT, NULL);
@@ -468,7 +470,6 @@
zfs_acl_ids_t acl_ids;
vattr_t vattr;
znode_t *sharezp;
- vnode_t *vp;
znode_t *zp;
int error;
@@ -483,15 +484,6 @@
sharezp->z_atime_dirty = 0;
sharezp->z_zfsvfs = zfsvfs;
- vp = ZTOV(sharezp);
- error = getnewvnode(VT_ZFS, zfsvfs->z_parent->z_vfs,
- zfs_vnodeop_p, NULL, &sharezp->z_vnode);
- if (error) {
- kmem_cache_free(znode_cache, sharezp);
- return error;
- }
- vp->v_type = VDIR;
-
VERIFY(0 == zfs_acl_ids_create(sharezp, IS_ROOT_NODE, &vattr,
kcred, NULL, &acl_ids));
zfs_mknode(sharezp, &vattr, tx, kcred, IS_ROOT_NODE,
@@ -506,7 +498,6 @@
zfsvfs->z_shares_dir = sharezp->z_id;
zfs_acl_ids_free(&acl_ids);
- ZTOV(sharezp)->v_count = 0;
dmu_buf_rele(sharezp->z_dbuf, NULL);
sharezp->z_dbuf = NULL;
kmem_cache_free(znode_cache, sharezp);
@@ -1489,7 +1480,6 @@
int error;
int i;
znode_t *rootzp = NULL;
- vnode_t *vp;
vattr_t vattr;
znode_t *zp;
zfs_acl_ids_t acl_ids;
@@ -1562,19 +1552,6 @@
rootzp->z_unlinked = 0;
rootzp->z_atime_dirty = 0;
- for (;;) {
- error = getnewvnode(VT_ZFS, NULL, zfs_vnodeop_p,
- NULL, &rootzp->z_vnode);
- if (error == 0)
- break;
- printf("WARNING: zfs_create_fs: unable to get vnode, "
- "error=%d\n", error);
- kpause("zfsvn", false, hz, NULL);
- }
-
- vp = ZTOV(rootzp);
- vp->v_type = VDIR;
-
bzero(&zfsvfs, sizeof (zfsvfs_t));
zfsvfs.z_os = os;
@@ -1609,7 +1586,6 @@
dmu_buf_rele(rootzp->z_dbuf, NULL);
rootzp->z_dbuf = NULL;
- ungetnewvnode(vp);
kmem_cache_free(znode_cache, rootzp);
/*
Home |
Main Index |
Thread Index |
Old Index