--- old/usr/src/uts/common/fs/nfs/nfs3_srv.c	2012-08-07 00:23:40.486356929 +0400
+++ new/usr/src/uts/common/fs/nfs/nfs3_srv.c	2012-08-07 00:23:39.858356913 +0400
@@ -71,12 +71,6 @@
  * for a description of this interface.
  */
 
-#ifdef DEBUG
-int rfs3_do_pre_op_attr = 1;
-int rfs3_do_post_op_attr = 1;
-int rfs3_do_post_op_fh3 = 1;
-#endif
-
 static writeverf3 write3verf;
 
 static int	sattr3_to_vattr(sattr3 *, struct vattr *);
@@ -227,12 +221,7 @@
 	if (error)
 		goto out;
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr)
-		bvap = &bva;
-#else
 	bvap = &bva;
-#endif
 
 	if (rdonly(exi, req) || vn_is_readonly(vp)) {
 		resp->status = NFS3ERR_ROFS;
@@ -322,16 +311,8 @@
 		goto out1;
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		ava.va_mask = AT_ALL;
-		avap = rfs4_delegated_getattr(vp, &ava, 0, cr) ? NULL : &ava;
-	} else
-		avap = NULL;
-#else
 	ava.va_mask = AT_ALL;
 	avap = rfs4_delegated_getattr(vp, &ava, 0, cr) ? NULL : &ava;
-#endif
 
 	/*
 	 * Force modified metadata out to stable storage.
@@ -421,15 +402,8 @@
 		}
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr) {
-		dva.va_mask = AT_ALL;
-		dvap = VOP_GETATTR(dvp, &dva, 0, cr, NULL) ? NULL : &dva;
-	}
-#else
 	dva.va_mask = AT_ALL;
 	dvap = VOP_GETATTR(dvp, &dva, 0, cr, NULL) ? NULL : &dva;
-#endif
 
 	if (args->what.name == nfs3nametoolong) {
 		resp->status = NFS3ERR_NAMETOOLONG;
@@ -524,16 +498,8 @@
 		}
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		dva.va_mask = AT_ALL;
-		dvap = VOP_GETATTR(dvp, &dva, 0, cr, NULL) ? NULL : &dva;
-	} else
-		dvap = NULL;
-#else
 	dva.va_mask = AT_ALL;
 	dvap = VOP_GETATTR(dvp, &dva, 0, cr, NULL) ? NULL : &dva;
-#endif
 
 	if (error)
 		goto out;
@@ -560,16 +526,8 @@
 	if (publicfh_flag)
 		exi_rele(exi);
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va;
-#endif
 
 	VN_RELE(vp);
 
@@ -662,12 +620,7 @@
 	if (error)
 		goto out;
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr)
-		vap = &va;
-#else
 	vap = &va;
-#endif
 
 	resp->resok.access = 0;
 
@@ -742,16 +695,8 @@
 			resp->resok.access |= ACCESS3_EXECUTE;
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va;
-#endif
 
 	resp->status = NFS3_OK;
 	vattr_to_post_op_attr(vap, &resp->resok.obj_attributes);
@@ -816,12 +761,7 @@
 	if (error)
 		goto out;
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr)
-		vap = &va;
-#else
 	vap = &va;
-#endif
 
 	/* We lied about the object type for a referral */
 	if (vn_is_nfs_reparse(vp, cr))
@@ -889,16 +829,9 @@
 			*(data + MAXPATHLEN - uio.uio_resid) = '\0';
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-#endif
+
 	/* Lie about object type again just to be consistent */
 	if (is_referral && vap != NULL)
 		vap->va_type = VLNK;
@@ -1077,12 +1010,7 @@
 	if (error)
 		goto out;
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr)
-		vap = &va;
-#else
 	vap = &va;
-#endif
 
 	if (vp->v_type != VREG) {
 		resp->status = NFS3ERR_INVAL;
@@ -1232,20 +1160,10 @@
 	va.va_mask = AT_ALL;
 	error = VOP_GETATTR(vp, &va, 0, cr, &ct);
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		if (error)
-			vap = NULL;
-		else
-			vap = &va;
-	} else
-		vap = NULL;
-#else
 	if (error)
 		vap = NULL;
 	else
 		vap = &va;
-#endif
 
 	VOP_RWUNLOCK(vp, V_WRITELOCK_FALSE, &ct);
 
@@ -1419,10 +1337,6 @@
 		goto err;
 
 	bvap = &bva;
