diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-28 14:05:27 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-14 19:45:07 -0600 |
commit | 8c8c6c27552f8554ba014c34d684cb90538ef65b (patch) | |
tree | f3a53ed194e29b516b52770e4949a1e508fad6a7 /lib/btrfsprogs/btrfsinspect/rebuildnodes/util.go | |
parent | 34bf167ef33c57b4d6767273f1d265971a4693b9 (diff) |
Move files around [ci-skip]
Diffstat (limited to 'lib/btrfsprogs/btrfsinspect/rebuildnodes/util.go')
-rw-r--r-- | lib/btrfsprogs/btrfsinspect/rebuildnodes/util.go | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/btrfsprogs/btrfsinspect/rebuildnodes/util.go b/lib/btrfsprogs/btrfsinspect/rebuildnodes/util.go deleted file mode 100644 index 9d91f23..0000000 --- a/lib/btrfsprogs/btrfsinspect/rebuildnodes/util.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2022 Luke Shumaker <lukeshu@lukeshu.com> -// -// SPDX-License-Identifier: GPL-2.0-or-later - -package rebuildnodes - -import ( - "golang.org/x/exp/constraints" - - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" -) - -func countNodes(nodeScanResults btrfsinspect.ScanDevicesResult) int { - var cnt int - for _, devResults := range nodeScanResults { - cnt += len(devResults.FoundNodes) - } - return cnt -} - -func roundDown[T constraints.Integer](n, d T) T { - return (n / d) * d -} - -func roundUp[T constraints.Integer](n, d T) T { - return ((n + d - 1) / d) * d -} - -func discardOK[T any](val T, _ bool) T { - return val -} |