diff options
Diffstat (limited to 'drivers/md/raid1.h')
-rw-r--r-- | drivers/md/raid1.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h index c7294e7557e0..eb84bc68e2fd 100644 --- a/drivers/md/raid1.h +++ b/drivers/md/raid1.h | |||
@@ -26,6 +26,18 @@ | |||
26 | #define BARRIER_BUCKETS_NR_BITS (PAGE_SHIFT - ilog2(sizeof(atomic_t))) | 26 | #define BARRIER_BUCKETS_NR_BITS (PAGE_SHIFT - ilog2(sizeof(atomic_t))) |
27 | #define BARRIER_BUCKETS_NR (1<<BARRIER_BUCKETS_NR_BITS) | 27 | #define BARRIER_BUCKETS_NR (1<<BARRIER_BUCKETS_NR_BITS) |
28 | 28 | ||
29 | /* Note: raid1_info.rdev can be set to NULL asynchronously by raid1_remove_disk. | ||
30 | * There are three safe ways to access raid1_info.rdev. | ||
31 | * 1/ when holding mddev->reconfig_mutex | ||
32 | * 2/ when resync/recovery is known to be happening - i.e. in code that is | ||
33 | * called as part of performing resync/recovery. | ||
34 | * 3/ while holding rcu_read_lock(), use rcu_dereference to get the pointer | ||
35 | * and if it is non-NULL, increment rdev->nr_pending before dropping the | ||
36 | * RCU lock. | ||
37 | * When .rdev is set to NULL, the nr_pending count checked again and if it has | ||
38 | * been incremented, the pointer is put back in .rdev. | ||
39 | */ | ||
40 | |||
29 | struct raid1_info { | 41 | struct raid1_info { |
30 | struct md_rdev *rdev; | 42 | struct md_rdev *rdev; |
31 | sector_t head_position; | 43 | sector_t head_position; |