summaryrefslogtreecommitdiff
path: root/kernel-lib/raid56.h
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2017-05-25 14:21:50 +0800
committerDavid Sterba <dsterba@suse.com>2017-07-03 13:35:11 +0200
commit05734124f2cf616d94d7f2640351bc0272b1a8d0 (patch)
tree9afee5fc29273aace6aee1c9f0d4c8781ee602e3 /kernel-lib/raid56.h
parent008bbd88420390fd83de41baa6b17a7d7d5b92de (diff)
btrfs-progs: Introduce wrapper to recover raid56 data
Introduce a wrapper to recover raid56 data. The logical is the same with kernel one, but with different interfaces, since kernel ones cares the performance while in btrfs we don't care that much. And the interface is more caller friendly inside btrfs-progs. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'kernel-lib/raid56.h')
-rw-r--r--kernel-lib/raid56.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel-lib/raid56.h b/kernel-lib/raid56.h
index 39d43792..56d13f81 100644
--- a/kernel-lib/raid56.h
+++ b/kernel-lib/raid56.h
@@ -44,4 +44,15 @@ int raid6_recov_data2(int nr_devs, size_t stripe_len, int dest1, int dest2,
/* Recover data and P */
int raid6_recov_datap(int nr_devs, size_t stripe_len, int dest1, void **data);
+/*
+ * Recover raid56 data
+ * @dest1/2 can be -1 to indicate correct data
+ *
+ * Return >0 for unrecoverable case.
+ * Return 0 for recoverable case, And recovered data will be stored into @data
+ * Return <0 for fatal error
+ */
+int raid56_recov(int nr_devs, size_t stripe_len, u64 profile, int dest1,
+ int dest2, void **data);
+
#endif