Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1O12r0-0005cc-Bd for mharc-grub-devel@gnu.org; Sun, 11 Apr 2010 15:29:58 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O12qy-0005bO-Nz for grub-devel@gnu.org; Sun, 11 Apr 2010 15:29:56 -0400 Received: from [140.186.70.92] (port=44456 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O12qx-0005aE-4s for grub-devel@gnu.org; Sun, 11 Apr 2010 15:29:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O12qv-0005rd-FD for grub-devel@gnu.org; Sun, 11 Apr 2010 15:29:55 -0400 Received: from stallman.rootnode.net ([89.248.165.10]:50305) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O12qv-0005qx-9g for grub-devel@gnu.org; Sun, 11 Apr 2010 15:29:53 -0400 Received: from athlon.localnet (chello089077013017.chello.pl [89.77.13.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by stallman.rootnode.net (Exchange) with ESMTP id C1A0EB649 for ; Sun, 11 Apr 2010 21:29:49 +0200 (CEST) From: Szymon Janc To: grub-devel@gnu.org Date: Sun, 11 Apr 2010 21:30:17 +0200 User-Agent: KMail/1.13.2 (Linux/2.6.32-4-686; KDE/4.4.2; i686; ; ) References: <201004082355.28650.szymon@janc.net.pl> In-Reply-To: <201004082355.28650.szymon@janc.net.pl> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_JNiwL/FkyU3A3Or" Message-Id: <201004112130.17489.szymon@janc.net.pl> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] support for xz compression X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 19:29:57 -0000 --Boundary-00=_JNiwL/FkyU3A3Or Content-Type: Text/Plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Dnia czwartek 08 kwiecie=F1 2010 o 23:55:28 Szymon Janc napisa=B3(a): > Hello, >=20 > New version with various fixes, most noticable : seek support, respect = not > easly seekable flag, BCJ support. Attached is a small fix for xzio read to act in grub way, not posix like. --=20 Szymon K. Janc szymon@janc.net.pl // GG: 1383435 --Boundary-00=_JNiwL/FkyU3A3Or Content-Type: text/x-patch; charset="UTF-8"; name="07a_xzio_fix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="07a_xzio_fix.diff" === modified file 'io/xzio.c' --- io/xzio.c 2010-04-08 21:44:23 +0000 +++ io/xzio.c 2010-04-10 22:46:52 +0000 @@ -245,8 +245,6 @@ int offset_lock; grub_uint8_t current_offset; - xzio->buf.out_size = len >= XZBUFSIZ ? XZBUFSIZ : len; - /* If seek backward need to reset decoder and start from beginning of file. TODO Possible improvement by jumping blocks. */ if (file->offset < xzio->saved_offset) @@ -259,18 +257,19 @@ grub_file_seek (xzio->file, 0); } - offset_lock = (file->offset == xzio->saved_offset) ? 1 : 0; - current_offset = xzio->saved_offset; - - while (len >= xzio->buf.out_size) + while (len > 0) { + xzio->buf.out_size = len >= XZBUFSIZ ? XZBUFSIZ : len; + + offset_lock = (file->offset == xzio->saved_offset) ? 1 : 0; + current_offset = xzio->saved_offset; + /* Feed input. */ if (xzio->buf.in_pos == xzio->buf.in_size) { readret = grub_file_read (xzio->file, xzio->inbuf, XZBUFSIZ); if (readret < 0) return -1; - xzio->buf.in_size = readret; xzio->buf.in_pos = 0; } @@ -317,7 +316,7 @@ } xzio->buf.out_pos = 0; - if (xzret == XZ_STREAM_END) /* Stream end, EOF. */ + if (xzret == XZ_STREAM_END) /* Stream end, EOF. */ break; } --Boundary-00=_JNiwL/FkyU3A3Or--