-#ifdef DEBUG
-	if (!rfs3_do_pre_op_attr)
-		bvap = NULL;
-#endif
 	avap = bvap;
 
 	if (args->count != args->data.data_len) {
@@ -1534,11 +1448,6 @@
 	ava.va_mask = AT_ALL;
 	avap = VOP_GETATTR(vp, &ava, 0, cr, &ct) ? NULL : &ava;
 
-#ifdef DEBUG
-	if (!rfs3_do_post_op_attr)
-		avap = NULL;
-#endif
-
 	if (error)
 		goto err;
 
@@ -1627,16 +1536,8 @@
 		goto out;
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr) {
-		dbva.va_mask = AT_ALL;
-		dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva;
-	} else
-		dbvap = NULL;
-#else
 	dbva.va_mask = AT_ALL;
 	dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva;
-#endif
 	davap = dbvap;
 
 	if (args->where.name == nfs3nametoolong) {
@@ -1799,16 +1700,8 @@
 	error = VOP_CREATE(dvp, name, &va, excl, VWRITE,
 	    &vp, cr, 0, NULL, NULL);
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		dava.va_mask = AT_ALL;
-		davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava;
-	} else
-		davap = NULL;
-#else
 	dava.va_mask = AT_ALL;
 	davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava;
