aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2007-04-10 12:52:14 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2007-04-10 12:52:14 +0000
commit5b9528e2d4475528b6cf57f4340257f0db759755 (patch)
treee757374dd97c4481bc8a09a2af13b4bad70ed34a
parenta52da38f26ced7b13de3280105c8a9ce97573607 (diff)
downloadsrc-5b9528e2d4475528b6cf57f4340257f0db759755.tar.gz
src-5b9528e2d4475528b6cf57f4340257f0db759755.zip
MFp4: Hide under '#ifdef _KERNEL' only what's really needed.
Notes
Notes: svn path=/head/; revision=168582
-rw-r--r--cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h5
-rw-r--r--contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h5
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c8
-rw-r--r--sys/contrib/opensolaris/uts/common/fs/zfs/arc.c8
4 files changed, 12 insertions, 14 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h b/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
index 749ff5fe3b5d..04b9da4104b5 100644
--- a/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
+++ b/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
@@ -489,12 +489,15 @@ struct file {
#define SX_SYSINIT(name, lock, desc)
#define SYSCTL_DECL(...)
-#define SYSCTL_INT(...)
#define SYSCTL_NODE(...)
+#define SYSCTL_INT(...)
+#define SYSCTL_ULONG(...)
#ifdef TUNABLE_INT
#undef TUNABLE_INT
+#undef TUNABLE_ULONG
#endif
#define TUNABLE_INT(...)
+#define TUNABLE_ULONG(...)
/* Errors */
diff --git a/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h b/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
index 749ff5fe3b5d..04b9da4104b5 100644
--- a/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
+++ b/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
@@ -489,12 +489,15 @@ struct file {
#define SX_SYSINIT(name, lock, desc)
#define SYSCTL_DECL(...)
-#define SYSCTL_INT(...)
#define SYSCTL_NODE(...)
+#define SYSCTL_INT(...)
+#define SYSCTL_ULONG(...)
#ifdef TUNABLE_INT
#undef TUNABLE_INT
+#undef TUNABLE_ULONG
#endif
#define TUNABLE_INT(...)
+#define TUNABLE_ULONG(...)
/* Errors */
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
index 5b37d08f2471..f3d7ee63ebb1 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
@@ -152,7 +152,6 @@ static int arc_dead;
*/
u_long zfs_arc_max;
u_long zfs_arc_min;
-#ifdef _KERNEL
TUNABLE_ULONG("vfs.zfs.arc_max", &zfs_arc_max);
TUNABLE_ULONG("vfs.zfs.arc_min", &zfs_arc_min);
SYSCTL_DECL(_vfs_zfs);
@@ -160,7 +159,6 @@ SYSCTL_ULONG(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RD, &zfs_arc_max, 0,
"Maximum ARC size");
SYSCTL_ULONG(_vfs_zfs, OID_AUTO, arc_min, CTLFLAG_RD, &zfs_arc_min, 0,
"Minimum ARC size");
-#endif
/*
* Note that buffers can be on one of 5 states:
@@ -2684,9 +2682,9 @@ arc_tempreserve_space(uint64_t tempreserve)
return (0);
}
+static kmutex_t arc_lowmem_lock;
#ifdef _KERNEL
static eventhandler_tag arc_event_lowmem = NULL;
-static kmutex_t arc_lowmem_lock;
static void
arc_lowmem(void *arg __unused, int howto __unused)
@@ -2707,9 +2705,7 @@ arc_init(void)
{
mutex_init(&arc_reclaim_thr_lock, NULL, MUTEX_DEFAULT, NULL);
cv_init(&arc_reclaim_thr_cv, NULL, CV_DEFAULT, NULL);
-#ifdef _KERNEL
mutex_init(&arc_lowmem_lock, NULL, MUTEX_DEFAULT, NULL);
-#endif
/* Convert seconds to clock ticks */
arc_min_prefetch_lifespan = 1 * hz;
@@ -2853,9 +2849,9 @@ arc_fini(void)
buf_fini();
+ mutex_destroy(&arc_lowmem_lock);
#ifdef _KERNEL
if (arc_event_lowmem != NULL)
EVENTHANDLER_DEREGISTER(vm_lowmem, arc_event_lowmem);
- mutex_destroy(&arc_lowmem_lock);
#endif
}
diff --git a/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c
index 5b37d08f2471..f3d7ee63ebb1 100644
--- a/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c
+++ b/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c
@@ -152,7 +152,6 @@ static int arc_dead;
*/
u_long zfs_arc_max;
u_long zfs_arc_min;
-#ifdef _KERNEL
TUNABLE_ULONG("vfs.zfs.arc_max", &zfs_arc_max);
TUNABLE_ULONG("vfs.zfs.arc_min", &zfs_arc_min);
SYSCTL_DECL(_vfs_zfs);
@@ -160,7 +159,6 @@ SYSCTL_ULONG(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RD, &zfs_arc_max, 0,
"Maximum ARC size");
SYSCTL_ULONG(_vfs_zfs, OID_AUTO, arc_min, CTLFLAG_RD, &zfs_arc_min, 0,
"Minimum ARC size");
-#endif
/*
* Note that buffers can be on one of 5 states:
@@ -2684,9 +2682,9 @@ arc_tempreserve_space(uint64_t tempreserve)
return (0);
}
+static kmutex_t arc_lowmem_lock;
#ifdef _KERNEL
static eventhandler_tag arc_event_lowmem = NULL;
-static kmutex_t arc_lowmem_lock;
static void
arc_lowmem(void *arg __unused, int howto __unused)
@@ -2707,9 +2705,7 @@ arc_init(void)
{
mutex_init(&arc_reclaim_thr_lock, NULL, MUTEX_DEFAULT, NULL);
cv_init(&arc_reclaim_thr_cv, NULL, CV_DEFAULT, NULL);
-#ifdef _KERNEL
mutex_init(&arc_lowmem_lock, NULL, MUTEX_DEFAULT, NULL);
-#endif
/* Convert seconds to clock ticks */
arc_min_prefetch_lifespan = 1 * hz;
@@ -2853,9 +2849,9 @@ arc_fini(void)
buf_fini();
+ mutex_destroy(&arc_lowmem_lock);
#ifdef _KERNEL
if (arc_event_lowmem != NULL)
EVENTHANDLER_DEREGISTER(vm_lowmem, arc_event_lowmem);
- mutex_destroy(&arc_lowmem_lock);
#endif
}