--- old/usr/src/uts/common/fs/fsh.c	Mon Jul 22 19:15:36 2013
+++ new/usr/src/uts/common/fs/fsh.c	Mon Jul 22 19:15:36 2013
@@ -95,7 +95,7 @@
  * fsh_fs_xxx()/fsh_hook_xxx() API. VFS_RELE() should be called after.
  */
 
-#define	FSH_GET_FSREC(vfsp)	(vfsp->vfs_fshrecord)
+#define	FSH_GET_FSRECP(vfsp)	(vfsp->vfs_fshrecord)
 
 int
 fsh_fs_enable(vfs_t *vfsp)
@@ -102,7 +102,7 @@
 {
 	fsh_fsrecord_t *fsrec;
 
-	fsrec = FSH_GET_FSREC(vfsp);
+	fsrec = FSH_GET_FSRECP(vfsp);
 	rw_enter(&fsrec->fshfsr_en_lock, RW_WRITER);
 	fsrec->fshfsr_enabled = 1;
 	rw_exit(&fsrec->fshfsr_en_lock);
@@ -115,7 +115,7 @@
 {
 	fsh_fsrecord_t *fsrec;
 
-	fsrec = FSH_GET_FSREC(vfsp);
+	fsrec = FSH_GET_FSRECP(vfsp);
 	rw_enter(&fsrec->fshfsr_en_lock, RW_WRITER);
 	fsrec->fshfsr_enabled = 0;
 	rw_exit(&fsrec->fshfsr_en_lock);
@@ -133,6 +133,7 @@
 			hooks->hook_##lower;				\
 		nodep->fshn_hooki.fshi_arg = hooks->arg;		\
 									\
+		listp = &fsrecp->fshfsr_opv[FSH_##type##_##upper];	\
 		rw_enter(&listp->fshl_lock, RW_WRITER);			\
 		nodep->fshn_next =					\
 			fsrecp						\
@@ -141,6 +142,7 @@
 			= nodep;					\
 		rw_exit(&listp->fshl_lock);				\
 	}								\
+_NOTE(CONSTCOND)							\
 } while (0)
 
 #define	FSH_INSTALL_VN(hooks, fsrecp, listp, nodep, lower, upper)	\
@@ -156,7 +158,7 @@
 	fsh_list_t	*list;
 	fsh_node_t	*node;
 
-	fsrec = FSH_GET_FSREC(vfsp);
+	fsrec = FSH_GET_FSRECP(vfsp);
 
 	FSH_INSTALL_VN(hooks, fsrec, list, node, open, OPEN);
 	FSH_INSTALL_VN(hooks, fsrec, list, node, close, CLOSE);
@@ -206,6 +208,7 @@
 	rw_exit(&list->fshl_lock);					\
 									\
 	kmem_free(node, sizeof (*node));				\
+_NOTE(CONSTCOND)							\
 } while (0)
 
 #define	FSH_REMOVE_VN(hooks, fsrec, list, node, prev, lower, upper)	\
@@ -222,7 +225,7 @@
 	fsh_node_t	*node;
 	fsh_node_t	*prev;
 
-	fsrec = FSH_GET_FSREC(vfsp);
+	fsrec = FSH_GET_FSRECP(vfsp);
 
 	FSH_REMOVE_VN(hooks, fsrec, list, node, prev, open, OPEN);
 	FSH_REMOVE_VN(hooks, fsrec, list, node, prev, close, CLOSE);
@@ -294,9 +297,10 @@
 
 #define	FSH_ENABLED(vfsp, enabled)					\
 do {									\
-	rw_enter(&FSH_GET_FSREC(vfsp)->fshfsr_en_lock, RW_READER);	\
-	*enabled = FSH_GET_FSREC(vfsp)->fshfsr_enabled;			\
-	rw_exit(&FSH_GET_FSREC(vfsp)->fshfsr_en_lock);		\
+	rw_enter(&FSH_GET_FSRECP(vfsp)->fshfsr_en_lock, RW_READER);	\
+	*enabled = FSH_GET_FSRECP(vfsp)->fshfsr_enabled;			\
+	rw_exit(&FSH_GET_FSRECP(vfsp)->fshfsr_en_lock);			\
+_NOTE(CONSTCOND)							\
 } while (0)
 
 int
@@ -310,7 +314,7 @@
 	if (!enabled)
 		return ((*((*vpp)->v_op->vop_open))(vpp, mode, cr, ct));
 
-	list = &FSH_GET_FSREC((*vpp)->v_vfsp)->fshfsr_opv[FSH_VOP_OPEN];
+	list = &FSH_GET_FSRECP((*vpp)->v_vfsp)->fshfsr_opv[FSH_VOP_OPEN];
 	rw_enter(&list->fshl_lock, RW_READER);
 	if (list->fshl_head == NULL)
 		ret =  (*((*vpp)->v_op->vop_open))(vpp, mode, cr, ct);
@@ -334,7 +338,7 @@
 		return ((*(vp->v_op->vop_close))(vp, flag, count, offset,
 			cr, ct));
 
