/* * Copyright (C) 2003 Christophe Saout <christophe@saout.de> * Copyright (C) 2004 Clemens Fruhwirth <clemens@endorphin.org> * Copyright (C) 2006-2009 Red Hat, Inc. All rights reserved. * * This file is released under the GPL. */#include<linux/completion.h>#include<linux/err.h>#include<linux/module.h>#include<linux/init.h>#include<linux/kernel.h>#include<linux/bio.h>#include<linux/blkdev.h>#include<linux/mempool.h>#include<linux/slab.h>#include<linux/crypto.h>#include<linux/workqueue.h>#include<linux/backing-dev.h>#include<asm/atomic.h>#include<linux/scatterlist.h>#include<asm/page.h>#include<asm/unaligned.h>#include<linux/device-mapper.h>#define DM_MSG_PREFIX "crypt"#define MESG_STR(x) x, sizeof(x)/* * context holding the current state of a multi-part conversion */structconvert_context{structcompletionrestart;structbio*bio_in;structbio*bio_out;unsignedintoffset_in;unsignedintoffset_out;unsignedintidx_in;unsignedintidx_out;sector_tsector;atomic_tpending;};/* * per bio private data */structdm_crypt_io{structdm_target*target;structbio*base_bio;structwork_structwork;structconvert_contextctx;atomic_tpending;interror;sector_tsector;structdm_crypt_io*base_io;};structdm_crypt_request{structconvert_context*ctx;structscatterlistsg_in;structscatterlistsg_out;};structcrypt_config;structcrypt_iv_operations{int(*ctr