X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/b7cf97c0e1a5a1761b33fc8fc8f44aaedad4c46e..990e1baf97b94ad3ffa8bc587241369bd73c607e:/src/Dataset.php diff --git a/src/Dataset.php b/src/Dataset.php index db3a165..57e8edd 100644 --- a/src/Dataset.php +++ b/src/Dataset.php @@ -18,7 +18,8 @@ class OMVModuleZFSDataset { * @access private */ private $name; - /** + + /** * Mountpoint of the Dataset * * @var string $mountPoint @@ -179,6 +180,42 @@ class OMVModuleZFSDataset { $this->updateProperty($property); } + /** + * Upgrades the Dataset to latest filesystem version + * + * @return void + * @access public + */ + public function upgrade() { + $cmd = "zfs upgrade " . $this->name . " 2>&1"; + $this->exec($cmd,$out,$res); + } + + /** + * Mount the Dataset + * + * @return void + * @access public + */ + public function mount() { + $cmd = "zfs mount " . $this->name . " 2>&1"; + $this->exec($cmd,$out,$res); + $this->updateProperty("mounted"); + } + + /** + * Unmount the Dataset + * + * @return void + * @access public + */ + public function unmount() { + $cmd = "zfs unmount " . $this->name . " 2>&1"; + $this->exec($cmd,$out,$res); + $this->updateProperty("mounted"); + } + + /** * Helper function to execute a command and throw an exception on error * (requires stderr redirected to stdout for proper exception message).