-	list = &FSH_GET_FSREC(vp->v_vfsp)->fshfsr_opv[FSH_VOP_CLOSE];
+	list = &FSH_GET_FSRECP(vp->v_vfsp)->fshfsr_opv[FSH_VOP_CLOSE];
 	rw_enter(&list->fshl_lock, RW_READER);
 	if (list->fshl_head == NULL)
 		ret =  (*(vp->v_op->vop_close))(vp, flag, count, offset,
@@ -359,7 +363,7 @@
 	if (!enabled)
 		return ((*(vp->v_op->vop_read))(vp, uiop, ioflag, cr, ct));
 
-	list = &FSH_GET_FSREC(vp->v_vfsp)->fshfsr_opv[FSH_VOP_READ];
+	list = &FSH_GET_FSRECP(vp->v_vfsp)->fshfsr_opv[FSH_VOP_READ];
 	rw_enter(&list->fshl_lock, RW_READER);
 	if (list->fshl_head == NULL)
 		ret =  (*(vp->v_op->vop_read))(vp, uiop, ioflag, cr, ct);
@@ -383,7 +387,7 @@
 	if (!enabled)
 		return ((*(vp->v_op->vop_write))(vp, uiop, ioflag, cr, ct));
 
-	list = &FSH_GET_FSREC(vp->v_vfsp)->fshfsr_opv[FSH_VOP_WRITE];
+	list = &FSH_GET_FSRECP(vp->v_vfsp)->fshfsr_opv[FSH_VOP_WRITE];
 	rw_enter(&list->fshl_lock, RW_READER);
 	if (list->fshl_head == NULL)
 		ret =  (*(vp->v_op->vop_write))(vp, uiop, ioflag, cr, ct);
@@ -401,7 +405,7 @@
 	fsh_list_t *list;
 	int ret;
 
-	list = &FSH_GET_FSREC(vfsp)->fshfsr_opv[FSH_VFS_MOUNT];
+	list = &FSH_GET_FSRECP(vfsp)->fshfsr_opv[FSH_VFS_MOUNT];
 	rw_enter(&list->fshl_lock, RW_READER);
 	if (list->fshl_head == NULL)
 		ret = (*(vfsp->vfs_op->vfs_mount))(vfsp, mvp, uap, cr);
@@ -419,7 +423,7 @@
 	fsh_list_t *list;
 	int ret;
 
-	list = &FSH_GET_FSREC(vfsp)->fshfsr_opv[FSH_VFS_UNMOUNT];
+	list = &FSH_GET_FSRECP(vfsp)->fshfsr_opv[FSH_VFS_UNMOUNT];
 	rw_enter(&list->fshl_lock, RW_READER);
 	if (list->fshl_head == NULL)
 		ret = (*(vfsp->vfs_op->vfs_unmount))(vfsp, flag, cr);
@@ -436,7 +440,7 @@
 	fsh_list_t *list;
 	int ret;
 
-	list = &FSH_GET_FSREC(vfsp)->fshfsr_opv[FSH_VFS_ROOT];
+	list = &FSH_GET_FSRECP(vfsp)->fshfsr_opv[FSH_VFS_ROOT];
 	rw_enter(&list->fshl_lock, RW_READER);
 	if (list->fshl_head == NULL)
 		ret = (*(vfsp->vfs_op->vfs_root))(vfsp, vpp);
@@ -453,7 +457,7 @@
 	fsh_list_t *list;
 	int ret;
 
-	list = &FSH_GET_FSREC(vfsp)->fshfsr_opv[FSH_VFS_STATFS];
+	list = &FSH_GET_FSRECP(vfsp)->fshfsr_opv[FSH_VFS_STATFS];
 	rw_enter(&list->fshl_lock, RW_READER);
 	if (list->fshl_head == NULL)
 		ret = (*(vfsp->vfs_op->vfs_statvfs))(vfsp, sp);
@@ -470,7 +474,7 @@
 	fsh_list_t *list;
 	int ret;
 
-	list = &FSH_GET_FSREC(vfsp)->fshfsr_opv[FSH_VFS_VGET];
+	list = &FSH_GET_FSRECP(vfsp)->fshfsr_opv[FSH_VFS_VGET];
 	rw_enter(&list->fshl_lock, RW_READER);
 	if (list->fshl_head == NULL)
 		ret = (*(vfsp->vfs_op->vfs_vget))(vfsp, vpp, fidp);
@@ -524,12 +528,12 @@
 	bzero(fsrecp, sizeof (*fsrecp));
 
 	rw_init(&fsrecp->fshfsr_en_lock, NULL, RW_DRIVER, NULL);
-	fsrecp->fshfsr_enabled = 1;
+	fsrecp->fshfsr_enabled = 0; // DEBUG
 
 	for (i = 0; i < FSH_SUPPORTED_OPS_COUNT; i++)
 		rw_init(&fsrecp->fshfsr_opv[i].fshl_lock, NULL, RW_DRIVER,
 			NULL);
-	return fsrecp;
+	return (fsrecp);
 }
 
 /* To be used ONLY in vfs_free() */
--- old/usr/src/uts/common/sys/Makefile	Mon Jul 22 19:15:36 2013
+++ new/usr/src/uts/common/sys/Makefile	Mon Jul 22 19:15:36 2013
@@ -241,8 +241,8 @@
 	flock.h			\
 	flock_impl.h		\
 	fork.h			\
-	fsd.h			\
-	fsd_impl.h		\
+	fsh.h			\
+	fsh_impl.h		\
 	fss.h			\
 	fsspriocntl.h		\
 	fsid.h			\
