diff --git a/mount/mount.go b/mount/mount.go index 24bfc7d01..ae7520f98 100644 --- a/mount/mount.go +++ b/mount/mount.go @@ -68,6 +68,17 @@ func UnmountMounts(mounts []Mount, target string, flags int) error { return nil } +// ReadOnly returns a boolean value indicating whether this mount has the "ro" +// option set. +func (m *Mount) ReadOnly() bool { + for _, option := range m.Options { + if option == "ro" { + return true + } + } + return false +} + // Mount to the provided target path. func (m *Mount) Mount(target string) error { target, err := fs.RootPath(target, m.Target) diff --git a/mount/mount_windows.go b/mount/mount_windows.go index e7d5a5113..b86ba0d7a 100644 --- a/mount/mount_windows.go +++ b/mount/mount_windows.go @@ -38,15 +38,6 @@ var ( ErrNotImplementOnWindows = errors.New("not implemented under windows") ) -func (m *Mount) ReadOnly() bool { - for _, option := range m.Options { - if option == "ro" { - return true - } - } - return false -} - // Mount to the provided target. func (m *Mount) mount(target string) (retErr error) { if m.Type != "windows-layer" {