|
Lines 375-381
static void dereference_bio_ctx (struct
|
Link Here
|
|---|
|
if (!atomic_dec_and_test (&bc->ref_count)) | if (!atomic_dec_and_test (&bc->ref_count)) |
return; | return; |
| |
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) |
bio_endio (bc->orig_bio, bc->orig_bio->bi_size, bc->error); | bio_endio (bc->orig_bio, bc->orig_bio->bi_size, bc->error); |
|
#else |
|
bio_endio (bc->orig_bio, bc->error); |
|
#endif |
mempool_free (bc, tc->bio_ctx_pool); | mempool_free (bc, tc->bio_ctx_pool); |
} | } |
| |
|
Lines 417-440
static void work_process (void *qdata)
|
Link Here
|
|---|
|
} | } |
| |
| |
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) |
static int truecrypt_endio (struct bio *bio, unsigned int bytes_done, int error) | static int truecrypt_endio (struct bio *bio, unsigned int bytes_done, int error) |
|
#else |
|
static int truecrypt_endio (struct bio *bio, int error) |
|
#endif |
{ | { |
struct bio_ctx *bc = (struct bio_ctx *) bio->bi_private; | struct bio_ctx *bc = (struct bio_ctx *) bio->bi_private; |
struct target_ctx *tc = (struct target_ctx *) bc->target->private; | struct target_ctx *tc = (struct target_ctx *) bc->target->private; |
struct bio_vec *bv; | struct bio_vec *bv; |
int seg_no; | int seg_no; |
| |
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) |
trace (1, "end: sc=%llu fl=%ld rw=%ld sz=%d ix=%hd vc=%hd dn=%d er=%d\n", | trace (1, "end: sc=%llu fl=%ld rw=%ld sz=%d ix=%hd vc=%hd dn=%d er=%d\n", |
(unsigned long long) bio->bi_sector, bio->bi_flags, bio->bi_rw, bio->bi_size, bio->bi_idx, bio->bi_vcnt, bytes_done, error); | (unsigned long long) bio->bi_sector, bio->bi_flags, bio->bi_rw, bio->bi_size, bio->bi_idx, bio->bi_vcnt, bytes_done, error); |
|
#else |
|
trace (1, "end: sc=%llu fl=%ld sz=%ld rw=%ld ix=%hd vc=%hd er=%d\n", |
|
(unsigned long long) bio->bi_sector, bio->bi_flags, bio->bi_size, bio->bi_rw, bio->bi_idx, bio->bi_vcnt, error); |
|
#endif |
| |
if (error != 0) | if (error != 0) |
bc->error = error; | bc->error = error; |
| |
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) |
if (bio->bi_size) | if (bio->bi_size) |
{ | { |
trace (2, "Outstanding IO: %d\n", bio->bi_size); | trace (2, "Outstanding IO: %d\n", bio->bi_size); |
return 1; | return 1; |
} | } |
|
#endif |
| |
if (bio_data_dir (bio) == READ) | if (bio_data_dir (bio) == READ) |
{ | { |
|
Lines 459-464
static int truecrypt_endio (struct bio *
|
Link Here
|
|---|
|
bio_put (bio); | bio_put (bio); |
dereference_bio_ctx (bc); | dereference_bio_ctx (bc); |
return error; | return error; |
|
|
} | } |