raid5-ppl.c (94568f64af50bb37c418b200449698cfe7e1da5f) | raid5-ppl.c (845b9e229fe0716ab6b4d94b4364c99069667b59) |
---|---|
1/* 2 * Partial Parity Log for closing the RAID5 write hole 3 * Copyright (c) 2017, Intel Corporation. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms and conditions of the GNU General Public License, 7 * version 2, as published by the Free Software Foundation. 8 * --- 314 unchanged lines hidden (view full) --- 323} 324 325int ppl_write_stripe(struct r5conf *conf, struct stripe_head *sh) 326{ 327 struct ppl_conf *ppl_conf = conf->log_private; 328 struct ppl_io_unit *io = sh->ppl_io; 329 struct ppl_log *log; 330 | 1/* 2 * Partial Parity Log for closing the RAID5 write hole 3 * Copyright (c) 2017, Intel Corporation. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms and conditions of the GNU General Public License, 7 * version 2, as published by the Free Software Foundation. 8 * --- 314 unchanged lines hidden (view full) --- 323} 324 325int ppl_write_stripe(struct r5conf *conf, struct stripe_head *sh) 326{ 327 struct ppl_conf *ppl_conf = conf->log_private; 328 struct ppl_io_unit *io = sh->ppl_io; 329 struct ppl_log *log; 330 |
331 if (io || test_bit(STRIPE_SYNCING, &sh->state) || | 331 if (io || test_bit(STRIPE_SYNCING, &sh->state) || !sh->ppl_page || |
332 !test_bit(R5_Wantwrite, &sh->dev[sh->pd_idx].flags) || 333 !test_bit(R5_Insync, &sh->dev[sh->pd_idx].flags)) { 334 clear_bit(STRIPE_LOG_TRAPPED, &sh->state); 335 return -EAGAIN; 336 } 337 338 log = &ppl_conf->child_logs[sh->pd_idx]; 339 --- 859 unchanged lines hidden (view full) --- 1199 set_bit(MD_SB_CHANGE_CLEAN, &mddev->sb_flags); 1200 } else if (mddev->pers && ppl_conf->mismatch_count > 0) { 1201 /* no mismatch allowed when enabling PPL for a running array */ 1202 ret = -EINVAL; 1203 goto err; 1204 } 1205 1206 conf->log_private = ppl_conf; | 332 !test_bit(R5_Wantwrite, &sh->dev[sh->pd_idx].flags) || 333 !test_bit(R5_Insync, &sh->dev[sh->pd_idx].flags)) { 334 clear_bit(STRIPE_LOG_TRAPPED, &sh->state); 335 return -EAGAIN; 336 } 337 338 log = &ppl_conf->child_logs[sh->pd_idx]; 339 --- 859 unchanged lines hidden (view full) --- 1199 set_bit(MD_SB_CHANGE_CLEAN, &mddev->sb_flags); 1200 } else if (mddev->pers && ppl_conf->mismatch_count > 0) { 1201 /* no mismatch allowed when enabling PPL for a running array */ 1202 ret = -EINVAL; 1203 goto err; 1204 } 1205 1206 conf->log_private = ppl_conf; |
1207 set_bit(MD_HAS_PPL, &ppl_conf->mddev->flags); |
|
1207 1208 return 0; 1209err: 1210 __ppl_exit_log(ppl_conf); 1211 return ret; 1212} 1213 1214int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add) --- 35 unchanged lines hidden --- | 1208 1209 return 0; 1210err: 1211 __ppl_exit_log(ppl_conf); 1212 return ret; 1213} 1214 1215int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add) --- 35 unchanged lines hidden --- |