Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 198394 | Differences between
and this patch

Collapse All | Expand All

(-)a/Linux/Kernel/Dm-target.c (+16 lines)
Lines 375-381 static void dereference_bio_ctx (struct Link Here
375
	if (!atomic_dec_and_test (&bc->ref_count))
375
	if (!atomic_dec_and_test (&bc->ref_count))
376
		return;
376
		return;
377
377
378
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
378
	bio_endio (bc->orig_bio, bc->orig_bio->bi_size, bc->error);
379
	bio_endio (bc->orig_bio, bc->orig_bio->bi_size, bc->error);
380
#else
381
	bio_endio (bc->orig_bio, bc->error);
382
#endif
379
	mempool_free (bc, tc->bio_ctx_pool);
383
	mempool_free (bc, tc->bio_ctx_pool);
380
}
384
}
381
385
Lines 417-440 static void work_process (void *qdata) Link Here
417
}
421
}
418
422
419
423
424
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
420
static int truecrypt_endio (struct bio *bio, unsigned int bytes_done, int error)
425
static int truecrypt_endio (struct bio *bio, unsigned int bytes_done, int error)
426
#else
427
static int truecrypt_endio (struct bio *bio, int error)
428
#endif
421
{
429
{
422
	struct bio_ctx *bc = (struct bio_ctx *) bio->bi_private;
430
	struct bio_ctx *bc = (struct bio_ctx *) bio->bi_private;
423
	struct target_ctx *tc = (struct target_ctx *) bc->target->private;
431
	struct target_ctx *tc = (struct target_ctx *) bc->target->private;
424
	struct bio_vec *bv;
432
	struct bio_vec *bv;
425
	int seg_no;
433
	int seg_no;
426
	
434
	
435
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
427
	trace (1, "end: sc=%llu fl=%ld rw=%ld sz=%d ix=%hd vc=%hd dn=%d er=%d\n",
436
	trace (1, "end: sc=%llu fl=%ld rw=%ld sz=%d ix=%hd vc=%hd dn=%d er=%d\n",
428
		(unsigned long long) bio->bi_sector, bio->bi_flags, bio->bi_rw, bio->bi_size, bio->bi_idx, bio->bi_vcnt, bytes_done, error);
437
		(unsigned long long) bio->bi_sector, bio->bi_flags, bio->bi_rw, bio->bi_size, bio->bi_idx, bio->bi_vcnt, bytes_done, error);
438
#else
439
	trace (1, "end: sc=%llu fl=%ld sz=%ld rw=%ld ix=%hd vc=%hd er=%d\n",
440
		(unsigned long long) bio->bi_sector, bio->bi_flags, bio->bi_size, bio->bi_rw, bio->bi_idx, bio->bi_vcnt, error);
441
#endif
429
442
430
	if (error != 0)
443
	if (error != 0)
431
		bc->error = error;
444
		bc->error = error;
432
445
446
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
433
	if (bio->bi_size)
447
	if (bio->bi_size)
434
	{
448
	{
435
		trace (2, "Outstanding IO: %d\n", bio->bi_size);
449
		trace (2, "Outstanding IO: %d\n", bio->bi_size);
436
		return 1;
450
		return 1;
437
	}
451
	}
452
#endif
438
453
439
	if (bio_data_dir (bio) == READ)
454
	if (bio_data_dir (bio) == READ)
440
	{
455
	{
Lines 459-464 static int truecrypt_endio (struct bio * Link Here
459
	bio_put (bio);
474
	bio_put (bio);
460
	dereference_bio_ctx (bc);
475
	dereference_bio_ctx (bc);
461
	return error;
476
	return error;
477
	
462
}
478
}

Return to bug 198394