md:Add judgement bb->unacked_exist in function
From 7054a9dcd23a721e3c3dd2ceb8f1243187ea5cc4 Mon Sep 17 00:00:00 2001
From: majianpeng <[email protected]>
Date: Thu, 8 Mar 2012 17:31:32 +0800
Subject: [PATCH] md:Add judgement bb->unacked_exist in function
md_ack_all_badblocks().
--- drivers/md/md.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/md/md.c +1 -1
@@ -8040,7 +8040,7 @@ void md_ack_all_badblocks(struct badblocks *bb)return ;write_seqlock_irq (&bb->lock); -if (bb->changed ==0 ) { +if (bb->changed ==0 && bb->unacked_exist) {u64 *p = bb->page;int i;for (i =0 ; i < bb->count ; i++) {
Signature · 6 lines
1.7.5.4 -------------- kedacomkernel 2012-03-08
Quoted 17 lines · On Thu, 8 Mar 2012 17:37:45 +0800 "kedacomkernel" <[email protected]>…
Quoted 1 line
From
7054a9dcd23a721e3c3dd2ceb8f1243187ea5cc4Mon Sep 17 00:00:00 2001From: majianpeng <[email protected]>
Date: Thu, 8 Mar 2012 17:31:32 +0800
Subject: [PATCH] md:Add judgementbb->unacked_existin function
md_ack_all_badblocks().Signed-off-by majianpeng <[email protected]>--- drivers/md/md.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/md/md.c +0
-0
drivers/md/md.c void md_ack_all_badblocks(struct badblocks *bb) · line 8046
Quoted 8 lines
drivers/md/md.c +1
-1@@ -8040,7 +8040,7 @@ void md_ack_all_badblocks(struct badblocks *bb)return ;write_seqlock_irq (&bb->lock); -if (bb->changed ==0 ) { +if (bb->changed ==0 && bb->unacked_exist) {u64 *p = bb->page;int i;for (i =0 ; i < bb->count ; i++) {
Thanks.
This is fairly minor optimisation as 'unacked_exists' it almost always true when ->change is set, but I doesn't hurt so I've included it.
In general I prefer a slightly more details commit comment. It doesn't have to be long, but it should make it obvious why the change is needed and what it does.
I have made it:
md: Add judgement bb->unacked_exist in function md_ack_all_badblocks().
If there are no unacked bad blocks, then there is no point searching for them to acknowledge them.
Thanks,
NeilBrown