[packages/vdo/DEVEL-8] - up to 8.1.1.360; no vdo utility (required for libblockdev vdo support)

qboosh qboosh at pld-linux.org
Wed May 11 19:07:05 CEST 2022


commit afcfd2fd84f279a2c36682186be90ea3c4041677
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed May 11 19:07:22 2022 +0200

    - up to 8.1.1.360; no vdo utility (required for libblockdev vdo support)

 vdo-types.patch | 218 ++++++++++++++++++--------------------------------------
 vdo-x86.patch   |  37 ++++++----
 vdo.spec        |  28 ++------
 3 files changed, 95 insertions(+), 188 deletions(-)
---
diff --git a/vdo.spec b/vdo.spec
index a996dda..61acfe7 100644
--- a/vdo.spec
+++ b/vdo.spec
@@ -1,13 +1,13 @@
 Summary:	Management tools for Virtual Data Optimizer
 Summary(pl.UTF-8):	Narzędzia do zarządzania podsystemem Virtual Data Optimizer
 Name:		vdo
-Version:	6.2.6.14
+Version:	8.1.1.360
 Release:	1
 License:	GPL v2
 Group:		Applications/System
 #Source0Download: https://github.com/dm-vdo/vdo/releases
 Source0:	https://github.com/dm-vdo/vdo/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	87b3e16edb83fc582f94c7a5fd208628
+# Source0-md5:	b228f789ad7bcc645572129209934096
 Patch0:		%{name}-x86.patch
 Patch1:		%{name}-types.patch
 URL:		http://github.com/dm-vdo/vdo
@@ -77,8 +77,6 @@ VDO.
 %patch0 -p1
 %patch1 -p1
 
-%{__sed} -i -e "s,'/usr/libexec','%{_libexecdir}'," vdo-manager/vdomgmnt/Defaults.py
-
 %build
 %{__make} \
 	CC="%{__cc}" \
@@ -90,18 +88,11 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT \
 	INSTALLOWNER= \
-	UDEVDIR=$RPM_BUILD_ROOT/lib/udev/rules.d \
 	bindir=%{_bindir} \
 	defaultdocdir=%{_docdir} \
-	libexecdir=%{_libexecdir} \
-	python3_sitelib=%{py3_sitescriptdir} \
 	mandir=%{_mandir} \
-	unitdir=%{systemdunitdir} \
 	sysconfdir=%{_sysconfdir}
 
-%py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}
-%py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}
-
 # packaged as %doc
 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
 
@@ -120,32 +111,21 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc CONTRIBUTORS.txt README.md examples/{ansible,monitor}
-%attr(755,root,root) %{_bindir}/vdo
-%attr(755,root,root) %{_bindir}/vdo-by-dev
-%attr(755,root,root) %{_bindir}/vdostats
 %attr(755,root,root) %{_bindir}/vdodmeventd
 %attr(755,root,root) %{_bindir}/vdodumpconfig
 %attr(755,root,root) %{_bindir}/vdoforcerebuild
 %attr(755,root,root) %{_bindir}/vdoformat
 %attr(755,root,root) %{_bindir}/vdosetuuid
-%attr(755,root,root) %{_libexecdir}/vdoprepareforlvm
-%{py3_sitescriptdir}/%{name}
-%{systemdunitdir}/vdo.service
-%{systemdunitdir}/vdo-start-by-dev at .service
-/lib/systemd/system-preset/97-vdo.preset
-/lib/udev/rules.d/69-vdo-start-by-dev.rules
-%{_mandir}/man8/vdo.8*
-%{_mandir}/man8/vdostats.8*
+%attr(755,root,root) %{_bindir}/vdostats
 %{_mandir}/man8/vdodmeventd.8*
 %{_mandir}/man8/vdodumpconfig.8*
 %{_mandir}/man8/vdoforcerebuild.8*
 %{_mandir}/man8/vdoformat.8*
-%{_mandir}/man8/vdoprepareforlvm.8*
 %{_mandir}/man8/vdosetuuid.8*
+%{_mandir}/man8/vdostats.8*
 
 %files -n bash-completion-vdo
 %defattr(644,root,root,755)
-/etc/bash_completion.d/vdo
 /etc/bash_completion.d/vdostats
 
 %files support
