Hello community, here is the log from the commit of package zerofree for openSUSE:Factory checked in at 2018-07-07 22:01:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/zerofree (Old) and /work/SRC/openSUSE:Factory/.zerofree.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "zerofree" Sat Jul 7 22:01:47 2018 rev:6 rq:621277 version:1.1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/zerofree/zerofree.changes 2016-07-14 09:46:32.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.zerofree.new/zerofree.changes 2018-07-07 22:01:47.535059687 +0200 @@ -1,0 +2,7 @@ +Thu Jul 5 11:09:52 UTC 2018 - astie...@suse.com + +- update to 1.1.1: + * Lift call to ext2fs_free_blocks_count out of loop + * Add support for 64-bit block numbers + +------------------------------------------------------------------- Old: ---- zerofree-1.0.4.tgz New: ---- zerofree-1.1.1.tgz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ zerofree.spec ++++++ --- /var/tmp/diff_new_pack.yXtPs5/_old 2018-07-07 22:01:48.083058994 +0200 +++ /var/tmp/diff_new_pack.yXtPs5/_new 2018-07-07 22:01:48.091058984 +0200 @@ -1,8 +1,7 @@ # # spec file for package zerofree # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. -# Copyright 2008 Archie L. Cobbs. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,49 +17,43 @@ Name: zerofree -Version: 1.0.4 +Version: 1.1.1 Release: 0 -Summary: Utility for ext2 filesystems that zeroes out unallocated blocks -License: GPL-2.0 +Summary: Utility for ext2,ext3,ext4 filesystems that zeroes out unallocated blocks +License: GPL-2.0-only Group: System/Filesystems -Url: http://frippery.org/uml/ -BuildRoot: %{_tmppath}/%{name}-%{version}-build - +URL: http://frippery.org/uml/ Source0: http://frippery.org/uml/%{name}-%{version}.tgz Source1: http://frippery.org/uml/sparsify.c Source2: zerofree.8 BuildRequires: libext2fs-devel %description -zerofree is a utility for ext2 filesystems that will scan the -list of free blocks in a filesystem and fill with zeroes any -blocks that do not already contain zeroes. +zerofree is a utility for ext2,ext3 and ext4 filesystems that +will scan the list of free blocks in a filesystem and fill with +zeroes any blocks that do not already contain zeroes. This RPM also includes the sparsify utility, which will scan all -files in an ext2 filesystem and ensure that they are maximally -sparse. - -See http://intgat.tigress.co.uk/rmy/uml/index.html for more info. +files in a filesystem and ensure that they are maximally sparse. %prep %setup -q %build export CFLAGS="%{optflags}" -make -%__cc %{optflags} -o sparsify %{SOURCE1} -lext2fs +make %{?_smp_mflags} +gcc %{optflags} -o sparsify %{SOURCE1} -lext2fs %install mkdir -p %{buildroot}%{_bindir} install -s -m 0755 zerofree %{buildroot}%{_bindir}/ install -s -m 0755 sparsify %{buildroot}%{_bindir}/ -install -D -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8/zerofree.8 +install -D -p -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man8/zerofree.8 %files -%defattr(-,root,root) -%doc COPYING +%license COPYING %{_bindir}/sparsify %{_bindir}/zerofree -%{_mandir}/man8/zerofree.8* +%{_mandir}/man8/zerofree.8%{?ext_man} %changelog ++++++ zerofree-1.0.4.tgz -> zerofree-1.1.1.tgz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zerofree-1.0.4/zerofree.c new/zerofree-1.1.1/zerofree.c --- old/zerofree-1.0.4/zerofree.c 2015-10-18 14:12:36.000000000 +0200 +++ new/zerofree-1.1.1/zerofree.c 2018-02-19 09:07:03.000000000 +0100 @@ -1,13 +1,16 @@ /* - * zerofree - a tool to zero free blocks in an ext2 filesystem + * zerofree - a tool to zero free blocks in an ext[2-4] filesystem * - * Copyright (C) 2004-2015 R M Yorston + * Copyright (C) 2004-2017 R M Yorston * * This file may be redistributed under the terms of the GNU General Public * License, version 2. * * Changes: * + * 2017-02-22 Lift call to ext2fs_free_blocks_count out of loop. Suggested + * by Thanassis Tsiodras. + * 2016-02-18 Add support for 64-bit block numbers. * 2015-10-18 Use memcmp. Suggested by Damien Clark. * 2010-10-17 Allow non-zero fill value. Patch from Jacob Nevins. * 2007-08-12 Allow use on filesystems mounted read-only. Patch from @@ -20,6 +23,20 @@ #include <string.h> #include <stdlib.h> +#if defined(EXT2_FLAG_64BITS) +#define FLAGS (EXT2_FLAG_RW|EXT2_FLAG_64BITS) +#define FORMAT "\r%llu/%llu/%llu\n" +#else +#define FLAGS EXT2_FLAG_RW +#define blk64_t blk_t +#define ext2fs_blocks_count(s) ((s)->s_blocks_count) +#define ext2fs_free_blocks_count(s) ((s)->s_free_blocks_count) +#define ext2fs_test_block_bitmap2(m,b) ext2fs_test_block_bitmap(m,b) +#define io_channel_read_blk64(c,b,n,d) io_channel_read_blk(c,b,n,d) +#define io_channel_write_blk64(c,b,n,d) io_channel_write_blk(c,b,n,d) +#define FORMAT "\r%lu/%lu/%lu\n" +#endif + #define USAGE "usage: %s [-n] [-v] [-f fillval] filesystem\n" int main(int argc, char **argv) @@ -27,15 +44,14 @@ errcode_t ret; int flags; int superblock = 0; - int open_flags = EXT2_FLAG_RW; + int open_flags = FLAGS; int blocksize = 0; ext2_filsys fs = NULL; - unsigned long blk; + blk64_t blk, free, modified; unsigned char *buf; unsigned char *empty; int c; - unsigned int free, modified; - double percent; + double percent, freeBlocks; int old_percent; unsigned int fillval = 0; int verbose = 0; @@ -104,12 +120,6 @@ memset(empty, fillval, fs->blocksize); - ret = ext2fs_read_inode_bitmap(fs); - if ( ret ) { - fprintf(stderr, "%s: error while reading inode bitmap\n", argv[0]); - return 1; - } - ret = ext2fs_read_block_bitmap(fs); if ( ret ) { fprintf(stderr, "%s: error while reading block bitmap\n", argv[0]); @@ -118,6 +128,7 @@ free = modified = 0; percent = 0.0; + freeBlocks = (double)ext2fs_free_blocks_count(fs->super); old_percent = -1; if ( verbose ) { @@ -125,23 +136,22 @@ } for ( blk=fs->super->s_first_data_block; - blk < fs->super->s_blocks_count; blk++ ) { + blk < ext2fs_blocks_count(fs->super); blk++ ) { - if ( ext2fs_test_block_bitmap(fs->block_map, blk) ) { + if ( ext2fs_test_block_bitmap2(fs->block_map, blk) ) { continue; } ++free; - percent = 100.0 * (double)free/ - (double)fs->super->s_free_blocks_count; + percent = 100.0 * (double)free/freeBlocks; if ( verbose && (int)(percent*10) != old_percent ) { fprintf(stderr, "\r%4.1f%%", percent); old_percent = (int)(percent*10); } - ret = io_channel_read_blk(fs->io, blk, 1, buf); + ret = io_channel_read_blk64(fs->io, blk, 1, buf); if ( ret ) { fprintf(stderr, "%s: error while reading block\n", argv[0]); return 1; @@ -154,7 +164,7 @@ ++modified; if ( !dryrun ) { - ret = io_channel_write_blk(fs->io, blk, 1, empty); + ret = io_channel_write_blk64(fs->io, blk, 1, empty); if ( ret ) { fprintf(stderr, "%s: error while writing block\n", argv[0]); return 1; @@ -163,7 +173,7 @@ } if ( verbose ) { - printf("\r%u/%u/%u\n", modified, free, fs->super->s_blocks_count); + printf(FORMAT, modified, free, ext2fs_blocks_count(fs->super)); } ret = ext2fs_close(fs);