瀏覽代碼

Rename overlayfs to overlay

Since Linux 3.18-rc6, overlayfs has been renamed overlay.

This change was introduced by the following commit in linux.git:
ef94b1864d1ed5be54376404bb23d22ed0481feb ovl: rename filesystem type to "overlay"

Signed-off-by: Lénaïc Huard <lhuard@amadeus.com>
Lénaïc Huard 10 年之前
父節點
當前提交
c57317893a
共有 2 個文件被更改,包括 5 次插入6 次删除
  1. 1 1
      contrib/check-config.sh
  2. 4 5
      daemon/graphdriver/overlayfs/overlayfs.go

+ 1 - 1
contrib/check-config.sh

@@ -166,7 +166,7 @@ echo '- Storage Drivers:'
 	check_flags BLK_DEV_DM DM_THIN_PROVISIONING EXT4_FS EXT4_FS_POSIX_ACL EXT4_FS_SECURITY | sed 's/^/  /'
 
 	echo '- "'$(wrap_color 'overlayfs' blue)'":'
-	check_flags OVERLAYFS_FS | sed 's/^/  /'
+	check_flags OVERLAY_FS | sed 's/^/  /'
 } | sed 's/^/  /'
 echo
 

+ 4 - 5
daemon/graphdriver/overlayfs/overlayfs.go

@@ -9,7 +9,6 @@ import (
 	"os"
 	"os/exec"
 	"path"
-	"strings"
 	"sync"
 	"syscall"
 
@@ -115,7 +114,7 @@ func Init(home string, options []string) (graphdriver.Driver, error) {
 func supportsOverlayfs() error {
 	// We can try to modprobe overlayfs first before looking at
 	// proc/filesystems for when overlayfs is supported
-	exec.Command("modprobe", "overlayfs").Run()
+	exec.Command("modprobe", "overlay").Run()
 
 	f, err := os.Open("/proc/filesystems")
 	if err != nil {
@@ -125,11 +124,11 @@ func supportsOverlayfs() error {
 
 	s := bufio.NewScanner(f)
 	for s.Scan() {
-		if strings.Contains(s.Text(), "overlayfs") {
+		if s.Text() == "nodev\toverlay" {
 			return nil
 		}
 	}
-	log.Error("'overlayfs' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlayfs support loaded.")
+	log.Error("'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.")
 	return graphdriver.ErrNotSupported
 }
 
@@ -274,7 +273,7 @@ func (d *Driver) Get(id string, mountLabel string) (string, error) {
 	mergedDir := path.Join(dir, "merged")
 
 	opts := fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", lowerDir, upperDir, workDir)
-	if err := syscall.Mount("overlayfs", mergedDir, "overlayfs", 0, label.FormatMountLabel(opts, mountLabel)); err != nil {
+	if err := syscall.Mount("overlay", mergedDir, "overlay", 0, label.FormatMountLabel(opts, mountLabel)); err != nil {
 		return "", err
 	}
 	mount.path = mergedDir