diff options
author | Ayush Ranjan <ayushranjan@google.com> | 2019-07-29 18:32:45 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-07-29 18:33:55 -0700 |
commit | b765eb45894ea426d2c6d167b6ceb662db6ff4d2 (patch) | |
tree | 1dada0a548d86e6b34b01717a9f116a652d396da /pkg/sentry/fs/ext/utils.go | |
parent | a3e9031e665e5707ff1d181a577a808ff6d67452 (diff) |
ext: inode implementations.
PiperOrigin-RevId: 260624470
Diffstat (limited to 'pkg/sentry/fs/ext/utils.go')
-rw-r--r-- | pkg/sentry/fs/ext/utils.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/pkg/sentry/fs/ext/utils.go b/pkg/sentry/fs/ext/utils.go index 3472c5fa8..8790c7778 100644 --- a/pkg/sentry/fs/ext/utils.go +++ b/pkg/sentry/fs/ext/utils.go @@ -76,12 +76,7 @@ func blockGroupsCount(sb disklayout.SuperBlock) uint64 { blocksPerGroup := uint64(sb.BlocksPerGroup()) // Round up the result. float64 can compromise precision so do it manually. - bgCount := blocksCount / blocksPerGroup - if blocksCount%blocksPerGroup != 0 { - bgCount++ - } - - return bgCount + return (blocksCount + blocksPerGroup - 1) / blocksPerGroup } // readBlockGroups reads the block group descriptor table from block group 0 in |