Skip to contentSkip to conversation

fs/ocfs2: Evalue bio->bi_rw after calling bio_alloc() and before calling bio_add_page().

PATCH In review majianpeng 1 participant 1 message Jul 30, 2012

Subsystems (2)
lore
Share & tools
lore

majianpeng

author
#0 lore raw

PATCH 7/8 fs/ocfs2: Evalue bio->bi_rw after calling bio_alloc() and before calling bio_add_page().

Because call bio_alloc, the bi_rw is zero by default,but in bio_add_page used the bi_rw. So evalue bi_rw.

---
 fs/ocfs2/cluster/heartbeat.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
fs/ocfs2/cluster/heartbeat.c +5 -3
index a4e855e..50079d3 100644
@@ -399,7 +399,8 @@ static void o2hb_bio_end_io(struct bio *bio,
 static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg,
 				      struct o2hb_bio_wait_ctxt *wc,
 				      unsigned int *current_slot,
-				      unsigned int max_slots)
+				      unsigned int max_slots,
+				      int rw)
 {
 	int len, current_page;
 	unsigned int vec_len, vec_start;
@@ -425,6 +426,7 @@ static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg,
 	bio->bi_bdev = reg->hr_bdev;
 	bio->bi_private = wc;
 	bio->bi_end_io = o2hb_bio_end_io;
+	bio->bi_rw = rw;
 
 	vec_start = (cs << bits) % PAGE_CACHE_SIZE;
 	while(cs < max_slots) {
@@ -460,7 +462,7 @@ static int o2hb_read_slots(struct o2hb_region *reg,
 	o2hb_bio_wait_init(&wc);
 
 	while(current_slot < max_slots) {
-		bio = o2hb_setup_one_bio(reg, &wc, &current_slot, max_slots);
+		bio = o2hb_setup_one_bio(reg, &wc, &current_slot, max_slots, READ);
 		if (IS_ERR(bio)) {
 			status = PTR_ERR(bio);
 			mlog_errno(status);
@@ -492,7 +494,7 @@ static int o2hb_issue_node_write(struct o2hb_region *reg,
 
 	slot = o2nm_this_node();
 
-	bio = o2hb_setup_one_bio(reg, write_wc, &slot, slot+1);
+	bio = o2hb_setup_one_bio(reg, write_wc, &slot, slot+1, WRITE);
 	if (IS_ERR(bio)) {
 		status = PTR_ERR(bio);
 		mlog_errno(status);
Signature · 5 lines
1.7.9.5
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs