From 8b384c52c08888a2aafe41e1c5af807d38e63c06 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Tue, 24 Apr 2007 16:59:20 +0000 Subject: [PATCH] MFp4: Now that ZFS can use FreeBSD's namecache, turn it off by default and turn off DNLC, but don't remove DNLC yet just in case. --- sys/cddl/contrib/opensolaris/uts/common/fs/dnlc.c | 4 ++++ sys/contrib/opensolaris/uts/common/fs/dnlc.c | 4 ++++ sys/modules/zfs/Makefile | 3 +++ 3 files changed, 11 insertions(+) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/dnlc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/dnlc.c index 97a55d75f590..78bc421559af 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/dnlc.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/dnlc.c @@ -203,7 +203,11 @@ struct nc_stats ncs = { { "pick_last", KSTAT_DATA_UINT64 }, }; +#ifdef FREEBSD_NAMECACHE +static int doingcache = 0; +#else static int doingcache = 1; +#endif TUNABLE_INT("vfs.zfs.dnlc.enable", &doingcache); SYSCTL_INT(_vfs_zfs_dnlc, OID_AUTO, enable, CTLFLAG_RDTUN, &doingcache, 0, "Enable/disable name cache"); diff --git a/sys/contrib/opensolaris/uts/common/fs/dnlc.c b/sys/contrib/opensolaris/uts/common/fs/dnlc.c index 97a55d75f590..78bc421559af 100644 --- a/sys/contrib/opensolaris/uts/common/fs/dnlc.c +++ b/sys/contrib/opensolaris/uts/common/fs/dnlc.c @@ -203,7 +203,11 @@ struct nc_stats ncs = { { "pick_last", KSTAT_DATA_UINT64 }, }; +#ifdef FREEBSD_NAMECACHE +static int doingcache = 0; +#else static int doingcache = 1; +#endif TUNABLE_INT("vfs.zfs.dnlc.enable", &doingcache); SYSCTL_INT(_vfs_zfs_dnlc, OID_AUTO, enable, CTLFLAG_RDTUN, &doingcache, 0, "Enable/disable name cache"); diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index 80f43a590935..3ca60a25253f 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -61,6 +61,9 @@ SRCS+= vdev_geom.c # Use UMA for ZIO allocation. This is not stable. #CFLAGS+=-DZIO_USE_UMA +# Use FreeBSD's namecache. +CFLAGS+=-DFREEBSD_NAMECACHE + CWARNFLAGS=-Wall CWARNFLAGS+=-Wno-unknown-pragmas CWARNFLAGS+=-Wno-missing-braces