dm cache: fix device destroy hang due to improper prealloc_used accounting
[firefly-linux-kernel-4.4.55.git] / drivers / md / raid5.h
index 896d603ad0da964d2c45f22039d8b733f0bef26e..d05144278690ca9b8cb4ad933d6d23dc36b9b0f8 100644 (file)
@@ -482,7 +482,8 @@ struct r5conf {
         */
        int                     active_name;
        char                    cache_name[2][32];
-       struct kmem_cache               *slab_cache; /* for allocating stripes */
+       struct kmem_cache       *slab_cache; /* for allocating stripes */
+       struct mutex            cache_size_mutex; /* Protect changes to cache size */
 
        int                     seq_flush, seq_write;
        int                     quiesce;
@@ -511,7 +512,8 @@ struct r5conf {
        struct list_head        inactive_list[NR_STRIPE_HASH_LOCKS];
        atomic_t                empty_inactive_list_nr;
        struct llist_head       released_stripes;
-       wait_queue_head_t       wait_for_stripe;
+       wait_queue_head_t       wait_for_quiescent;
+       wait_queue_head_t       wait_for_stripe[NR_STRIPE_HASH_LOCKS];
        wait_queue_head_t       wait_for_overlap;
        unsigned long           cache_state;
 #define R5_INACTIVE_BLOCKED    1       /* release of inactive stripes blocked,