Skip to content

Commit 4536f13

Browse files
robnbehlendorf
authored andcommitted
tunables: ensure tunable and variable have same define gate
If a variable is only available in the kernel, then the tunable should also only be available there. This matters very little so long as we don't have userspace tunables, but its still good hygeine. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Pavel Snajdr <snajpa@snajpa.net> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #17377
1 parent d1c3c44 commit 4536f13

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

module/zfs/arc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ static int zfs_arc_overflow_shift = 8;
382382
/* log2(fraction of arc to reclaim) */
383383
uint_t arc_shrink_shift = 7;
384384

385-
/* percent of pagecache to reclaim arc to */
386385
#ifdef _KERNEL
386+
/* percent of pagecache to reclaim arc to */
387387
uint_t zfs_arc_pc_percent = 0;
388388
#endif
389389

@@ -10829,8 +10829,10 @@ ZFS_MODULE_PARAM_CALL(zfs_arc, zfs_arc_, grow_retry, param_set_arc_int,
1082910829
ZFS_MODULE_PARAM_CALL(zfs_arc, zfs_arc_, shrink_shift, param_set_arc_int,
1083010830
param_get_uint, ZMOD_RW, "log2(fraction of ARC to reclaim)");
1083110831

10832+
#ifdef _KERNEL
1083210833
ZFS_MODULE_PARAM(zfs_arc, zfs_arc_, pc_percent, UINT, ZMOD_RW,
1083310834
"Percent of pagecache to reclaim ARC to");
10835+
#endif
1083410836

1083510837
ZFS_MODULE_PARAM(zfs_arc, zfs_arc_, average_blocksize, UINT, ZMOD_RD,
1083610838
"Target average block size");

module/zfs/fm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,8 @@ fm_fini(void)
13681368
fm_ksp = NULL;
13691369
}
13701370
}
1371-
#endif /* _KERNEL */
13721371

13731372
ZFS_MODULE_PARAM(zfs_zevent, zfs_zevent_, len_max, UINT, ZMOD_RW,
13741373
"Max event queue length");
1374+
1375+
#endif /* _KERNEL */

module/zfs/spa_config.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,5 +635,7 @@ ZFS_MODULE_PARAM(zfs_spa, spa_, config_path, STRING, ZMOD_RD,
635635
"SPA config file (/etc/zfs/zpool.cache)");
636636
#endif
637637

638+
#ifdef _KERNEL
638639
ZFS_MODULE_PARAM(zfs, zfs_, autoimport_disable, INT, ZMOD_RW,
639640
"Disable pool import at module load");
641+
#endif

0 commit comments

Comments
 (0)