diff --git a/debug.c b/debug.c index 96c95085e..ddee95fda 100644 --- a/debug.c +++ b/debug.c @@ -293,7 +293,7 @@ void reiser4_debugtrap(void) /* do nothing. Put break point here. */ #if defined(CONFIG_KGDB) && !defined(CONFIG_REISER4_FS_MODULE) extern void kgdb_breakpoint(void); - kgdb_breakpoint(); + //kgdb_breakpoint(); #endif } #endif diff --git a/flush_queue.c b/flush_queue.c index ef880aa64..e83413ff1 100644 --- a/flush_queue.c +++ b/flush_queue.c @@ -399,8 +399,11 @@ int atom_fq_parts_are_clean(txn_atom * atom) static void end_io_handler(struct bio *bio) { int i; + int nr = 0; int nr_errors = 0; flush_queue_t *fq; + struct bio_vec *bvec; + struct bvec_iter_all iter_all; assert("zam-958", bio_op(bio) == WRITE); @@ -408,8 +411,8 @@ static void end_io_handler(struct bio *bio) * for synchronization and error counting. */ fq = bio->bi_private; /* Check all elements of io_vec for correct write completion. */ - for (i = 0; i < bio->bi_vcnt; i += 1) { - struct page *pg = bio->bi_io_vec[i].bv_page; + bio_for_each_segment_all(bvec, bio, i, iter_all) { + struct page *pg = bvec->bv_page; if (bio->bi_status) { SetPageError(pg); @@ -427,7 +430,7 @@ static void end_io_handler(struct bio *bio) JF_CLR(node, JNODE_WRITEBACK); } - + nr ++; end_page_writeback(pg); put_page(pg); } @@ -438,7 +441,7 @@ static void end_io_handler(struct bio *bio) /* If all write requests registered in this "fq" are done we up * the waiter. */ - if (atomic_sub_and_test(bio->bi_vcnt, &fq->nr_submitted)) + if (atomic_sub_and_test(nr, &fq->nr_submitted)) wake_up(&fq->wait); } @@ -453,7 +456,8 @@ void add_fq_to_bio(flush_queue_t *fq, struct bio *bio) bio->bi_end_io = end_io_handler; if (fq) - atomic_add(bio->bi_vcnt, &fq->nr_submitted); + atomic_add(bio->bi_iter.bi_size >> PAGE_SHIFT, + &fq->nr_submitted); } /* Move all queued nodes out from @fq->prepped list. */ diff --git a/wander.c b/wander.c index e23b34d6e..df82d27de 100644 --- a/wander.c +++ b/wander.c @@ -540,12 +540,14 @@ get_more_wandered_blocks(int count, reiser4_block_nr * start, int *len) static void undo_bio(struct bio *bio) { int i; + struct bio_vec *bvec; + struct bvec_iter_all iter_all; - for (i = 0; i < bio->bi_vcnt; ++i) { + bio_for_each_segment_all(bvec, bio, i, iter_all) { struct page *pg; jnode *node; - pg = bio->bi_io_vec[i].bv_page; + pg = bvec->bv_page; end_page_writeback(pg); node = jprivate(pg); spin_lock_jnode(node); @@ -828,7 +830,6 @@ static int write_jnodes_to_disk_extent( if (nr_used > 0) { assert("nikita-3453", bio->bi_iter.bi_size == super->s_blocksize * nr_used); - assert("nikita-3454", bio->bi_vcnt == nr_used); /* Check if we are allowed to write at all */ if (sb_rdonly(super))