コード例 #1
0
ファイル: disks_raid_graid5.php プロジェクト: sdoney/nas4free
function graid5_process_updatenotification($mode, $data)
{
    global $config;
    $retval = 0;
    switch ($mode) {
        case UPDATENOTIFY_MODE_NEW:
            $retval |= rc_exec_service("geom load raid5");
            $retval |= rc_exec_service("geom tune raid5");
            $retval |= disks_raid_graid5_configure($data);
            break;
        case UPDATENOTIFY_MODE_MODIFIED:
            $retval |= rc_exec_service("geom start raid5");
            break;
        case UPDATENOTIFY_MODE_DIRTY:
            $retval |= disks_raid_graid5_delete($data);
            if (is_array($config['graid5']['vdisk'])) {
                $index = array_search_ex($data, $config['graid5']['vdisk'], "uuid");
                if (false !== $index) {
                    unset($config['graid5']['vdisk'][$index]);
                    write_config();
                }
            }
            break;
    }
    return $retval;
}
コード例 #2
0
    if (is_array($error_bucket)) {
        foreach ($error_bucket as $elem) {
            $input_errors[] =& $elem["error"];
        }
    }
    /* if this is an AJAX caller then handle via JSON */
    if (isAjax() && is_array($error_bucket)) {
        input_errors2Ajax(NULL, $error_bucket);
        exit;
    }
    if ($_POST['apply']) {
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            /* reload all components that create raid device */
            disks_raid_graid5_configure();
            config_unlock();
            write_config();
        }
        $savemsg = get_std_save_message($retval);
        if ($retval == 0) {
            if (file_exists($d_raidconfdirty_path)) {
                unlink($d_raidconfdirty_path);
            }
        }
    }
}
if ($_GET['act'] == "del") {
    if ($a_raid[$_GET['id']]) {
        $raidname = $a_raid[$_GET['id']]['name'];
        disks_raid_graid5_delete($raidname);