Loading drivers/md/raid5.c +41 −34 Original line number Diff line number Diff line Loading @@ -190,9 +190,8 @@ static int stripe_operations_active(struct stripe_head *sh) test_bit(STRIPE_COMPUTE_RUN, &sh->state); } static void __release_stripe(struct r5conf *conf, struct stripe_head *sh) static void do_release_stripe(struct r5conf *conf, struct stripe_head *sh) { if (atomic_dec_and_test(&sh->count)) { BUG_ON(!list_empty(&sh->lru)); BUG_ON(atomic_read(&conf->active_stripes)==0); if (test_bit(STRIPE_HANDLE, &sh->state)) { Loading Loading @@ -223,6 +222,11 @@ static void __release_stripe(struct r5conf *conf, struct stripe_head *sh) } } } static void __release_stripe(struct r5conf *conf, struct stripe_head *sh) { if (atomic_dec_and_test(&sh->count)) do_release_stripe(conf, sh); } static void release_stripe(struct stripe_head *sh) Loading @@ -230,9 +234,12 @@ static void release_stripe(struct stripe_head *sh) struct r5conf *conf = sh->raid_conf; unsigned long flags; spin_lock_irqsave(&conf->device_lock, flags); __release_stripe(conf, sh); spin_unlock_irqrestore(&conf->device_lock, flags); local_irq_save(flags); if (atomic_dec_and_lock(&sh->count, &conf->device_lock)) { do_release_stripe(conf, sh); spin_unlock(&conf->device_lock); } local_irq_restore(flags); } static inline void remove_hash(struct stripe_head *sh) Loading Loading
drivers/md/raid5.c +41 −34 Original line number Diff line number Diff line Loading @@ -190,9 +190,8 @@ static int stripe_operations_active(struct stripe_head *sh) test_bit(STRIPE_COMPUTE_RUN, &sh->state); } static void __release_stripe(struct r5conf *conf, struct stripe_head *sh) static void do_release_stripe(struct r5conf *conf, struct stripe_head *sh) { if (atomic_dec_and_test(&sh->count)) { BUG_ON(!list_empty(&sh->lru)); BUG_ON(atomic_read(&conf->active_stripes)==0); if (test_bit(STRIPE_HANDLE, &sh->state)) { Loading Loading @@ -223,6 +222,11 @@ static void __release_stripe(struct r5conf *conf, struct stripe_head *sh) } } } static void __release_stripe(struct r5conf *conf, struct stripe_head *sh) { if (atomic_dec_and_test(&sh->count)) do_release_stripe(conf, sh); } static void release_stripe(struct stripe_head *sh) Loading @@ -230,9 +234,12 @@ static void release_stripe(struct stripe_head *sh) struct r5conf *conf = sh->raid_conf; unsigned long flags; spin_lock_irqsave(&conf->device_lock, flags); __release_stripe(conf, sh); spin_unlock_irqrestore(&conf->device_lock, flags); local_irq_save(flags); if (atomic_dec_and_lock(&sh->count, &conf->device_lock)) { do_release_stripe(conf, sh); spin_unlock(&conf->device_lock); } local_irq_restore(flags); } static inline void remove_hash(struct stripe_head *sh) Loading