summaryrefslogtreecommitdiff
path: root/mdadm.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-07-10 15:54:02 +1000
committerNeilBrown <neilb@suse.de>2014-07-10 15:54:02 +1000
commit5fe6f031d9a21a935f0ef1b1fbdb314b53f2199f (patch)
tree44f8fd5707a7a7ca7cde9a4abb1cf49c14e88466 /mdadm.h
parent0c21b485e4beb7bcfe631412a231f7c1ea1067bc (diff)
mdmon: allow prepare_update to report failure.
If 'prepare_update' fails for some reason there is little point continuing on to 'process_update'. For now only malloc failures are caught, but other failures will be considered in future. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/mdadm.h b/mdadm.h
index 914d67cd..02a9288d 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -929,7 +929,10 @@ extern struct superswitch {
void (*sync_metadata)(struct supertype *st);
void (*process_update)(struct supertype *st,
struct metadata_update *update);
- void (*prepare_update)(struct supertype *st,
+ /* Prepare updates allocates extra memory that might be
+ * needed. If the update cannot be understood, return 0.
+ */
+ int (*prepare_update)(struct supertype *st,
struct metadata_update *update);
/* activate_spare will check if the array is degraded and, if it