summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2014-04-17 20:19:29 +0000
committerErmal <eri@pfsense.org>2014-04-17 20:19:29 +0000
commit302c005e1123add037411c30e035d5d715b51424 (patch)
tree2df66b151c74336525e20d386aede94938dac8cf /etc/inc
parentc93f46fea402a3d593e0418d8105948beabfca38 (diff)
downloadpfsense-302c005e1123add037411c30e035d5d715b51424.zip
pfsense-302c005e1123add037411c30e035d5d715b51424.tar.gz
Unload the ZFS module if its not in use to not consume uselss memory
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/util.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 28c0120..7f2c4ab 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -297,8 +297,10 @@ function refcount_read($reference) {
}
function is_module_loaded($module_name) {
- $running = `/sbin/kldstat | grep {$module_name} | /usr/bin/grep -v grep | /usr/bin/wc -l`;
- if (intval($running) >= 1)
+ $module_name = str_replace(".ko", "", $module_name);
+ $running = 0;
+ $_gb = exec("/sbin/kldstat -qm {$module_name}", $_gb, $running);
+ if (!intval($running) == 0)
return true;
else
return false;
OpenPOWER on IntegriCloud