mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Conditionalize code which defines sysctls per _KERNEL #ifdef guard
This resolves several issues when compiling libzpool (userspace library), i.e. -Wimplicit-function-declaration and -Wmissing-declarations issues. MFC after: 2 weeks Reported by: clang Tested with: clang 3.8.1, gcc 4.2.1, gcc 5.3.0 Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
d36b43fc49
commit
4fcae4df7e
2 changed files with 14 additions and 0 deletions
|
|
@ -58,9 +58,11 @@ typedef struct mirror_map {
|
|||
|
||||
static int vdev_mirror_shift = 21;
|
||||
|
||||
#ifdef _KERNEL
|
||||
SYSCTL_DECL(_vfs_zfs_vdev);
|
||||
static SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, mirror, CTLFLAG_RD, 0,
|
||||
"ZFS VDEV Mirror");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The load configuration settings below are tuned by default for
|
||||
|
|
@ -74,28 +76,38 @@ static SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, mirror, CTLFLAG_RD, 0,
|
|||
|
||||
/* Rotating media load calculation configuration. */
|
||||
static int rotating_inc = 0;
|
||||
#ifdef _KERNEL
|
||||
SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_inc, CTLFLAG_RWTUN,
|
||||
&rotating_inc, 0, "Rotating media load increment for non-seeking I/O's");
|
||||
#endif
|
||||
|
||||
static int rotating_seek_inc = 5;
|
||||
#ifdef _KERNEL
|
||||
SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_inc, CTLFLAG_RWTUN,
|
||||
&rotating_seek_inc, 0, "Rotating media load increment for seeking I/O's");
|
||||
#endif
|
||||
|
||||
static int rotating_seek_offset = 1 * 1024 * 1024;
|
||||
#ifdef _KERNEL
|
||||
SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_offset, CTLFLAG_RWTUN,
|
||||
&rotating_seek_offset, 0, "Offset in bytes from the last I/O which "
|
||||
"triggers a reduced rotating media seek increment");
|
||||
#endif
|
||||
|
||||
/* Non-rotating media load calculation configuration. */
|
||||
static int non_rotating_inc = 0;
|
||||
#ifdef _KERNEL
|
||||
SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_inc, CTLFLAG_RWTUN,
|
||||
&non_rotating_inc, 0,
|
||||
"Non-rotating media load increment for non-seeking I/O's");
|
||||
#endif
|
||||
|
||||
static int non_rotating_seek_inc = 1;
|
||||
#ifdef _KERNEL
|
||||
SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_seek_inc, CTLFLAG_RWTUN,
|
||||
&non_rotating_seek_inc, 0,
|
||||
"Non-rotating media load increment for seeking I/O's");
|
||||
#endif
|
||||
|
||||
|
||||
static inline size_t
|
||||
|
|
|
|||
|
|
@ -176,6 +176,7 @@ int zfs_vdev_read_gap_limit = 32 << 10;
|
|||
int zfs_vdev_write_gap_limit = 4 << 10;
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#ifdef _KERNEL
|
||||
SYSCTL_DECL(_vfs_zfs_vdev);
|
||||
|
||||
static int sysctl_zfs_async_write_active_min_dirty_percent(SYSCTL_HANDLER_ARGS);
|
||||
|
|
@ -271,6 +272,7 @@ sysctl_zfs_async_write_active_max_dirty_percent(SYSCTL_HANDLER_ARGS)
|
|||
return (0);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int
|
||||
vdev_queue_offset_compare(const void *x1, const void *x2)
|
||||
|
|
|
|||
Loading…
Reference in a new issue