Hello community,

here is the log from the commit of package duperemove for openSUSE:Factory 
checked in at 2015-03-27 09:41:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/duperemove (Old)
 and      /work/SRC/openSUSE:Factory/.duperemove.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "duperemove"

Changes:
--------
--- /work/SRC/openSUSE:Factory/duperemove/duperemove.changes    2015-03-23 
12:16:59.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.duperemove.new/duperemove.changes       
2015-03-27 09:41:50.000000000 +0100
@@ -1,0 +2,11 @@
+Thu Mar 26 23:07:33 UTC 2015 - [email protected]
+
+- Update to duperemove v0.09.2
+  - Now compiles on SLE11 targets
+  - Fallback to stat on filesystems that don't report file type from
+    readdir
+  - Don't assert on failed open during dedupe
+
+- References: bsc#923277 bsc#924577
+
+-------------------------------------------------------------------

Old:
----
  v0.09.1.tar.gz

New:
----
  v0.09.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ duperemove.spec ++++++
--- /var/tmp/diff_new_pack.rH7soH/_old  2015-03-27 09:41:50.000000000 +0100
+++ /var/tmp/diff_new_pack.rH7soH/_new  2015-03-27 09:41:50.000000000 +0100
@@ -16,10 +16,10 @@
 #
 
 
-%define tar_version 0.09.1
+%define tar_version 0.09.2
 %define samename btrfs-extent-same
 Name:           duperemove
-Version:        0.09.1
+Version:        0.09.2
 Release:        0
 Summary:        Software to find duplicate extents in files and remove them
 License:        GPL-2.0
@@ -52,7 +52,11 @@
     Makefile
 
 %build
+%if %suse_version <= 1200
+make %{?_smp_mflags} CFLAGS="%{optflags} -DNO_BTRFS_HEADER"
+%else
 make %{?_smp_mflags} CFLAGS="%{optflags}"
+%endif
 
 %install
 %make_install

++++++ v0.09.1.tar.gz -> v0.09.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/duperemove-0.09.1/Makefile 
new/duperemove-0.09.2/Makefile
--- old/duperemove-0.09.1/Makefile      2015-03-19 17:25:09.000000000 +0100
+++ new/duperemove-0.09.2/Makefile      2015-03-26 23:51:34.000000000 +0100
@@ -1,4 +1,5 @@
-RELEASE=v0.09.1
+VER=0.09.2
+RELEASE=v$(VER)
 
 CC = gcc
 CFLAGS = -Wall -ggdb
@@ -15,11 +16,11 @@
        $(csum_test_CFILES) $(hash_impl_CFILES)
 HEADERS=csum.h hash-tree.h results-tree.h kernel.h list.h rbtree.h dedupe.h \
        btrfs-ioctl.h filerec.h btrfs-util.h debug.h util.h serialize.h \
-       memstats.h
+       memstats.h fiemap-compat.h
 DIST_SOURCES:=$(DIST_CFILES) $(HEADERS) LICENSE Makefile rbtree.txt README.md \
        TODO $(MANPAGES) SubmittingPatches FAQ.md
-DIST=duperemove-$(RELEASE)
-DIST_TARBALL=$(DIST).tar.gz
+DIST=duperemove-$(VER)
+DIST_TARBALL=$(RELEASE).tar.gz
 TEMP_INSTALL_DIR:=$(shell mktemp -du -p .)
 
 crypt_CFILES=csum-gcrypt.c
@@ -43,8 +44,8 @@
 progs = duperemove hashstats btrfs-extent-same show-shared-extents
 test_progs = csum-test
 