diff --git a/vdo-types.patch b/vdo-types.patch
index cb99562..e163f32 100644
--- a/vdo-types.patch
+++ b/vdo-types.patch
@@ -1,168 +1,86 @@
---- vdo-6.2.3.91/utils/uds/fileIORegion.c.orig	2020-05-30 04:20:46.000000000 +0200
-+++ vdo-6.2.3.91/utils/uds/fileIORegion.c	2020-06-01 06:23:23.271248367 +0200
-@@ -65,7 +65,7 @@
- 
-   if (offset + length > fior->size) {
-     return logErrorWithStringError(UDS_OUT_OF_RANGE,
--                                   "range %zd-%zd not in range 0 to %zu",
-+                                   "range %"PRId64"-%"PRId64" not in range 0 to %zu",
-                                    offset, offset + length, fior->size);
-   }
- 
---- vdo-6.2.3.91/utils/uds/indexLayout.c.orig	2020-05-30 04:20:46.000000000 +0200
-+++ vdo-6.2.3.91/utils/uds/indexLayout.c	2020-06-01 06:25:49.170457963 +0200
-@@ -955,7 +955,7 @@
-   }
-   if (iter.nextRegion != iter.lastRegion) {
-     return logErrorWithStringError(UDS_UNEXPECTED_RESULT,
--                                   "expected %ld additional regions",
-+                                   "expected %td additional regions",
-                                    iter.lastRegion - iter.nextRegion);
-   }
-   if (iter.nextBlock != isl->indexSave.startBlock + isl->indexSave.numBlocks) {
---- vdo-6.2.3.91/utils/uds/threadsLinuxUser.c.orig	2020-05-30 04:20:46.000000000 +0200
-+++ vdo-6.2.3.91/utils/uds/threadsLinuxUser.c	2020-06-01 06:28:58.816097231 +0200
-@@ -112,7 +112,7 @@
- int joinThreads(pthread_t th)
- {
-   int result = pthread_join(th, NULL);
--  return ASSERT_WITH_ERROR_CODE((result == 0), result, "th: %zu", th);
-+  return ASSERT_WITH_ERROR_CODE((result == 0), result, "th: %lu", th);
- }
- 
- /**********************************************************************/
---- vdo-6.2.3.91/utils/uds/timeUtils.c.orig	2020-05-30 04:20:46.000000000 +0200
-+++ vdo-6.2.3.91/utils/uds/timeUtils.c	2020-06-01 06:31:48.701843548 +0200
-@@ -69,7 +69,7 @@
-   if (!isValidTime(time)) {
-     return time;
-   }
--  if ((reltime >= 0) && (reltime < 10 * BILLION)) {
-+  if ((reltime >= 0) && (reltime < 10LL * BILLION)) {
-     reltime += time.tv_nsec;
-     while (reltime >= BILLION) {
-       reltime -= BILLION;
-@@ -80,7 +80,7 @@
-   }
-   // may not be accurate for times before the Epoch...
-   // (is the ns time positive or negative for negative time_t?)
--  int64_t ns = time.tv_sec * BILLION + time.tv_nsec;
-+  int64_t ns = (int64_t)time.tv_sec * BILLION + time.tv_nsec;
-   if ((ns < INT64_MIN / 2) ||
-       (ns > INT64_MAX / 2) ||
-       (reltime < INT64_MIN / 2) ||
-@@ -130,8 +130,8 @@
- RelTime timeDifference(AbsTime a, AbsTime b)
- {
-   if (isValidTime(a) && isValidTime(b)) {
--    int64_t ans = a.tv_sec * BILLION + a.tv_nsec;
--    int64_t bns = b.tv_sec * BILLION + b.tv_nsec;
-+    int64_t ans = (int64_t)a.tv_sec * BILLION + a.tv_nsec;
-+    int64_t bns = (int64_t)b.tv_sec * BILLION + b.tv_nsec;
-     return ans - bns;
-   } else if (isValidTime(a)) {
-     return INT64_MAX;
---- vdo-6.2.3.91/utils/vdo/user/fileLayer.c.orig	2020-05-30 04:20:46.000000000 +0200
-+++ vdo-6.2.3.91/utils/vdo/user/fileLayer.c	2020-06-01 07:08:45.456501024 +0200
-@@ -291,8 +291,8 @@
+--- vdo-8.1.1.360/utils/uds/indexLayout.c.orig	2022-05-10 20:18:46.864955066 +0200
++++ vdo-8.1.1.360/utils/uds/indexLayout.c	2022-05-10 20:25:11.562870979 +0200
+@@ -1086,7 +1086,7 @@ reconstruct_index_save(struct index_save
+ 	}
+ 	if (iter.next_region != iter.last_region) {
+ 		return uds_log_error_strerror(UDS_UNEXPECTED_RESULT,
+-					      "expected %ld additional regions",
++					      "expected %td additional regions",
+ 					      iter.last_region - iter.next_region);
+ 	}
+ 	if (iter.next_block !=
+--- vdo-8.1.1.360/utils/vdo/fileLayer.c.orig	2022-05-10 20:28:20.068516423 +0200
++++ vdo-8.1.1.360/utils/vdo/fileLayer.c	2022-05-10 20:28:23.371831860 +0200
+@@ -359,8 +359,8 @@ static int setupFileLayer(const char
      layer->blockCount = deviceBlocks;
    } else if (layer->blockCount != deviceBlocks) {
-     result = logErrorWithStringError(VDO_PARAMETER_MISMATCH,
--                                     "physical size %ld 4k blocks must match"
--                                     " physical size %ld 4k blocks of %s",
-+                                     "physical size %"PRId64" 4k blocks must match"
-+                                     " physical size %"PRId64" 4k blocks of %s",
-                                      layer->blockCount, deviceBlocks,
-                                      layer->name);
-     tryCloseFile(layer->fd);
---- vdo-6.2.3.91/utils/vdo/user/vdodebugmetadata.c.orig	2020-05-30 04:20:46.000000000 +0200
-+++ vdo-6.2.3.91/utils/vdo/user/vdodebugmetadata.c	2020-06-01 07:11:47.872179460 +0200
-@@ -320,7 +320,7 @@
-   result = layer->allocateIOBuffer(layer, journalBytes,
-                                    "recovery journal", &rawJournalBytes);
-   if (result != VDO_SUCCESS) {
--    errx(1, "Could not allocate %" PRIu64" bytes for the journal",
-+    errx(1, "Could not allocate %zu bytes for the journal",
-          journalBytes);
-   }
- 
-@@ -614,14 +614,14 @@
-   char *filename;
-   int result = ALLOCATE(MAX_PBNS, PhysicalBlockNumber, __func__, &pbns);
-   if (result != VDO_SUCCESS) {
--    errx(1, "Could not allocate %" PRIu64 " bytes",
-+    errx(1, "Could not allocate %zu bytes",
-          sizeof(PhysicalBlockNumber) * MAX_PBNS);
-   }
- 
-   result = ALLOCATE(MAX_SEARCH_LBNS, LogicalBlockNumber, __func__,
-                     &searchLBNs);
-   if (result != VDO_SUCCESS) {
--    errx(1, "Could not allocate %" PRIu64 " bytes",
-+    errx(1, "Could not allocate %zu bytes",
-          sizeof(LogicalBlockNumber) * MAX_SEARCH_LBNS);
-   }
- 
---- vdo-6.2.3.91/utils/vdo/user/vdodumpmetadata.c.orig	2020-05-30 04:20:46.000000000 +0200
-+++ vdo-6.2.3.91/utils/vdo/user/vdodumpmetadata.c	2020-06-01 07:12:18.685345864 +0200
-@@ -350,7 +350,7 @@
- {
-   int result = ALLOCATE(MAX_LBNS, PhysicalBlockNumber, __func__, &lbns);
-   if (result != VDO_SUCCESS) {
--    errx(1, "Could not allocate %" PRIu64 " bytes",
-+    errx(1, "Could not allocate %zu bytes",
-          sizeof(PhysicalBlockNumber) * MAX_LBNS);
-   }
- 
---- vdo-6.2.3.91/utils/vdo/user/vdolistmetadata.c.orig	2020-05-30 04:20:46.000000000 +0200
-+++ vdo-6.2.3.91/utils/vdo/user/vdolistmetadata.c	2020-06-01 07:12:54.471818659 +0200
-@@ -115,7 +115,7 @@
-                        PhysicalBlockNumber  startBlock,
-                        BlockCount           count)
+     result = uds_log_error_strerror(VDO_PARAMETER_MISMATCH,
+-                                    "physical size %ld 4k blocks must match"
+-                                    " physical size %ld 4k blocks of %s",
++                                    "physical size %"PRId64" 4k blocks must match"
++                                    " physical size %"PRId64" 4k blocks of %s",
+                                     layer->blockCount, deviceBlocks,
+                                     layer->name);
+     try_close_file(layer->fd);
+--- vdo-8.1.1.360/utils/vdo/vdolistmetadata.c.orig	2022-05-10 20:38:49.821771423 +0200
++++ vdo-8.1.1.360/utils/vdo/vdolistmetadata.c	2022-05-10 20:38:54.738411454 +0200
+@@ -116,7 +116,7 @@ static void listBlocks(const char
+                        physical_block_number_t  startBlock,
+                        block_count_t            count)
  {
 -  printf("%ld .. %ld: %s\n", startBlock, startBlock + count - 1, label);
 +  printf("%"PRId64" .. %"PRId64": %s\n", startBlock, startBlock + count - 1, label);
  }
  
  /**********************************************************************/
---- vdo-6.2.3.91/utils/vdo/user/vdoregenerategeometry.c.orig	2020-05-30 04:20:46.000000000 +0200
-+++ vdo-6.2.3.91/utils/vdo/user/vdoregenerategeometry.c	2020-06-01 07:14:56.551157299 +0200
-@@ -89,7 +89,7 @@
+--- vdo-8.1.1.360/utils/vdo/vdoregenerategeometry.c.orig	2022-05-10 20:40:40.487838560 +0200
++++ vdo-8.1.1.360/utils/vdo/vdoregenerategeometry.c	2022-05-10 20:40:43.144490835 +0200
+@@ -89,7 +89,7 @@ static Candidate      candidates[UDS_CON
  static int            candidateCount = 0;
  
  static char   *fileName = NULL;
 -static size_t  offset   = 0;
-+static uint64_t  offset = 0;
++static uint64_t offset  = 0;
  
  /**
   * Explain how this command-line tool is used.
---- vdo-6.2.6.14/utils/vdo/user/vdoprepareforlvm.c.orig	2022-02-11 01:31:42.000000000 +0100
-+++ vdo-6.2.6.14/utils/vdo/user/vdoprepareforlvm.c	2022-05-09 21:50:35.553180915 +0200
-@@ -22,6 +22,7 @@
- #include <err.h>
- #include <fcntl.h>
- #include <getopt.h>
-+#include <inttypes.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
-@@ -200,7 +201,7 @@ static int convertUDS(IndexConfig    *in
-   udsConfigurationSetNonce(udsConfig, geometry.nonce);
+--- vdo-8.1.1.360/utils/vdo/messageStatsReader.c.orig	2022-02-12 21:47:10.000000000 +0100
++++ vdo-8.1.1.360/utils/vdo/messageStatsReader.c	2022-05-10 21:07:02.595934211 +0200
+@@ -37,7 +37,7 @@ static int skip_string(char **buf, char
+ static int read_uint64_t(char **buf,
+ 			 uint64_t *value)
+ {
+-	int count = sscanf(*buf, "%lu, ", value);
++	int count = sscanf(*buf, "%"PRIu64", ", value);
+ 	if (count != 1) {
+ 		return VDO_UNEXPECTED_EOF;
+ 	}
+@@ -59,7 +59,7 @@ static int read_uint32_t(char **buf,
+ static int read_block_count_t(char **buf,
+ 			      block_count_t *value)
+ {
+-	int count = sscanf(*buf, "%lu, ", value);
++	int count = sscanf(*buf, "%"PRIu64", ", value);
+ 	if (count != 1) {
+ 		return VDO_UNEXPECTED_EOF;
+ 	}
+--- vdo-8.1.1.360/utils/vdo/vdoStatsWriter.c.orig	2022-02-12 21:47:10.000000000 +0100
++++ vdo-8.1.1.360/utils/vdo/vdoStatsWriter.c	2022-05-10 21:10:54.824676120 +0200
+@@ -60,7 +60,7 @@ static int write_block_count_t(char *lab
  
-   off_t startByte = geometry.regions[INDEX_REGION].startBlock * VDO_BLOCK_SIZE;
--  result = asprintf(&indexName, "%s offset=%ld", fileName, startByte);
-+  result = asprintf(&indexName, "%s offset=%"PRId64, fileName, (uint64_t)startByte);
-   if (result == -1) {
-     udsFreeConfiguration(udsConfig);
-     return ENOMEM;
-@@ -510,8 +511,8 @@ static int performDeviceConversion(void)
-   cleanup(vdo, layer);
-   close(fd);
+ 	maxLabelLength = max(maxLabelLength, (int) strlen(label));
  
--  printf("Conversion completed for '%s': VDO is now offset by %ld bytes\n",
--         fileName, vdoByteOffset);
-+  printf("Conversion completed for '%s': VDO is now offset by %"PRId64" bytes\n",
-+         fileName, (uint64_t)vdoByteOffset);
+-	count = sprintf(values[fieldCount++], "%lu", value);
++	count = sprintf(values[fieldCount++], "%"PRIu64, value);
+ 	if (count < 0) {
+ 		return VDO_UNEXPECTED_EOF;
+ 	}
+@@ -77,7 +77,7 @@ static int write_uint64_t(char *label, u
  
-   return result;
- }
+ 	maxLabelLength = max(maxLabelLength, (int) strlen(label));
+ 
+-	count = sprintf(values[fieldCount++], "%lu", value);
++	count = sprintf(values[fieldCount++], "%"PRIu64, value);
+ 	if (count < 0) {
+ 		return VDO_UNEXPECTED_EOF;
+ 	}
diff --git a/vdo-x86.patch b/vdo-x86.patch
index 6618347..6967ccc 100644
--- a/vdo-x86.patch
+++ b/vdo-x86.patch
@@ -1,17 +1,17 @@
---- vdo-6.2.3.91/utils/uds/cpu.h.orig	2020-05-30 04:20:46.000000000 +0200
-+++ vdo-6.2.3.91/utils/uds/cpu.h	2020-05-31 22:25:52.049798685 +0200
+--- vdo-8.1.1.360/utils/uds/cpu.h.orig	2022-05-10 09:00:13.892182837 +0200
++++ vdo-8.1.1.360/utils/uds/cpu.h	2022-05-10 20:17:03.618847732 +0200
 @@ -36,7 +36,7 @@
  #define CACHE_LINE_BYTES 128
  #elif defined(__s390x__)
  #define CACHE_LINE_BYTES 256
 -#elif defined(__x86_64__) || defined(__aarch64__)
 +#elif defined(__x86_64__) || defined(__i386__) || defined(__aarch64__)
- #define CACHE_LINE_BYTES  64
+ #define CACHE_LINE_BYTES 64
  #else
  #error "unknown cache line size"
---- vdo-6.2.3.91/utils/uds/atomicDefs.h.orig	2020-05-30 04:20:46.000000000 +0200
-+++ vdo-6.2.3.91/utils/uds/atomicDefs.h	2020-05-31 22:27:07.692722226 +0200
-@@ -81,7 +81,7 @@
+--- vdo-8.1.1.360/utils/uds/atomicDefs.h.orig	2022-02-12 21:47:10.000000000 +0100
++++ vdo-8.1.1.360/utils/uds/atomicDefs.h	2022-05-10 20:17:51.798586720 +0200
+@@ -82,7 +82,7 @@ static INLINE void barrier(void)
   **/
  static INLINE void smp_mb(void)
  {
@@ -20,7 +20,7 @@
    /*
     * X86 full fence. Supposedly __sync_synchronize() will do this, but
     * either the GCC documentation is a lie or GCC is broken.
-@@ -112,7 +112,7 @@
+@@ -113,7 +113,7 @@ static INLINE void smp_mb(void)
   **/
  static INLINE void smp_rmb(void)
  {
@@ -29,7 +29,7 @@
    // XXX The implementation on x86 is more aggressive than necessary.
    __asm__ __volatile__("lfence" : : : "memory");
  #elif defined __aarch64__
-@@ -137,7 +137,7 @@
+@@ -138,7 +138,7 @@ static INLINE void smp_rmb(void)
   **/
  static INLINE void smp_wmb(void)
  {
@@ -38,12 +38,21 @@
    // XXX The implementation on x86 is more aggressive than necessary.
    __asm__ __volatile__("sfence" : : : "memory");
  #elif defined __aarch64__
-@@ -171,7 +171,7 @@
+@@ -158,7 +158,7 @@ static INLINE void smp_wmb(void)
   **/
- static INLINE void smp_read_barrier_depends(void)
+ static INLINE void smp_mb__before_atomic(void)
  {
--#if defined(__x86_64__) || defined(__PPC__) || defined(__s390__) \
-+#if defined(__x86_64__) || defined(__i386__) || defined(__PPC__) || defined(__s390__) \
-   || defined(__aarch64__)
-   // Nothing needed for these architectures.
+-#if defined(__x86_64__) || defined(__s390__)
++#if defined(__x86_64__) || defined(__i386__) || defined(__s390__)
+   // Atomic operations are already serializing on x86 and s390
+   barrier();
+ #else
+@@ -172,7 +172,7 @@ static INLINE void smp_mb__before_atomic
+  **/
+ static INLINE void smp_mb__after_atomic(void)
+ {
+-#if defined(__x86_64__) || defined(__s390__)
++#if defined(__x86_64__) || defined(__i386__) || defined(__s390__)
+   // Atomic operations are already serializing on x86 and s390
+   barrier();
  #else
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/vdo.git/commitdiff/afcfd2fd84f279a2c36682186be90ea3c4041677



More information about the pld-cvs-commit mailing list