- $pooluuid = OMVModuleZFSUtil::getUUIDbyName($params['name']);
- preg_match('/^([A-Za-z0-9]+)\/?.*$/', $params['name'], $result);
- $poolname = $result[1];
- unset($result);
-
- //Check if the UUID is already stored as an mntent object. If it isn't then create it.
- $xpath = "//system/fstab/mntent[fsname=" . $pooluuid . "]";
- $object = $xmlConfig->get($xpath);
- if(is_null($object)) {
- $uuid = OMVUtil::uuid();
- $ds = new OMVModuleZFSDataset($poolname);
- $dir = $ds->getMountPoint();
- $object = array(
- "uuid" => $uuid,
- "fsname" => $pooluuid,
- "dir" => $dir,
- "type" => "zfs",
- "opts" => "rw,relatime,xattr",
- "freq" => "0",
- "passno" => "2"
- );
- $xmlConfig->set("//system/fstab",array("mntent" => $object));
- $dispatcher = &OMVNotifyDispatcher::getInstance();
- $dispatcher->notify(OMV_NOTIFY_CREATE,"org.openmediavault.system.fstab.mntent", $object);
- }
+ $poolname = OMVModuleZFSUtil::getPoolname($params['name']);
+ $pooluuid = OMVModuleZFSUtil::getUUIDbyName($poolname);