-#endif
 
 	if (error) {
 		/*
@@ -1912,24 +1805,11 @@
 	if (name != args->where.name)
 		kmem_free(name, MAXPATHLEN + 1);
 
-#ifdef DEBUG
-	if (!rfs3_do_post_op_attr)
-		vap = NULL;
-#endif
-
-#ifdef DEBUG
-	if (!rfs3_do_post_op_fh3)
-		resp->resok.obj.handle_follows = FALSE;
-	else {
-#endif
 	error = makefh3(&resp->resok.obj.handle, vp, exi);
 	if (error)
 		resp->resok.obj.handle_follows = FALSE;
 	else
 		resp->resok.obj.handle_follows = TRUE;
-#ifdef DEBUG
-	}
-#endif
 
 	/*
 	 * Force modified data and metadata out to stable storage.
@@ -2013,16 +1893,8 @@
 		goto out;
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr) {
-		dbva.va_mask = AT_ALL;
-		dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva;
-	} else
-		dbvap = NULL;
-#else
 	dbva.va_mask = AT_ALL;
 	dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva;
-#endif
 	davap = dbvap;
 
 	if (args->where.name == nfs3nametoolong) {
@@ -2082,16 +1954,8 @@
 	if (name != args->where.name)
 		kmem_free(name, MAXPATHLEN + 1);
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		dava.va_mask = AT_ALL;
-		davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava;
-	} else
-		davap = NULL;
-#else
 	dava.va_mask = AT_ALL;
 	davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava;
-#endif
 
 	/*
 	 * Force modified data and metadata out to stable storage.
@@ -2101,30 +1965,14 @@
 	if (error)
 		goto out;
 
-#ifdef DEBUG
-	if (!rfs3_do_post_op_fh3)
-		resp->resok.obj.handle_follows = FALSE;
-	else {
-#endif
 	error = makefh3(&resp->resok.obj.handle, vp, exi);
 	if (error)
 		resp->resok.obj.handle_follows = FALSE;
 	else
 		resp->resok.obj.handle_follows = TRUE;
-#ifdef DEBUG
-	}
-#endif
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-#endif
 
 	/*
 	 * Force modified data and metadata out to stable storage.
@@ -2194,16 +2042,8 @@
 		goto err;
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr) {
-		dbva.va_mask = AT_ALL;
-		dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva;
-	} else
-		dbvap = NULL;
-#else
 	dbva.va_mask = AT_ALL;
 	dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva;
-#endif
 	davap = dbvap;
 
 	if (args->where.name == nfs3nametoolong) {
@@ -2275,16 +2115,8 @@
 
 	error = VOP_SYMLINK(dvp, name, &va, symdata, cr, NULL, 0);
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		dava.va_mask = AT_ALL;
-		davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava;
-	} else
-		davap = NULL;
-#else
 	dava.va_mask = AT_ALL;
 	davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava;
-#endif
 
 	if (error)
 		goto err;
@@ -2306,30 +2138,14 @@
 		goto out;
 	}
 
-#ifdef DEBUG
-	if (!rfs3_do_post_op_fh3)
-		resp->resok.obj.handle_follows = FALSE;
-	else {
-#endif
 	error = makefh3(&resp->resok.obj.handle, vp, exi);
 	if (error)
 		resp->resok.obj.handle_follows = FALSE;
 	else
 		resp->resok.obj.handle_follows = TRUE;
-#ifdef DEBUG
-	}
-#endif
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-#endif
 
 	/*
 	 * Force modified data and metadata out to stable storage.
@@ -2402,16 +2218,8 @@
 		goto out;
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr) {
-		dbva.va_mask = AT_ALL;
-		dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva;
-	} else
-		dbvap = NULL;
-#else
 	dbva.va_mask = AT_ALL;
 	dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva;
-#endif
 	davap = dbvap;
 
 	if (args->where.name == nfs3nametoolong) {
@@ -2513,16 +2321,8 @@
 	if (name != args->where.name)
 		kmem_free(name, MAXPATHLEN + 1);
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		dava.va_mask = AT_ALL;
-		davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava;
-	} else
-		davap = NULL;
-#else
 	dava.va_mask = AT_ALL;
 	davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava;
-#endif
 
 	/*
 	 * Force modified data and metadata out to stable storage.
@@ -2534,30 +2334,14 @@
 
 	resp->status = NFS3_OK;
 
-#ifdef DEBUG
-	if (!rfs3_do_post_op_fh3)
-		resp->resok.obj.handle_follows = FALSE;
-	else {
-#endif
 	error = makefh3(&resp->resok.obj.handle, vp, exi);
 	if (error)
 		resp->resok.obj.handle_follows = FALSE;
 	else
 		resp->resok.obj.handle_follows = TRUE;
-#ifdef DEBUG
-	}
-#endif
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-#endif
 
 	/*
 	 * Force modified metadata out to stable storage.
@@ -2626,16 +2410,8 @@
 		goto err;
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr) {
-		bva.va_mask = AT_ALL;
-		bvap = VOP_GETATTR(vp, &bva, 0, cr, NULL) ? NULL : &bva;
-	} else
-		bvap = NULL;
-#else
 	bva.va_mask = AT_ALL;
 	bvap = VOP_GETATTR(vp, &bva, 0, cr, NULL) ? NULL : &bva;
-#endif
 	avap = bvap;
 
 	if (vp->v_type != VDIR) {
@@ -2711,16 +2487,8 @@
 	VN_RELE(targvp);
 	targvp = NULL;
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		ava.va_mask = AT_ALL;
-		avap = VOP_GETATTR(vp, &ava, 0, cr, NULL) ? NULL : &ava;
-	} else
-		avap = NULL;
-#else
 	ava.va_mask = AT_ALL;
 	avap = VOP_GETATTR(vp, &ava, 0, cr, NULL) ? NULL : &ava;
-#endif
 
 	/*
 	 * Force modified data and metadata out to stable storage.
@@ -2786,16 +2554,8 @@
 		goto err;
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr) {
-		bva.va_mask = AT_ALL;
-		bvap = VOP_GETATTR(vp, &bva, 0, cr, NULL) ? NULL : &bva;
-	} else
-		bvap = NULL;
-#else
 	bva.va_mask = AT_ALL;
 	bvap = VOP_GETATTR(vp, &bva, 0, cr, NULL) ? NULL : &bva;
-#endif
 	avap = bvap;
 
 	if (vp->v_type != VDIR) {
@@ -2848,16 +2608,8 @@
 	if (name != args->object.name)
 		kmem_free(name, MAXPATHLEN + 1);
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		ava.va_mask = AT_ALL;
-		avap = VOP_GETATTR(vp, &ava, 0, cr, NULL) ? NULL : &ava;
-	} else
-		avap = NULL;
-#else
 	ava.va_mask = AT_ALL;
 	avap = VOP_GETATTR(vp, &ava, 0, cr, NULL) ? NULL : &ava;
-#endif
 
 	/*
 	 * Force modified data and metadata out to stable storage.
@@ -2958,16 +2710,8 @@
 		}
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr) {
-		fbva.va_mask = AT_ALL;
-		fbvap = VOP_GETATTR(fvp, &fbva, 0, cr, NULL) ? NULL : &fbva;
-	} else
-		fbvap = NULL;
-#else
 	fbva.va_mask = AT_ALL;
 	fbvap = VOP_GETATTR(fvp, &fbva, 0, cr, NULL) ? NULL : &fbva;
-#endif
 	favap = fbvap;
 
 	fh3 = &args->to.dir;
@@ -2989,16 +2733,8 @@
 		goto err;
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr) {
-		tbva.va_mask = AT_ALL;
-		tbvap = VOP_GETATTR(tvp, &tbva, 0, cr, NULL) ? NULL : &tbva;
-	} else
-		tbvap = NULL;
-#else
 	tbva.va_mask = AT_ALL;
 	tbvap = VOP_GETATTR(tvp, &tbva, 0, cr, NULL) ? NULL : &tbva;
-#endif
 	tavap = tbvap;
 
 	if (fvp->v_type != VDIR || tvp->v_type != VDIR) {
@@ -3100,22 +2836,10 @@
 	VN_RELE(srcvp);
 	srcvp = NULL;
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		fava.va_mask = AT_ALL;
-		favap = VOP_GETATTR(fvp, &fava, 0, cr, NULL) ? NULL : &fava;
-		tava.va_mask = AT_ALL;
-		tavap = VOP_GETATTR(tvp, &tava, 0, cr, NULL) ? NULL : &tava;
-	} else {
-		favap = NULL;
-		tavap = NULL;
-	}
-#else
 	fava.va_mask = AT_ALL;
 	favap = VOP_GETATTR(fvp, &fava, 0, cr, NULL) ? NULL : &fava;
 	tava.va_mask = AT_ALL;
 	tavap = VOP_GETATTR(tvp, &tava, 0, cr, NULL) ? NULL : &tava;
-#endif
 
 	/*
 	 * Force modified data and metadata out to stable storage.
@@ -3197,16 +2921,8 @@
 		goto out;
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-#endif
 
 	fh3 = &args->link.dir;
 	to_exi = checkexport(&fh3->fh3_fsid, FH3TOXFIDP(fh3));
@@ -3243,16 +2959,8 @@
 		goto out;
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr) {
-		bva.va_mask = AT_ALL;
-		bvap = VOP_GETATTR(dvp, &bva, 0, cr, NULL) ? NULL : &bva;
-	} else
-		bvap = NULL;
-#else
 	bva.va_mask = AT_ALL;
 	bvap = VOP_GETATTR(dvp, &bva, 0, cr, NULL) ? NULL : &bva;
-#endif
 
 	if (dvp->v_type != VDIR) {
 		resp->status = NFS3ERR_NOTDIR;
@@ -3298,22 +3006,10 @@
 
 	error = VOP_LINK(dvp, vp, name, cr, NULL, 0);
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-		ava.va_mask = AT_ALL;
-		avap = VOP_GETATTR(dvp, &ava, 0, cr, NULL) ? NULL : &ava;
-	} else {
-		vap = NULL;
-		avap = NULL;
-	}
-#else
 	va.va_mask = AT_ALL;
 	vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
 	ava.va_mask = AT_ALL;
 	avap = VOP_GETATTR(dvp, &ava, 0, cr, NULL) ? NULL : &ava;
-#endif
 
 	/*
 	 * Force modified data and metadata out to stable storage.
@@ -3442,16 +3138,8 @@
 
 	(void) VOP_RWLOCK(vp, V_WRITELOCK_FALSE, NULL);
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-#endif
 
 	if (vp->v_type != VDIR) {
 		resp->status = NFS3ERR_NOTDIR;
@@ -3491,16 +3179,8 @@
 
 	error = VOP_READDIR(vp, &uio, cr, &iseof, NULL, 0);
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-#endif
 
 	if (error) {
 		kmem_free(data, count);
@@ -3730,16 +3410,8 @@
 
 	(void) VOP_RWLOCK(vp, V_WRITELOCK_FALSE, NULL);
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-#endif
 
 	if (vp->v_type != VDIR) {
 		error = ENOTDIR;
@@ -3898,19 +3570,9 @@
 
 		/* else, fall through */
 	}
