浏览代码

adapt overlay_usage to match the comments from luebeck

ohrensessel 10 年之前
父节点
当前提交
4d747c09c4
共有 1 个文件被更改,包括 1 次插入5 次删除
  1. 1 5
      package/gluon-announce/files/lib/gluon/announce/statistics.d/overlay_usage

+ 1 - 5
package/gluon-announce/files/lib/gluon/announce/statistics.d/overlay_usage

@@ -2,8 +2,4 @@ local fs = require "nixio.fs"
 local opkg = require "luci.model.ipkg"
 
 local st = fs.statvfs(opkg.overlay_root())
-local blocks = st.blockss or 0
-local bfree = st.bfree or 0
-local used = ((blocks - bfree) / blocks)
-
-return math.floor(used * 1000 + 0.5) / 1000
+return 1 - st.bfree / st.blocks