diff options
author | Artur Paszkiewicz <artur.paszkiewicz@intel.com> | 2017-03-09 12:00:02 +0300 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-03-17 02:55:56 +0300 |
commit | 6358c239d88c751a9f14152a8d4ad2b69f5be48f (patch) | |
tree | 624a99ba683e1ee7115b2e0c5ac9845436524a09 /drivers/md/raid5-log.h | |
parent | 4536bf9ba2d03404655586b07f8830b6f2106242 (diff) | |
download | linux-6358c239d88c751a9f14152a8d4ad2b69f5be48f.tar.xz |
raid5-ppl: support disk hot add/remove with PPL
Add a function to modify the log by removing an rdev when a drive fails
or adding when a spare/replacement is activated as a raid member.
Removing a disk just clears the child log rdev pointer. No new stripes
will be accepted for this child log in ppl_write_stripe() and running io
units will be processed without writing PPL to the device.
Adding a disk sets the child log rdev pointer and writes an empty PPL
header.
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid5-log.h')
-rw-r--r-- | drivers/md/raid5-log.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/md/raid5-log.h b/drivers/md/raid5-log.h index a67fb58513b9..4f5a0f4e0b1f 100644 --- a/drivers/md/raid5-log.h +++ b/drivers/md/raid5-log.h @@ -39,6 +39,7 @@ extern void ppl_exit_log(struct r5conf *conf); extern int ppl_write_stripe(struct r5conf *conf, struct stripe_head *sh); extern void ppl_write_stripe_run(struct r5conf *conf); extern void ppl_stripe_write_finished(struct stripe_head *sh); +extern int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add); static inline bool raid5_has_ppl(struct r5conf *conf) { @@ -102,4 +103,12 @@ static inline int log_init(struct r5conf *conf, struct md_rdev *journal_dev) return 0; } +static inline int log_modify(struct r5conf *conf, struct md_rdev *rdev, bool add) +{ + if (raid5_has_ppl(conf)) + return ppl_modify_log(conf, rdev, add); + + return 0; +} + #endif |