snapraid/parity.h
Andrea Mazzoleni 4bd4f9dd79 Add the fix command
Split in various files
Add --force switch
Add --start switch
2011-03-04 20:59:21 +01:00

40 lines
1.3 KiB
C

/*
* 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