/* raid6_recover.c - module to recover from faulty RAID6 arrays. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
GRUB_MOD_LICENSE ("GPLv3+");
/* x**y. */
/* Such an s that x**s = y */
static void
{
int i;
grub_uint8_t *p;
p = (grub_uint8_t *) buf;
for (i = 0; i < size; i++, p++)
if (*p)
}
static void
grub_raid6_init_table (void)
{
int i;
for (i = 0; i < 255; i++)
{
if (cur & 0x80)
else
cur <<= 1;
}
}
static grub_err_t
{
int i, q, pos;
if (!pbuf)
goto quit;
if (!qbuf)
goto quit;
q = p + 1;
if (q == (int) array->total_devs)
q = 0;
pos = q + 1;
pos = 0;
{
bad1 = i;
else
{
{
}
else
{
/* Too many bad devices */
if (bad2 >= 0)
goto quit;
bad2 = i;
}
}
pos++;
pos = 0;
}
/* Invalid disknr or p */
if (bad1 < 0)
goto quit;
if (bad2 < 0)
{
/* One bad device */
{
goto quit;
}
{
goto quit;
}
goto quit;
size);
}
else
{
/* Two bad devices */
int c;
{
goto quit;
}
goto quit;
goto quit;
c = (bad2 + c) % 255;
}
quit:
return grub_errno;
}
{
}
{
}