-
 good:
-
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-#endif
 
 	VOP_RWUNLOCK(vp, V_WRITELOCK_FALSE, NULL);
 
@@ -3938,36 +3600,20 @@
 			continue;
 		}
 
-#ifdef DEBUG
-		if (rfs3_do_post_op_attr) {
-			nva.va_mask = AT_ALL;
-			nvap = rfs4_delegated_getattr(nvp, &nva, 0, cr) ?
-			    NULL : &nva;
-		} else
-			nvap = NULL;
-#else
 		nva.va_mask = AT_ALL;
 		nvap = rfs4_delegated_getattr(nvp, &nva, 0, cr) ? NULL : &nva;
-#endif
+
 		/* Lie about the object type for a referral */
 		if (vn_is_nfs_reparse(nvp, cr))
 			nvap->va_type = VLNK;
 
 		vattr_to_post_op_attr(nvap, &infop[i].attr);
 
-#ifdef DEBUG
-		if (!rfs3_do_post_op_fh3)
-			infop[i].fh.handle_follows = FALSE;
-		else {
-#endif
 		error = makefh3(&infop[i].fh.handle, nvp, exi);
 		if (!error)
 			infop[i].fh.handle_follows = TRUE;
 		else
 			infop[i].fh.handle_follows = FALSE;
-#ifdef DEBUG
-		}
-#endif
 
 		VN_RELE(nvp);
 		dp = nextdp(dp);
