Add the fix command

Split in various files
Add --force switch
Add --start switch
This commit is contained in:
Andrea Mazzoleni 2011-03-04 20:59:21 +01:00
parent 8e953adb27
commit 4bd4f9dd79
16 changed files with 2335 additions and 1532 deletions

40
parity.h Normal file
View file

@ -0,0 +1,40 @@
/*
* Copyright (C) 2011 Andrea Mazzoleni
*
* This program is free software: you can redistribute it and/or modify
* 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __PARITY_H
#define __PARITY_H
/****************************************************************************/
/* parity */
/**
* Computes the size of the parity data in number of blocks.
*/
pos_t parity_resize(struct snapraid_state* state);
int parity_create(const char* path, off_t size);
int parity_open(int ret_on_error, const char* path);
void parity_close(const char* path, int f);
void parity_write(const char* parity_path, int parity_f, pos_t pos, unsigned char* block_buffer, unsigned block_size);
int parity_read(int ret_on_error, const char* parity_path, int parity_f, pos_t pos, unsigned char* block_buffer, unsigned block_size);
#endif