Commit Graph

9 Commits (5a9a28151be12d2650c00c6ce881ca215de2e176)

Author SHA1 Message Date
Ayan George bd47d8efe1
fix: Type-convert fs.Bavail for portability (#19816)
Prior to this patch, DiskUsage() would calculate bytes available
by multiplying blocks available by block size in bytes:

  disk.Avail = fs.Bavail * uint64(fs.Bsize)

Under some versions of Unix, fs.Bavail is of type uint64 and on
others (like FreeBSD) it is of type int64.

This causes a compile time error:

  $ go build
  # github.com/influxdata/influxdb/v2/pkg/fs
  ./fs_unix.go:81:25: invalid operation: fs.Bavail * uint64(fs.Bsize) (mismatched types int64 and uint64)

This patch type-converts fs.Bavail to unit64 to ensure that all
types in the expression align.

This prevents compile time errors under FreeBSD and other platforms
where fs.Bavail isn't uint64.
2020-10-26 05:32:04 -04:00
vlastahajek 8763bb1af9 feat(upgrade): upgrade databases 2020-10-08 09:39:30 -07:00
vlastahajek b5afed5201 fix(compile): Making influxd compilable on Windows 2020-09-07 15:10:49 +02:00
Jonathan A. Sternberg 0ae8bebd75
refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
Max U 6bf821f5f6 test(fs_test): update readability of fs API tests 2019-07-25 10:09:52 -07:00
Max U 39f51969e9 replaced os.Create calls w API calls to fs.CreateFile, includes unit test 2019-07-08 13:01:42 -04:00
Edd Robinson 9fcf27a25b Add safe rename functions at fs level 2019-02-12 12:41:27 +00:00
Edd Robinson 0858b2570d Rename --> RenameFileWithReplacement for clarity 2019-02-12 12:41:10 +00:00
Edd Robinson bd8a167a3e Rename file package to fs 2019-02-12 11:24:11 +00:00