updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / truecrypt-zen / kernel-2.6.24.patch
blob443ce71d774ff67ada65f333fa00b54fe3d99b17
1 --- Dm-target.c 2007-04-24 18:32:06.000000000 +0200
2 +++ Dm-target.c.new 2007-12-17 00:36:55.000000000 +0100
3 @@ -375,7 +375,11 @@
4 if (!atomic_dec_and_test (&bc->ref_count))
5 return;
7 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
8 bio_endio (bc->orig_bio, bc->orig_bio->bi_size, bc->error);
9 +#else
10 + bio_endio (bc->orig_bio, bc->error);
11 +#endif
12 mempool_free (bc, tc->bio_ctx_pool);
15 @@ -417,24 +421,35 @@
19 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
20 static int truecrypt_endio (struct bio *bio, unsigned int bytes_done, int error)
21 +#else
22 +static int truecrypt_endio (struct bio *bio, int error)
23 +#endif
25 struct bio_ctx *bc = (struct bio_ctx *) bio->bi_private;
26 struct target_ctx *tc = (struct target_ctx *) bc->target->private;
27 struct bio_vec *bv;
28 int seg_no;
30 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
31 trace (1, "end: sc=%llu fl=%ld rw=%ld sz=%d ix=%hd vc=%hd dn=%d er=%d\n",
32 (unsigned long long) bio->bi_sector, bio->bi_flags, bio->bi_rw, bio->bi_size, bio->bi_idx, bio->bi_vcnt, bytes_done, error);
33 +#else
34 + trace (1, "end: sc=%llu fl=%ld sz=%ld rw=%ld ix=%hd vc=%hd er=%d\n",
35 + (unsigned long long) bio->bi_sector, bio->bi_flags, bio->bi_size, bio->bi_rw, bio->bi_idx, bio->bi_vcnt, error);
36 +#endif
38 if (error != 0)
39 bc->error = error;
41 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
42 if (bio->bi_size)
44 trace (2, "Outstanding IO: %d\n", bio->bi_size);
45 return 1;
47 +#endif
49 if (bio_data_dir (bio) == READ)
51 @@ -459,6 +474,7 @@
52 bio_put (bio);
53 dereference_bio_ctx (bc);
54 return error;
59 @@ -656,7 +672,11 @@
60 goto err;
63 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
64 + bio_ctx_cache = kmem_cache_create ("truecrypt-bioctx", sizeof (struct bio_ctx), 0, 0, NULL);
65 +#else
66 bio_ctx_cache = kmem_cache_create ("truecrypt-bioctx", sizeof (struct bio_ctx), 0, 0, NULL, NULL);
67 +#endif
68 if (!bio_ctx_cache)
70 error ("kmem_cache_create failed");