-glib_CFLAGS=$(shell pkg-config --cflags glib-2.0)
-glib_LIBS=$(shell pkg-config --libs glib-2.0)
+glib_CFLAGS=$(shell pkg-config --cflags glib-2.0 gthread-2.0)
+glib_LIBS=$(shell pkg-config --libs glib-2.0 gthread-2.0)
 
 override CFLAGS += -D_FILE_OFFSET_BITS=64 -DVERSTRING=\"$(RELEASE)\" \
        $(crypt_CFLAGS) $(glib_CFLAGS) -rdynamic
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/duperemove-0.09.1/btrfs-util.c 
new/duperemove-0.09.2/btrfs-util.c
--- old/duperemove-0.09.1/btrfs-util.c  2015-03-19 17:25:09.000000000 +0100
+++ new/duperemove-0.09.2/btrfs-util.c  2015-03-26 23:51:34.000000000 +0100
@@ -24,11 +24,30 @@
 #include <errno.h>
 #include <string.h>
 #include <linux/magic.h>
+#ifndef        NO_BTRFS_HEADER
 #include <linux/btrfs.h>
+#endif
+#include <sys/ioctl.h>
 
 #include "btrfs-util.h"
 #include "debug.h"
 
+#ifdef NO_BTRFS_HEADER
+#ifndef        __u64
+#define        __u64   uint64_t
+#endif
+#define BTRFS_IOCTL_MAGIC 0x94
+
+#define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \
+                                  struct btrfs_ioctl_ino_lookup_args)
+#define BTRFS_INO_LOOKUP_PATH_MAX 4080
+struct btrfs_ioctl_ino_lookup_args {
+       __u64 treeid;
+       __u64 objectid;
+       char name[BTRFS_INO_LOOKUP_PATH_MAX];
+};
+#endif
+
 /* For some reason linux/btrfs.h doesn't define this. */
 #define        BTRFS_FIRST_FREE_OBJECTID       256ULL
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/duperemove-0.09.1/duperemove.c 
new/duperemove-0.09.2/duperemove.c
--- old/duperemove-0.09.1/duperemove.c  2015-03-19 17:25:09.000000000 +0100
+++ new/duperemove-0.09.2/duperemove.c  2015-03-26 23:51:34.000000000 +0100
@@ -36,6 +36,8 @@
 
 #include <glib.h>
 
+#include "fiemap-compat.h"
+
 #include "rbtree.h"
 #include "list.h"
 #include "csum.h"
@@ -49,6 +51,29 @@
 #include "memstats.h"
 #include "debug.h"
 
+#if GLIB_CHECK_VERSION(2,32,0)
+/* See below for why we do this */
+#define        glib2_mutex_lock        g_mutex_lock
+#define        glib2_mutex_unlock      g_mutex_lock
+#define        glib2_init_threads()
+#else
+/*
+ * SLE11 ships an old glib2 without gmutex. Mutex usage here is
+ * trivial and we can substitute g_static_mutex directly where g_mutex
+ * doesn't exist.
+ */
+#define USE_STATIC_MUTEX
+#include <glib/gthread.h>
+/*
+ * g_mutex_lock and g_mutex_unlock are defined (but not exported to
+ * user) and actually used in the g_static_mutex_* macros. Using our
+ * own prefix avoids linker errors.
+ */
+#define glib2_mutex_lock       g_static_mutex_lock
+#define glib2_mutex_unlock     g_static_mutex_unlock
+#define        glib2_init_threads()    g_thread_init(NULL)
+#endif
+
 /* exported via debug.h */
 int verbose = 0, debug = 0;
 
@@ -287,8 +312,14 @@
                         * most recent extent off the list and re-add
                         * that. The old extent won't be deduped again
                         * but this one will.
+                        *
+                        * This won't work if we haven't deduped
+                        * anything yet. If prev doesn't exist, we
+                        * skip this and let the dedupe code below
+                        * clean up for us.
                         */
-                       abort_on(!prev);
+                       if (prev == NULL)
+                               goto run_dedupe;
                        to_add = prev; /* The ole' extent switcharoo */
                }
                prev = extent; /* save previous extent for condition above */
