diff -Nru /tmp/hm6yKG1k3o/cloop-2.02.1+eb.8/compressed_loop.c /tmp/9x2eCqnZIm/cloop-2.02.1+eb.10/compressed_loop.c --- /tmp/hm6yKG1k3o/cloop-2.02.1+eb.8/compressed_loop.c 2005-08-19 14:28:47.000000000 -0700 +++ /tmp/9x2eCqnZIm/cloop-2.02.1+eb.10/compressed_loop.c 2005-10-06 03:41:51.000000000 -0700 @@ -22,6 +22,10 @@ #define CLOOP_VERSION "2.02" #define CLOOP_MAX 8 +#ifdef CONFIG_SMP +#define __SMP__ +#endif + /* Define this if you are using Greenshoe Linux */ /* #define REDHAT_KERNEL */ @@ -323,7 +327,6 @@ bh = blk_queue_bounce(q,rw,bh); #else int rw = bio_rw(bio); - unsigned int vecnr; cloop = q->queuedata; #endif @@ -365,10 +368,11 @@ dest = bh->b_data; #else down(&cloop->clo_lock); + while (bio != NULL) { offset = (loff_t)bio->bi_sector << 9; - for(vecnr=0; vecnr < bio->bi_vcnt; vecnr++) + for(; bio->bi_idx < bio->bi_vcnt; bio->bi_idx++) { - struct bio_vec *bvec=&bio->bi_io_vec[vecnr]; + struct bio_vec *bvec=&bio->bi_io_vec[bio->bi_idx]; len = bvec->bv_len; dest= kmap(bvec->bv_page) + bvec->bv_offset; #endif @@ -391,6 +395,7 @@ /* Now, at least part of what we want will be in the buffer. */ length_in_buffer = ntohl(cloop->head.block_size) - offset_in_buffer; + DEBUGP("cloop: make_clo_request: block_offset=%lld, offset_in_buffer=%ld\n", block_offset, offset_in_buffer); if(length_in_buffer > len) { @@ -409,6 +414,9 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) kunmap(bvec->bv_page); } /* end for vecnr*/ + bio_endio(bio, bio->bi_size, status==0); + bio = bio->bi_next; + } /* end while (bio != NULL) */ #endif up(&cloop->clo_lock); @@ -417,6 +425,7 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) bh->b_end_io(bh,status); #else + if (bio != NULL) bio_endio(bio, bio->bi_size,status==0); #endif return 0;