From patchwork Mon Aug 30 15:35:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jes Sorensen X-Patchwork-Id: 63055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C9670B70F0 for ; Tue, 31 Aug 2010 01:40:31 +1000 (EST) Received: from localhost ([127.0.0.1]:47534 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq6TE-0001LY-S5 for incoming@patchwork.ozlabs.org; Mon, 30 Aug 2010 11:40:28 -0400 Received: from [140.186.70.92] (port=58005 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq6P3-0007os-JG for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:36:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq6P2-0003Ut-Ja for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:36:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50790) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq6P2-0003UZ-9D for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:36:08 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7UFa6FV021960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 30 Aug 2010 11:36:06 -0400 Received: from localhost6.localdomain6 ([10.3.121.6]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7UFZnE5010962; Mon, 30 Aug 2010 11:36:05 -0400 From: Jes.Sorensen@redhat.com To: qemu-devel@nongnu.org Date: Mon, 30 Aug 2010 17:35:39 +0200 Message-Id: <1283182547-26116-7-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1283182547-26116-1-git-send-email-Jes.Sorensen@redhat.com> References: <1283182547-26116-1-git-send-email-Jes.Sorensen@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com, Jes.Sorensen@redhat.com Subject: [Qemu-devel] [PATCH 06/14] Remove unused argument for encrypt_sectors() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jes Sorensen Signed-off-by: Jes Sorensen --- block/qcow.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/block/qcow.c b/block/qcow.c index 816103d..c4d8cb3 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -214,9 +214,8 @@ static int qcow_set_key(BlockDriverState *bs, const char *key) /* The crypt function is compatible with the linux cryptoloop algorithm for < 4 GB images. NOTE: out_buf == in_buf is supported */ -static void encrypt_sectors(BDRVQcowState *s, int64_t sector_num, - uint8_t *out_buf, const uint8_t *in_buf, - int nb_sectors, int enc, +static void encrypt_sectors(int64_t sector_num, uint8_t *out_buf, + const uint8_t *in_buf, int nb_sectors, int enc, const AES_KEY *key) { union { @@ -351,7 +350,7 @@ static uint64_t get_cluster_offset(BlockDriverState *bs, memset(s->cluster_data + 512, 0x00, 512); for(i = 0; i < s->cluster_sectors; i++) { if (i < n_start || i >= n_end) { - encrypt_sectors(s, start_sect + i, + encrypt_sectors(start_sect + i, s->cluster_data, s->cluster_data + 512, 1, 1, &s->aes_encrypt_key); @@ -474,7 +473,7 @@ static int qcow_read(BlockDriverState *bs, int64_t sector_num, if (ret != n * 512) return -1; if (s->crypt_method) { - encrypt_sectors(s, sector_num, buf, buf, n, 0, + encrypt_sectors(sector_num, buf, buf, n, 0, &s->aes_decrypt_key); } } @@ -558,7 +557,7 @@ static void qcow_aio_read_cb(void *opaque, int ret) /* nothing to do */ } else { if (s->crypt_method) { - encrypt_sectors(s, acb->sector_num, acb->buf, acb->buf, + encrypt_sectors(acb->sector_num, acb->buf, acb->buf, acb->n, 0, &s->aes_decrypt_key); } @@ -687,7 +686,7 @@ static void qcow_aio_write_cb(void *opaque, int ret) goto done; } } - encrypt_sectors(s, acb->sector_num, acb->cluster_data, acb->buf, + encrypt_sectors(acb->sector_num, acb->cluster_data, acb->buf, acb->n, 1, &s->aes_encrypt_key); src_buf = acb->cluster_data; } else {