浏览代码

fix(btrfs): build btrfs based on platform

Yicheng Qin 11 年之前
父节点
当前提交
7bf1936df3
共有 2 个文件被更改,包括 19 次插入0 次删除
  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
 
 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")
+}