From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36800 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq6lk-0004yh-4F for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:59:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq6li-0007aC-Ny for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:59:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2764) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq6li-0007a6-GX for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:59:34 -0400 From: Jes.Sorensen@redhat.com Date: Mon, 30 Aug 2010 17:59:12 +0200 Message-Id: <1283183960-28404-7-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1283183960-28404-1-git-send-email-Jes.Sorensen@redhat.com> References: <1283183960-28404-1-git-send-email-Jes.Sorensen@redhat.com> Subject: [Qemu-devel] [PATCH 06/14] Remove unused argument for encrypt_sectors() List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, Jes.Sorensen@redhat.com 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 { -- 1.7.2.2