Browse Source

fix(btrfs): build btrfs based on platform

Yicheng Qin 11 years ago
parent
commit
7bf1936df3
2 changed files with 19 additions and 0 deletions
  1. 2 0
      pkg/btrfs/btrfs_linux.go
  2. 17 0
      pkg/btrfs/btrfs_stubs.go

+ 2 - 0
pkg/btrfs/btrfs.go → pkg/btrfs/btrfs_linux.go

@@ -1,3 +1,5 @@
+// +build linux,amd64
+
 package btrfs
 package btrfs
 
 
 import (
 import (

+ 17 - 0
pkg/btrfs/btrfs_stubs.go

@@ -0,0 +1,17 @@
+// +build !linux !amd64
+
+package btrfs
+
+import (
+	"fmt"
+)
+
+// IsBtrfs checks whether the file is in btrfs
+func IsBtrfs(path string) bool {
+	return false
+}
+
+// SetNOCOWFile sets NOCOW flag for file
+func SetNOCOWFile(path string) error {
+	return fmt.Errorf("unsupported for the platform")
+}