@@ -311,9 +342,9 @@
 run_dedupe:
 
                /*
-                * We can get here with only the target extent (0 queued) if
-                * filerec_open_list fails on the 2nd (and last)
-                * extent.
+                * We can get here with only the target extent (0
+                * queued) for many reasons. Skip the dedupe in that
+                * case but always do cleanup.
                 */
                if (ctxt->num_queued) {
                        printf("Dedupe %d extents with target: (%s, %s), "
@@ -416,7 +447,11 @@
        assert(digest != NULL);
        static long long unsigned cur_num_filerecs = 0;
 
+#ifdef USE_STATIC_MUTEX
+       GStaticMutex *tree_mutex = g_dataset_get_data(tree, "mutex");
+#else
        GMutex *tree_mutex = g_dataset_get_data(tree, "mutex");
+#endif
 
        printf("csum: %s \t[%llu/%llu]\n", file->filename,
               __sync_add_and_fetch(&cur_num_filerecs, 1), num_filerecs);
@@ -481,9 +516,9 @@
 
                checksum_block(buf, bytes, digest);
 
-               g_mutex_lock(tree_mutex);
+               glib2_mutex_lock(tree_mutex);
                ret = insert_hashed_block(tree, digest, file, off, flags);
-               g_mutex_unlock(tree_mutex);
+               glib2_mutex_unlock(tree_mutex);
                if (ret)
                        break;
 
@@ -514,7 +549,7 @@
                strerror(ret),
                file->filename);
 
-       g_mutex_lock(tree_mutex);
+       glib2_mutex_lock(tree_mutex);
        remove_hashed_blocks(tree, file);
        /*
         * filerec_free will remove from the filerec tree keep it
@@ -522,7 +557,7 @@
         * filerec.c
         */
        filerec_free(file);
-       g_mutex_unlock(tree_mutex);
+       glib2_mutex_unlock(tree_mutex);
 
        return;
 }
@@ -531,13 +566,21 @@
 {
        int ret = 0;
        struct filerec *file, *tmp;
+#ifdef USE_STATIC_MUTEX
+       GStaticMutex tree_mutex = G_STATIC_MUTEX_INIT;
+#else
        GMutex tree_mutex;
+#endif
        GError *err = NULL;
        GThreadPool *pool;
 
+#ifdef USE_STATIC_MUTEX
+       g_dataset_set_data(tree, "mutex", &tree_mutex);
+#else
        g_mutex_init(&tree_mutex);
        g_dataset_set_data_full(tree, "mutex", &tree_mutex,
                                (GDestroyNotify) g_mutex_clear);
+#endif
 
        if (!hash_threads) {
 #if GLIB_CHECK_VERSION(2,36,0)
@@ -1255,6 +1298,8 @@
        struct results_tree res;
        struct filerec *file;
 
+       glib2_init_threads();
+
        if (init_hash())
                return ENOMEM;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/duperemove-0.09.1/fiemap-compat.h 
new/duperemove-0.09.2/fiemap-compat.h
--- old/duperemove-0.09.1/fiemap-compat.h       1970-01-01 01:00:00.000000000 
+0100
+++ new/duperemove-0.09.2/fiemap-compat.h       2015-03-26 23:51:34.000000000 
+0100
@@ -0,0 +1,9 @@
+#ifndef        __FIEMAP_COMPAT__
+#define        __FIEMAP_COMPAT__
+
+#ifndef        FIEMAP_EXTENT_SHARED
+#define FIEMAP_EXTENT_SHARED           0x00002000 /* Space shared with other
+                                                   * files. */
+#endif
+
+#endif /* __FIEMAP_COMPAT__ */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/duperemove-0.09.1/filerec.c 
new/duperemove-0.09.2/filerec.c
--- old/duperemove-0.09.1/filerec.c     2015-03-19 17:25:09.000000000 +0100
+++ new/duperemove-0.09.2/filerec.c     2015-03-26 23:51:34.000000000 +0100
@@ -15,6 +15,8 @@
 #include <linux/fs.h>
 #include <linux/fiemap.h>
 
+#include "fiemap-compat.h"
+
 #include "kernel.h"
 #include "rbtree.h"
 #include "list.h"

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to