aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid5.h')
-rw-r--r--drivers/md/raid5.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
index ffc13c4d7e63..c9590a8e1425 100644
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -264,6 +264,7 @@ struct stripe_head_state {
264 int syncing, expanding, expanded, replacing; 264 int syncing, expanding, expanded, replacing;
265 int locked, uptodate, to_read, to_write, failed, written; 265 int locked, uptodate, to_read, to_write, failed, written;
266 int to_fill, compute, req_compute, non_overwrite; 266 int to_fill, compute, req_compute, non_overwrite;
267 int injournal;
267 int failed_num[2]; 268 int failed_num[2];
268 int p_failed, q_failed; 269 int p_failed, q_failed;
269 int dec_preread_active; 270 int dec_preread_active;
@@ -313,6 +314,11 @@ enum r5dev_flags {
313 */ 314 */
314 R5_Discard, /* Discard the stripe */ 315 R5_Discard, /* Discard the stripe */
315 R5_SkipCopy, /* Don't copy data from bio to stripe cache */ 316 R5_SkipCopy, /* Don't copy data from bio to stripe cache */
317 R5_InJournal, /* data being written is in the journal device.
318 * if R5_InJournal is set for parity pd_idx, all the
319 * data and parity being written are in the journal
320 * device
321 */
316}; 322};
317 323
318/* 324/*
@@ -345,7 +351,23 @@ enum {
345 STRIPE_BITMAP_PENDING, /* Being added to bitmap, don't add 351 STRIPE_BITMAP_PENDING, /* Being added to bitmap, don't add
346 * to batch yet. 352 * to batch yet.
347 */ 353 */
348 STRIPE_LOG_TRAPPED, /* trapped into log */ 354 STRIPE_LOG_TRAPPED, /* trapped into log (see raid5-cache.c)
355 * this bit is used in two scenarios:
356 *
357 * 1. write-out phase
358 * set in first entry of r5l_write_stripe
359 * clear in second entry of r5l_write_stripe
360 * used to bypass logic in handle_stripe
361 *
362 * 2. caching phase
363 * set in r5c_try_caching_write()
364 * clear when journal write is done
365 * used to initiate r5c_cache_data()
366 * also used to bypass logic in handle_stripe
367 */
368 STRIPE_R5C_CACHING, /* the stripe is in caching phase
369 * see more detail in the raid5-cache.c
370 */
349}; 371};
350 372
351#define STRIPE_EXPAND_SYNC_FLAGS \ 373#define STRIPE_EXPAND_SYNC_FLAGS \
@@ -710,4 +732,11 @@ extern void r5l_stripe_write_finished(struct stripe_head *sh);
710extern int r5l_handle_flush_request(struct r5l_log *log, struct bio *bio); 732extern int r5l_handle_flush_request(struct r5l_log *log, struct bio *bio);
711extern void r5l_quiesce(struct r5l_log *log, int state); 733extern void r5l_quiesce(struct r5l_log *log, int state);
712extern bool r5l_log_disk_error(struct r5conf *conf); 734extern bool r5l_log_disk_error(struct r5conf *conf);
735extern bool r5c_is_writeback(struct r5l_log *log);
736extern int
737r5c_try_caching_write(struct r5conf *conf, struct stripe_head *sh,
738 struct stripe_head_state *s, int disks);
739extern void
740r5c_finish_stripe_write_out(struct r5conf *conf, struct stripe_head *sh,
741 struct stripe_head_state *s);
713#endif 742#endif