Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F139445598
D2794.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D2794.diff
View Options
Index: head/sys/cddl/compat/opensolaris/sys/vfs.h
===================================================================
--- head/sys/cddl/compat/opensolaris/sys/vfs.h
+++ head/sys/cddl/compat/opensolaris/sys/vfs.h
@@ -54,17 +54,6 @@
#define VFS_NOSETUID MNT_NOSUID
#define VFS_NOEXEC MNT_NOEXEC
-#define VFS_HOLD(vfsp) do { \
- MNT_ILOCK(vfsp); \
- MNT_REF(vfsp); \
- MNT_IUNLOCK(vfsp); \
-} while (0)
-#define VFS_RELE(vfsp) do { \
- MNT_ILOCK(vfsp); \
- MNT_REL(vfsp); \
- MNT_IUNLOCK(vfsp); \
-} while (0)
-
#define fs_vscan(vp, cr, async) (0)
#define VROOT VV_ROOT
Index: head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
===================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
@@ -589,7 +589,9 @@
{
vnode_t *vp;
+#ifdef illumos
VFS_HOLD(vfsp);
+#endif
vp = gfs_dir_create(size, NULL, vfsp, ops, entries, inode_cb,
maxlen, readdir_cb, lookup_cb);
/* Manually set the inode */
@@ -700,7 +702,9 @@
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
} else {
ASSERT(vp->v_vfsp != NULL);
+#ifdef illumos
VFS_RELE(vp->v_vfsp);
+#endif
}
#ifdef TODO
if (vp->v_flag & V_XATTRDIR)
Index: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
===================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
@@ -1443,7 +1443,14 @@
mutex_enter(&os->os_user_ptr_lock);
*zfvp = dmu_objset_get_user(os);
if (*zfvp) {
+#ifdef illumos
VFS_HOLD((*zfvp)->z_vfs);
+#else
+ if (vfs_busy((*zfvp)->z_vfs, 0) != 0) {
+ *zfvp = NULL;
+ error = SET_ERROR(ESRCH);
+ }
+#endif
} else {
error = SET_ERROR(ESRCH);
}
@@ -1487,7 +1494,11 @@
rrm_exit(&zfsvfs->z_teardown_lock, tag);
if (zfsvfs->z_vfs) {
+#ifdef illumos
VFS_RELE(zfsvfs->z_vfs);
+#else
+ vfs_unbusy(zfsvfs->z_vfs);
+#endif
} else {
dmu_objset_disown(zfsvfs->z_os, zfsvfs);
zfsvfs_free(zfsvfs);
@@ -3018,11 +3029,13 @@
mtx_lock(&mountlist_mtx);
TAILQ_FOREACH(vfsp, &mountlist, mnt_list) {
if (strcmp(refstr_value(vfsp->vfs_resource), resource) == 0) {
- VFS_HOLD(vfsp);
+ if (vfs_busy(vfsp, MBF_MNTLSTLOCK) != 0)
+ vfsp = NULL;
break;
}
}
- mtx_unlock(&mountlist_mtx);
+ if (vfsp == NULL)
+ mtx_unlock(&mountlist_mtx);
return (vfsp);
}
@@ -3475,7 +3488,11 @@
ASSERT(!dsl_pool_config_held(dmu_objset_pool(zfsvfs->z_os)));
err = vn_vfswlock(vfsp->vfs_vnodecovered);
+#ifdef illumos
VFS_RELE(vfsp);
+#else
+ vfs_unbusy(vfsp);
+#endif
if (err != 0)
return (SET_ERROR(err));
@@ -3721,7 +3738,11 @@
resume_err = zfs_resume_fs(zfsvfs, fsname);
error = error ? error : resume_err;
}
+#ifdef illumos
VFS_RELE(zfsvfs->z_vfs);
+#else
+ vfs_unbusy(zfsvfs->z_vfs);
+#endif
} else {
error = dsl_dataset_rollback(fsname, NULL, outnvl);
}
@@ -4376,7 +4397,11 @@
if (error == 0)
error = zfs_resume_fs(zfsvfs, tofs);
error = error ? error : end_err;
+#ifdef illumos
VFS_RELE(zfsvfs->z_vfs);
+#else
+ vfs_unbusy(zfsvfs->z_vfs);
+#endif
} else {
error = dmu_recv_end(&drc, NULL);
}
@@ -4925,7 +4950,11 @@
}
if (error == 0)
error = dmu_objset_userspace_upgrade(zfsvfs->z_os);
+#ifdef illumos
VFS_RELE(zfsvfs->z_vfs);
+#else
+ vfs_unbusy(zfsvfs->z_vfs);
+#endif
} else {
/* XXX kind of reading contents without owning */
error = dmu_objset_hold(zc->zc_name, FTAG, &os);
Index: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
===================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
@@ -743,7 +743,9 @@
if (vp->v_type != VFIFO)
VN_LOCK_ASHARE(vp);
+#ifdef illumos
VFS_HOLD(zfsvfs->z_vfs);
+#endif
return (zp);
}
@@ -1428,7 +1430,9 @@
kmem_cache_free(znode_cache, zp);
+#ifdef illumos
VFS_RELE(zfsvfs->z_vfs);
+#endif
}
void
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 13, 4:26 AM (19 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26921270
Default Alt Text
D2794.diff (4 KB)
Attached To
Mode
D2794: remove emulation of VFS_HOLD and VFS_RELE from opensolaris compat
Attached
Detach File
Event Timeline
Log In to Comment