From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NhNDy-00080S-RG for mharc-grub-devel@gnu.org; Tue, 16 Feb 2010 08:12:22 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NhNDx-00080B-4H for grub-devel@gnu.org; Tue, 16 Feb 2010 08:12:21 -0500 Received: from [140.186.70.92] (port=40849 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NhNDv-0007zY-CJ for grub-devel@gnu.org; Tue, 16 Feb 2010 08:12:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NhNDu-0008UK-Bt for grub-devel@gnu.org; Tue, 16 Feb 2010 08:12:19 -0500 Received: from fg-out-1718.google.com ([72.14.220.156]:36446) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NhNDu-0008U7-6Z for grub-devel@gnu.org; Tue, 16 Feb 2010 08:12:18 -0500 Received: by fg-out-1718.google.com with SMTP id 22so335483fge.12 for ; Tue, 16 Feb 2010 05:12:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=f7iQunLbH7Hdec+HYlDlTRWceqF50W1Iynap7+ssDjA=; b=q26RtcZDuK4UCSLG08wnmbIz0d4NlBS6YouscO9EWrCAEumoR9W8ZuoFJlEu/WCAu2 T2UTIbH35pmkJNllxwuyas7U2EBir6C/RAQONbbrxyOF6CA+PNx14JZVBPqBdWz7UVvr mDtUVteNKNtidAI4r0vleadCUhd28RMmtuOkQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=puZtPGS5HxlAZ3mjQ8Y3onZ+sQQTxn9zYyEJ2T9GXaqx8eDJOo1WpISR4bm392MZlJ U6pBG+A907zsy1YgXA1nMuhshPLX9FdbcQ39SYFU1YfO0eb7FdznPODnaa+6JABt4qFZ FAMAvD32EVMfmKoH/RYfIf0hC5YqIXcqBqOoU= Received: by 10.87.62.39 with SMTP id p39mr11604597fgk.9.1266325936536; Tue, 16 Feb 2010 05:12:16 -0800 (PST) Received: from debian.bg45.phnet ([81.62.76.105]) by mx.google.com with ESMTPS id e11sm11277296fga.29.2010.02.16.05.12.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 16 Feb 2010 05:12:14 -0800 (PST) Message-ID: <4B7A99A4.6090806@gmail.com> Date: Tue, 16 Feb 2010 14:12:04 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <201002042201.17127.szymon@janc.net.pl> In-Reply-To: <201002042201.17127.szymon@janc.net.pl> X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig89A975A082B3E62F4507157E" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH][UPDATED] support for xz compression format 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: Tue, 16 Feb 2010 13:12:21 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig89A975A082B3E62F4507157E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Szymon Janc wrote: > Hello, > > New version of xz compression patch. > Changes since then: > - it works now :-) > - decoder dictionary can be enlarge up to DICT_BIT_SIZE defined in xz_l= zma2.h > (currently set to 30 =3D 128MiB) > - xz uses crc32 from libgcrypt-grub, internal crc implementation remove= d > - removed linux kernel related code from xz > - get rid of some not needed memcpy() calls > - xzio.mod stuff made according to Vladimir's comments > - simplified wraper (only 1 file - xz_wrap.h) > - number of other improvments and tons of bugfixes > - files licence changed from public domain to gpl3+ > > This patch also changes gnulib-wrap.h true/false definitions to make th= em truly > constants. > > TODO and other questions: > - lack of file seek support, if files is compressed with small block si= ze, it is=20 > possible to implement pseudo-random access > - what is optimal i/o buffer size? like BUFSIZ macro in glibc > - default dictionary size should be chosen for files compression > - still need to do performance tests > - introduce some common layer for xzio/gzio etc ? > > Comments are welcome > > =20 First of all: could you use unified diff? (-u option) # Misc. ! pkglib_MODULES +=3D gzio.mod bufio.mod elf.mod xzio.mod Please put pkglib_MODULES +=3D xzio.mod right before other variables grub2-1.98~experimental.20100120/conf/xzembed.rmk I don't see a need for either separate .rmk or separate module + static grub_uint8_t inbuf[XZBUFSIZ]; + static grub_uint8_t outbuf[XZBUFSIZ]; Avoid static variables. It will fail if user e.g. mounts xz file as a loopback then opens xz'ed file on this loopback. Just put buffers in grub_xzio + if (! file) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of memory"); + return 0; grub_error is already issued by grub_malloc, no need to put the same code here. + grub_memset (xzio, 0, sizeof (*xzio)); Use grub_zalloc instead of malloc + memset + xzio->buf.out_size =3D len >=3D XZBUFSIZ ? XZBUFSIZ : len; I suggest adding parenthesis around condition + /* feed input */ Please capitalise first letter and terminate the comments with a full stop and 2 spaces. + readret =3D grub_file_read(xzio->file,inbuf,XZBUFSIZ); Missing spaces before opening bracket and after commas. I recommend running indent on new files. > -----------------------------------------------------------------------= - > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > =20 --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig89A975A082B3E62F4507157E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iF4EAREKAAYFAkt6maoACgkQNak7dOguQglLYwD/YlbfynBUpBXtew3XE1A+NAe1 z5mkU6NEruWSZuurc4ABAJX8SVikc5hGDj/p8wsS7nQVUajALJxXseAI71Zfq37p =HXse -----END PGP SIGNATURE----- --------------enig89A975A082B3E62F4507157E--