devicemapper

package
v0.23.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2016 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package devicemapper contains code for working with devicemapper

Copyright 2016 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DmsetupClient

type DmsetupClient interface {
	Table(deviceName string) ([]byte, error)
	Message(deviceName string, sector int, message string) ([]byte, error)
	Status(deviceName string) ([]byte, error)
}

DmsetupClient is a low-level client for interacting with devicemapper via the dmsetup utility.

func NewDmsetupClient

func NewDmsetupClient() DmsetupClient

type ThinPoolWatcher

type ThinPoolWatcher struct {
	// contains filtered or unexported fields
}

ThinPoolWatcher maintains a cache of device name -> usage stats for a devicemapper thin-pool using thin_ls.

func NewThinPoolWatcher

func NewThinPoolWatcher(poolName, metadataDevice string) *ThinPoolWatcher

NewThinPoolWatcher returns a new ThinPoolWatcher for the given devicemapper thin pool name and metadata device.

func (*ThinPoolWatcher) GetUsage

func (w *ThinPoolWatcher) GetUsage(deviceId string) (uint64, error)

GetUsage gets the cached usage value of the given device.

func (*ThinPoolWatcher) Refresh

func (w *ThinPoolWatcher) Refresh() error

Refresh performs a `thin_ls` of the pool being watched and refreshes the cached data with the result.

func (*ThinPoolWatcher) Start

func (w *ThinPoolWatcher) Start()

Start starts the thin pool watcher.

func (*ThinPoolWatcher) Stop

func (w *ThinPoolWatcher) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL