mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Milan Broz <mbroz@redhat.com>
Cc: Huang Ying <ying.huang@intel.com>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: Re: [BUGFIX] dm-crypt: Fix a bug of async cryption complete function
Date: Fri, 27 Feb 2009 20:46:02 +0800	[thread overview]
Message-ID: <20090227124602.GA24630@gondor.apana.org.au> (raw)
In-Reply-To: <49A7DC7E.1040307@redhat.com>

On Fri, Feb 27, 2009 at 01:28:46PM +0100, Milan Broz wrote:
>
> Like this?
> 
> struct ablkcipher_request *req = (char *)dmreq - cc->dmreq_start;
> mempool_free(req, cc->req_pool);

Exactly.  You could also embed the ablkcipher_request at the
end of dmreq, as in

struct dm_crypt_request {
	struct scatterlist sg_in;
	struct scatterlist sg_out;
	struct ablkcipher_request req;
};

Then you can use container_of.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2009-02-27 12:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-27  8:56 Huang Ying
2009-02-27 11:41 ` Herbert Xu
2009-02-27 11:52   ` Milan Broz
2009-02-27 11:56     ` Herbert Xu
2009-02-27 12:28       ` Milan Broz
2009-02-27 12:46         ` Herbert Xu [this message]
2009-02-27 13:51           ` Milan Broz
2009-02-27 14:19             ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090227124602.GA24630@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbroz@redhat.com \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®