Merge pull request #11417 from rhatdan/btrfs

Btrfs has eliminated the BTRFS_BUILD_VERSION in latest version
This commit is contained in:
Vincent Batts 2015-03-24 16:00:15 -04:00
commit 8fc9e40086
4 changed files with 4 additions and 13 deletions

View file

@ -61,9 +61,6 @@ func (d *Driver) String() string {
func (d *Driver) Status() [][2]string {
status := [][2]string{}
if bv := BtrfsBuildVersion(); bv != "-" {
status = append(status, [2]string{"Build Version", bv})
}
if lv := BtrfsLibVersion(); lv != -1 {
status = append(status, [2]string{"Library Version", fmt.Sprintf("%d", lv)})
}

View file

@ -16,9 +16,6 @@ int my_btrfs_lib_version() {
*/
import "C"
func BtrfsBuildVersion() string {
return string(C.BTRFS_BUILD_VERSION)
}
func BtrfsLibVersion() int {
return int(C.BTRFS_LIB_VERSION)
}

View file

@ -5,9 +5,6 @@ package btrfs
// TODO(vbatts) remove this work-around once supported linux distros are on
// btrfs utililties of >= 3.16.1
func BtrfsBuildVersion() string {
return "-"
}
func BtrfsLibVersion() int {
return -1
}

View file

@ -1,4 +1,4 @@
// +build linux
// +build linux,!btrfs_noversion
package btrfs
@ -6,8 +6,8 @@ import (
"testing"
)
func TestBuildVersion(t *testing.T) {
if len(BtrfsBuildVersion()) == 0 {
t.Errorf("expected output from btrfs build version, but got empty string")
func TestLibVersion(t *testing.T) {
if BtrfsLibVersion() <= 0 {
t.Errorf("expected output from btrfs lib version > 0")
}
}