Your message dated Fri, 19 Aug 2005 18:32:04 -0700
with message-id <[EMAIL PROTECTED]>
and subject line Bug#297453: fixed in cloop 2.02.1-1
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 28 Feb 2005 20:10:12 +0000
>From [EMAIL PROTECTED] Mon Feb 28 12:10:12 2005
Return-path: <[EMAIL PROTECTED]>
Received: from uucp.gnuu.de [151.189.20.84] 
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1D5rDY-000224-00; Mon, 28 Feb 2005 12:10:12 -0800
Received: from fuckup.lan.yath.de ([EMAIL PROTECTED])
        by uucp.gnuu.de (8.12.9/8.12.9) with bsmtp id j1SKA9cA036183
        for [EMAIL PROTECTED]; Mon, 28 Feb 2005 21:10:09 +0100 (CET)
        (envelope-from [EMAIL PROTECTED])
Received: from earth.lan.yath.de ([192.168.23.9] helo=z3.lan.yath.de)
        by fuckup.lan.yath.de with asmtp (Exim 3.35 #1)
        id 1D5rAY-0000vc-00 (ALL YOUR BASE ARE BELONG TO US!); Mon, 28 Feb 2005 
21:07:06 +0100
Received: from yath by z3.lan.yath.de with local (Exim 3.36 #1 (Debian))
        id 1D5rAe-0000lm-00; Mon, 28 Feb 2005 21:07:12 +0100
Content-Type: multipart/mixed; boundary="===============1301700398=="
MIME-Version: 1.0
From: Sebastian Schmidt <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: Let advfs use a temporary file
X-Mailer: reportbug 3.7.1
Date: Mon, 28 Feb 2005 21:07:12 +0100
Message-Id: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-7.0 required=4.0 tests=BAYES_01,HAS_PACKAGE 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

This is a multi-part MIME message sent by reportbug.

--===============1301700398==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: cloop-utils
Version: 2.01.5-3
Severity: wishlist
Tags: patch

Moin,

This patch adds a -t option to advfs. With this option being set, advfs
no longer saves the compressed image in memory; instead, it writes a
temporary file containing the compressed blocks. This makes advfs faster
on computers with few RAM (assuming it worked once without activating
the OOM killer ;-)).


Sebastian

--===============1301700398==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cloop.diff"

diff -ur cloop-2.01.5/advancecomp-1.9_create_compressed_fs/advfs.cc 
cloop-2.01.5.new/advancecomp-1.9_create_compressed_fs/advfs.cc
--- cloop-2.01.5/advancecomp-1.9_create_compressed_fs/advfs.cc  2004-04-18 
22:33:29.000000000 +0200
+++ cloop-2.01.5.new/advancecomp-1.9_create_compressed_fs/advfs.cc      
2005-02-28 20:47:31.000000000 +0100
@@ -2,6 +2,10 @@
  * (c)1999 Paul `Rusty' Russell.  GPL.
  *
  * CHANGELOG:
+ * * Mon Feb 28 20:45:14 CET 2005 Sebastian Schmidt <[EMAIL PROTECTED]>
+ * - Added -t command line option to use a temporary file for the compressed
+ *   blocks instead of saving it in cb_list.
+ * - Added information message before the write of the compressed image.
  * * Sat Deb 14 22:49:20 CEST 2004 Christian Leber
  * - Changed to work with the advancecomp packages, so that it's
  *   better algorithms may be used
@@ -44,6 +48,8 @@
 
 #define CLOOP_PREAMBLE "#!/bin/sh\n" "#V2.0 Format\n" "modprobe cloop file=$0 
&& mount -r -t iso9660 /dev/cloop $1\n" "exit $?\n"
 
+#define MAXLEN(blocksize) ((blocksize) + (blocksize)/1000 + 12)
+
 struct cb_list
 {
        struct cb_list *next;
@@ -59,7 +65,8 @@
 
 /* Now using the goto style because it is quicker to read */
 static struct cb_list *create_compressed_blocks(int handle, unsigned long
-                          blocksize, unsigned long *numblocks, int method)
+                          blocksize, unsigned long *numblocks, int method,
+                         int tempfile)
 /* method==0: Use "gzip -9", method==-1: Try best (very slow). */
 {
  struct cb_list *cbl,**cbp=&cbl;
@@ -67,7 +74,7 @@
  const int maxalg=11;
  unsigned int last, took[maxalg];
  unsigned long long total_uncompressed=0,total_compressed=0;
- unsigned long maxlen = blocksize + blocksize/1000 + 12;
+ unsigned long maxlen = MAXLEN(blocksize);
  char *compressed[maxalg], *uncompressed;
  if((uncompressed=(char *)malloc(blocksize))==NULL)
   {
@@ -131,8 +138,9 @@
       }
     }
    ++took[best];  
-    
-   if((*cbp = (cb_list *)malloc(sizeof(struct cb_list)+len[best]))==NULL) /* 
get another block */
+   
+   if((*cbp = (cb_list *)malloc(sizeof(struct cb_list)+
+     ((tempfile==-1)?len[best]:0)))==NULL) /* get another block */
     {
      fprintf(stderr, "*** Out of memory allocating block ptrs (virtual memory 
exhausted).\n");
      goto error_free_cb_list;
@@ -141,7 +149,15 @@
    /* Print status */
    fprintf(stderr, "[%2d] Block# %5lu size %6lu -> %6lu [compression ratio 
%3lu%%, overall: %3Lu%%]\n", best, i, total, len[best], 
total>0?((len[best]*100)/total):100,total_uncompressed>0?((total_compressed*100)/total_uncompressed):100);
    (*cbp)->size = len[best];
-   memcpy((*cbp)->data, compressed[best], len[best]);
+   if (tempfile == -1)
+    memcpy((*cbp)->data, compressed[best], len[best]);
+   else
+    if (write(tempfile, compressed[best], len[best]) != len[best])
+     {
+      perror("Unable to write to temporary file");
+      goto error_free_cb_list;
+     }
+   
    (*cbp)->next=NULL;
    cbp=&((*cbp)->next);
   } /* for */
@@ -164,7 +180,8 @@
 
 int usage(char *progname)
 {
- fprintf(stderr, "Usage: %s [-b|--best] filename 
blocksize(bytes).\n",progname);
+ fprintf(stderr, "Usage: %s [-b|--best] [-t|--tempfile] filename "
+   "blocksize(bytes).\n",progname);
  fprintf(stderr, "Use '-' as filename for stdin.\n");
  return 1;
 }
@@ -176,15 +193,32 @@
  struct cloop_head head;
  unsigned long numblocks;
  unsigned long long bytes_so_far;
+ unsigned long maxlen;
  unsigned long i;
  int method=0;
  struct cb_list *compressed_blocks,*cbp;
+ int tempfile = -1;
+ char *compressed;
 
  if(argc<3) return usage(argv[0]);
 
  for(i=1;i<argc;i++)
   {
    if(!(strcmp(argv[i],"-b")&&strcmp(argv[i],"--best"))) method=-1;
+   if(!(strcmp(argv[i],"-t")&&strcmp(argv[i],"--tempfile")))
+    {
+     FILE *t = tmpfile();
+     if (t == NULL)
+      {
+       perror("Unable to create temporary file");
+       return 1;
+      }
+     if ((tempfile = fileno(t)) < 0)
+      {
+       perror("Unable to get temporary file's file descriptor");
+       return 1;
+      }
+    }
    else if((b=atoi(argv[i]))>0) blocksize=b;
    else if(in<0) in=strcmp(argv[i],"-")==0?dup(fileno(stdin)):open(argv[i], 
O_RDONLY);
    else
@@ -218,7 +252,8 @@
    return 1;
   }
 
- compressed_blocks = create_compressed_blocks(in, blocksize, &numblocks, 
method);
+ compressed_blocks = create_compressed_blocks(in, blocksize, &numblocks,
+  method, tempfile);
 
  close(in);
 
@@ -237,6 +272,8 @@
 
  if (!compressed_blocks) return 1;
 
+ fprintf(stderr, "Writing %lu blocks to stdout, please wait...\n", numblocks);
+
  /* Write offsets */
  for (i=0,cbp=compressed_blocks; i < numblocks+1; i++)
   {
@@ -246,18 +283,67 @@
    if(cbp) { bytes_so_far += cbp->size; cbp=cbp->next; }
   }
 
+
+ if (tempfile != -1)
+  {
+   maxlen = MAXLEN(blocksize);
+   if ((compressed = (char *)malloc(maxlen)) == NULL)
+    {
+     fprintf(stderr, "Unable to allocate %d bytes for compressed block\n",
+      maxlen);
+     free_cb_list(compressed_blocks);
+     return 1;
+    }
+   if (lseek(tempfile, 0, SEEK_SET) < 0)
+    {
+     perror("seeking temporary file to beginning");
+     free_cb_list(compressed_blocks);
+     free(compressed);
+     return 1;
+    }
+  }
+
  /* Now write blocks and free them. */
  for (i = 0, cbp=compressed_blocks; cbp && i < numblocks; i++)
   {
-   if (write(STDOUT_FILENO, cbp->data, cbp->size) != cbp->size)
+   if (tempfile == -1)
+    compressed = cbp->data;
+   else
+    {
+     ssize_t total, now;
+     for (total = 0; total < cbp->size; total += now)
+      {
+        if ((now = read(tempfile, compressed+total, cbp->size-total)) < 0)
+         {
+           perror("reading from temporary file");
+           free_cb_list(compressed_blocks);
+           free(compressed);
+           return 1;
+          }
+         else if (now == 0)
+         {
+          fprintf(stderr, "EOF while reading from temporary file\n");
+          free_cb_list(compressed_blocks);
+          free(compressed);
+          return 1;
+         }
+      }
+    }
+   
+   if (write(STDOUT_FILENO, compressed, cbp->size) != cbp->size)
     {
      perror("writing block");
+     if (tempfile != -1)
+      free(compressed);
      free_cb_list(compressed_blocks);
      return 1;
     }
    cbp=cbp->next;
    free(compressed_blocks); compressed_blocks=cbp;
   }
+ 
  fprintf(stderr,"Done.\n");
+ if (tempfile != -1)
+  free(compressed);
  return 0;
 }
diff -ur cloop-2.01.5/debian/create_compressed_fs.1 
cloop-2.01.5.new/debian/create_compressed_fs.1
--- cloop-2.01.5/debian/create_compressed_fs.1  2005-02-28 20:42:43.000000000 
+0100
+++ cloop-2.01.5.new/debian/create_compressed_fs.1      2005-02-28 
20:56:58.000000000 +0100
@@ -12,7 +12,7 @@
 \fBcreate_compressed_fs\fR \fB image\fR \fBblocksize\fR [ \fB> 
image.cloop_compressed\fR ]
 
 
-\fBadvfs\fR \fB image\fR \fBblocksize\fR [ \fB> image.cloop_compressed\fR ]
+\fBadvfs\fR [ \fB-t\fR ] \fBimage\fR \fBblocksize\fR [ \fB> 
image.cloop_compressed\fR ]
 
 
 \fBextract_compressed_fs\fR \fB filename\fR
@@ -30,6 +30,11 @@
 \fBadvfs\fR is an experimental alternative to
 create_compressed_fs. It should need less memory and can work with data from
 STDIN.
+.PP
+If you pass the
+.RB -t
+option to \fBadvfs\fR, a temporary file will be created
+instead of holding the whole compressed image in memory.
 .SH "MOUNTING"
 .PP
 You have to pass the options to the cloop module on loading:

--===============1301700398==--


---------------------------------------
Received: (at 297453-close) by bugs.debian.org; 20 Aug 2005 01:39:01 +0000
>From [EMAIL PROTECTED] Fri Aug 19 18:39:01 2005
Return-path: <[EMAIL PROTECTED]>
Received: from katie by spohr.debian.org with local (Exim 3.36 1 (Debian))
        id 1E6IDM-0006Ox-00; Fri, 19 Aug 2005 18:32:04 -0700
From: Eduard Bloch <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
X-Katie: $Revision: 1.56 $
Subject: Bug#297453: fixed in cloop 2.02.1-1
Message-Id: <[EMAIL PROTECTED]>
Sender: Archive Administrator <[EMAIL PROTECTED]>
Date: Fri, 19 Aug 2005 18:32:04 -0700
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-CrossAssassin-Score: 2

Source: cloop
Source-Version: 2.02.1-1

We believe that the bug you reported is fixed in the latest version of
cloop, which is due to be installed in the Debian FTP archive:

cloop-src_2.02.1-1_all.deb
  to pool/main/c/cloop/cloop-src_2.02.1-1_all.deb
cloop-utils_2.02.1-1_i386.deb
  to pool/main/c/cloop/cloop-utils_2.02.1-1_i386.deb
cloop_2.02.1-1.diff.gz
  to pool/main/c/cloop/cloop_2.02.1-1.diff.gz
cloop_2.02.1-1.dsc
  to pool/main/c/cloop/cloop_2.02.1-1.dsc
cloop_2.02.1.orig.tar.gz
  to pool/main/c/cloop/cloop_2.02.1.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Eduard Bloch <[EMAIL PROTECTED]> (supplier of updated cloop package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Fri, 19 Aug 2005 22:57:46 +0200
Source: cloop
Binary: cloop-src cloop-utils
Architecture: source i386 all
Version: 2.02.1-1
Distribution: unstable
Urgency: low
Maintainer: Eduard Bloch <[EMAIL PROTECTED]>
Changed-By: Eduard Bloch <[EMAIL PROTECTED]>
Description: 
 cloop-src  - Source of the compressed loopback device module
 cloop-utils - Tools for handling with cloop compressed volumes
Closes: 259699 297453 303675 313360 313361 322360
Changes: 
 cloop (2.02.1-1) unstable; urgency=low
 .
   * New upstream release
     + sync with Knoppix version, version string relabeled as usual
   * rewrote the Makefile making use of kernel 2.6 build system, created
     proper install rules (I should have done this already for #288941). The
     strange problem with /usr/src/linux on kernel 2.4 should also go away
     (closes: #322360)
   * old versions of cloop module source removed (discontinued, they are not
     compatible with kernel 2.6 anyways). Get the packages from Stable if you
     need to read really old KNOPPIX images. (closes: #259699)
   * changelog cleanup, replaced Klaus' invalid local mail addresses
   * control file generations cleanup, dropped the old junk in favor of
     module-assistant's methods
   * updated and simplified (m-a) README.Debian instructions
   * using bzip2 for the source tarball
   * fixed the templates file installation in the modules packages
   * added Vietnamese translation by Clytie Siddall (closes: #313361)
   * added pt_BT translation by Rodrigo Tadeu Claro and Andre Luis Lopes
     (closes: #303675)
   * removed an "a" forgotten in plural form (closes: #313360), thanks Clytie
   * advfs patch to use a temporary file rather than memory by Sebastian
     Schmidt (closes: #297453)
Files: 
 b2e2fe6ae260e640e0fdd2186329e5c4 611 misc optional cloop_2.02.1-1.dsc
 929dbd22cea6fcc673664fa9351a5ac8 419295 misc optional cloop_2.02.1.orig.tar.gz
 6b8e9bda102dcf0ae9711345a46ea2df 18295 misc optional cloop_2.02.1-1.diff.gz
 e7eef040ee0bbe25277fbd6042e825b3 33496 misc optional cloop-src_2.02.1-1_all.deb
 c254de729b6920c53e368100d2e71745 133380 misc optional 
cloop-utils_2.02.1-1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDBoTv4QZIHu3wCMURAkvpAJ9ErCZ/u6f99WxR8Pfd/axh6JWpgACfaJdo
0UqqfCA6OAbPF5SpuLAACMs=
=+BNT
-----END PGP SIGNATURE-----


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to