From 17999be4aa408e7ff3b9d32c735649676567a3cd Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 6 Jan 2006 00:20:12 -0800 Subject: [PATCH] md: improve raid1 "IO Barrier" concept raid1 needs to put up a barrier to new requests while it does resync or other background recovery. The code for this is currently open-coded, slighty obscure by its use of two waitqueues, and not documented. This patch gathers all the related code into 4 functions, and includes a comment which (hopefully) explains what is happening. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/raid/raid1.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/linux/raid') diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index 292b98f2b40..c5567425253 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h @@ -45,6 +45,7 @@ struct r1_private_data_s { spinlock_t resync_lock; int nr_pending; + int nr_waiting; int barrier; sector_t next_resync; int fullsync; /* set to 1 if a full sync is needed, @@ -52,8 +53,7 @@ struct r1_private_data_s { * Cleared when a sync completes. */ - wait_queue_head_t wait_idle; - wait_queue_head_t wait_resume; + wait_queue_head_t wait_barrier; struct pool_info *poolinfo; -- cgit v1.2.3