[dm-devel] [PATCH] kcopyd.c : Use consistent method for setting bh->b_state

Kevin Corry corryk at us.ibm.com
Thu Jan 9 12:06:02 UTC 2003


dispatch_bh() uses two different methods to set bits in bh->b_state. One of
these two patches will change dispatch_bh() to use a consistent method. I
kind of prefer the first, since bh->b_state was meant to be used with the
set_bit(), test_bit(), and clear_bit() macros. After looking around, I also
noticed that loop and MD are also inconsistent about how they use that
field. Kinda weird.

--- linux-2.4.20a/drivers/md/kcopyd.c	2003/01/09 16:59:13
+++ linux-2.4.20b/drivers/md/kcopyd.c	2003/01/09 17:00:35
@@ -338,9 +338,11 @@
 	init_buffer(bh, end_bh, job);
 
 	bh->b_dev = job->disk.dev;
-	bh->b_state = ((1 << BH_Mapped) | (1 << BH_Lock) | (1 << BH_Req));
 
 	set_bit(BH_Uptodate, &bh->b_state);
+	set_bit(BH_Mapped, &bh->b_state);
+	set_bit(BH_Lock, &bh->b_state);
+	set_bit(BH_Req, &bh->b_state);
 	if (job->rw == WRITE)
 		clear_bit(BH_Dirty, &bh->b_state);
 
==========================================================================
--- linux-2.4.20a/drivers/md/kcopyd.c	2003/01/09 16:59:13
+++ linux-2.4.20b/drivers/md/kcopyd.c	2003/01/09 17:04:48
@@ -338,9 +338,8 @@
 	init_buffer(bh, end_bh, job);
 
 	bh->b_dev = job->disk.dev;
-	bh->b_state = ((1 << BH_Mapped) | (1 << BH_Lock) | (1 << BH_Req));
+	bh->b_state = ((1 << BH_Uptodate) | (1 << BH_Mapped) | (1 << BH_Lock) | (1 
<< BH_Req));
 
-	set_bit(BH_Uptodate, &bh->b_state);
 	if (job->rw == WRITE)
 		clear_bit(BH_Dirty, &bh->b_state);
 




More information about the dm-devel mailing list