Fix special memparse case for maximumInodes value

feature/node-rewrite
Sven Slootweg 6 years ago
parent 7244a506ae
commit 82e7227f91

@ -0,0 +1,9 @@
"use strict";
const parseIECBytes = require("./bytes/iec");
/* NOTE: This parsing module is for a special case; values that are normally handled using the Linux kernel's `memparse` function (which parses memory suffixes like K, M, G, etc.) but that do *not* semantically represent bytes. */
module.exports = function parseMemparseValue(value) {
return parseIECBytes(value).toB().amount;
};

@ -7,6 +7,7 @@ const {minutes, seconds, microseconds} = require("../units/time");
const mapValue = require("../map-value");
const parseOctalMode = require("./octal-mode");
const parseIECBytes = require("./bytes/iec");
const parseMemparseValue = require("./memparse");
const matchOrError = require("../match-or-error");
let Value = (value) => value;
@ -381,7 +382,7 @@ let mountOptionMap = {
return { minimumSize: parseIECBytes(value) };
}
},
nr_inodes: { maximumInodes: (value) => parseIECBytes(value) },
nr_inodes: { maximumInodes: (value) => parseMemparseValue(value) },
},
cgroup: {
/* TODO */

Loading…
Cancel
Save