@@ -4106,16 +3752,8 @@
 
 	error = VFS_STATVFS(vp->v_vfsp, &sb);
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-#endif
 
 	if (error)
 		goto out;
@@ -4211,16 +3849,8 @@
 		}
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-#endif
 
 	resp->status = NFS3_OK;
 	vattr_to_post_op_attr(vap, &resp->resok.obj_attributes);
@@ -4323,16 +3953,8 @@
 		}
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
-#endif
 
 	error = VOP_PATHCONF(vp, _PC_LINK_MAX, &val, cr, NULL);
 	if (error)
@@ -4424,14 +4046,7 @@
 	if (error)
 		goto out;
 
-#ifdef DEBUG
-	if (rfs3_do_pre_op_attr)
-		bvap = &bva;
-	else
-		bvap = NULL;
-#else
 	bvap = &bva;
-#endif
 
 	if (rdonly(exi, req)) {
 		resp->status = NFS3ERR_ROFS;
@@ -4465,16 +4080,8 @@
 
 	error = VOP_FSYNC(vp, FSYNC, cr, NULL);
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		ava.va_mask = AT_ALL;
-		avap = VOP_GETATTR(vp, &ava, 0, cr, NULL) ? NULL : &ava;
-	} else
-		avap = NULL;
-#else
 	ava.va_mask = AT_ALL;
 	avap = VOP_GETATTR(vp, &ava, 0, cr, NULL) ? NULL : &ava;
-#endif
 
 	if (error)
 		goto out;
--- old/usr/src/uts/common/fs/nfs/nfs_acl_srv.c	2012-08-07 00:23:41.918356966 +0400
+++ new/usr/src/uts/common/fs/nfs/nfs_acl_srv.c	2012-08-07 00:23:41.294356950 +0400
@@ -459,16 +459,8 @@
 		goto out;
 	}
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va;
-#endif
 
 	bzero((caddr_t)&resp->resok.acl, sizeof (resp->resok.acl));
 
@@ -498,16 +490,8 @@
 	if (error)
 		goto out;
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va;
-#endif
 
 	VN_RELE(vp);
 
@@ -588,16 +572,8 @@
 
 	(void) VOP_RWLOCK(vp, V_WRITELOCK_TRUE, NULL);
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va;
-#endif
 
 	if (rdonly(exi, req) || vn_is_readonly(vp)) {
 		resp->status = NFS3ERR_ROFS;
@@ -606,16 +582,8 @@
 
 	error = VOP_SETSECATTR(vp, &args->acl, 0, cr, NULL);
 
-#ifdef DEBUG
-	if (rfs3_do_post_op_attr) {
-		va.va_mask = AT_ALL;
-		vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va;
-	} else
-		vap = NULL;
-#else
 	va.va_mask = AT_ALL;
 	vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va;
-#endif
 
 	if (error)
 		goto out;
--- old/usr/src/uts/common/nfs/nfs.h	2012-08-07 00:23:42.918356991 +0400
+++ new/usr/src/uts/common/nfs/nfs.h	2012-08-07 00:23:42.294356975 +0400
@@ -2280,11 +2280,7 @@
 extern vfsops_t		*nfs3_vfsops;
 extern struct vnodeops	*nfs3_vnodeops;
 extern const struct fs_operation_def nfs3_vnodeops_template[];
-#ifdef DEBUG
-extern int		rfs3_do_pre_op_attr;
-extern int		rfs3_do_post_op_attr;
-extern int		rfs3_do_post_op_fh3;
-#endif
+
 /*
  * Some servers do not properly update the attributes of the
  * directory when changes are made.  To allow interoperability
