Skip to content

Commit

Permalink
Version 6.2.5.74
Browse files Browse the repository at this point in the history
- Renamed vdo2LVM to vdopreparelvm and moved its installation location to
  /usr/libexec so that it is not in common default paths as this utility is
  intended to be called from LVM, not directly by users.
  • Loading branch information
corwin committed Aug 20, 2021
1 parent 9aae29d commit c658747
Show file tree
Hide file tree
Showing 14 changed files with 115 additions and 80 deletions.
2 changes: 1 addition & 1 deletion utils/uds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# UDS interfaces exported from libuds.so. DISTRIBUTION_VERSION is the long
# version name used in distribution builds. We extract these values from the
# traditional location.
UDS_VERSION = 8.0.3.36
UDS_VERSION = 8.0.3.39
BUILD_VERSION = $(UDS_VERSION)
DISTRO_CODENAME := $(shell lsb_release -s -c)

Expand Down
9 changes: 5 additions & 4 deletions utils/uds/indexLayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* $Id: //eng/uds-releases/jasper/src/uds/indexLayout.c#27 $
* $Id: //eng/uds-releases/jasper/src/uds/indexLayout.c#28 $
*/

#include "indexLayout.h"
Expand Down Expand Up @@ -118,7 +118,7 @@ typedef struct superBlockData_v1 {
byte magicLabel[32];
byte nonceInfo[32];
uint64_t nonce;
uint32_t version; // 2 or 3 for normal, 6 or 7 for converted
uint32_t version; // 2 or 3 for normal, 7 for converted
uint32_t blockSize; // for verification
uint16_t numIndexes; // always 1
uint16_t maxSaves;
Expand Down Expand Up @@ -185,7 +185,7 @@ static int writeIndexSaveLayout(IndexLayout *layout, IndexSaveLayout *isl)
/*****************************************************************************/
static INLINE bool isConvertedSuperBlock(SuperBlockData *super)
{
return super->version == 6 || super->version == 7;
return (super->version == 7);
}

/*****************************************************************************/
Expand Down Expand Up @@ -580,6 +580,7 @@ static int readSuperBlockData(BufferedReader *reader,
if ((super->version < SUPER_VERSION_MINIMUM)
|| (super->version == 4)
|| (super->version == 5)
|| (super->version == 6)
|| (super->version > SUPER_VERSION_MAXIMUM)) {
return logErrorWithStringError(UDS_UNSUPPORTED_VERSION,
"unknown superblock version number %"
Expand Down Expand Up @@ -2505,7 +2506,7 @@ int updateLayout(IndexLayout *layout,
layout->index.subIndex.numBlocks -= offsetBlocks;
layout->index.volume.numBlocks -= offsetBlocks;
layout->totalBlocks -= offsetBlocks;
layout->super.version = (layout->super.version < 3) ? 6 : 7;
layout->super.version = 7;
result = saveSingleFileLayout(layout, offsetBlocks);
if (result == UDS_SUCCESS) {
result = writeIndexConfig(layout, config, offsetBlocks);
Expand Down
27 changes: 23 additions & 4 deletions utils/uds/indexSession.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* $Id: //eng/uds-releases/jasper/src/uds/indexSession.c#10 $
* $Id: //eng/uds-releases/jasper/src/uds/indexSession.c#11 $
*/

#include "indexSession.h"
Expand Down Expand Up @@ -216,6 +216,7 @@ int makeEmptyIndexSession(struct uds_index_session **indexSessionPtr)
int udsSuspendIndexSession(struct uds_index_session *session, bool save)
{
int result;
bool flushIndex = false;
bool saveIndex = false;
bool suspendIndex = false;
lockMutex(&session->requestMutex);
Expand All @@ -233,13 +234,21 @@ int udsSuspendIndexSession(struct uds_index_session *session, bool save)
suspendIndex = true;
result = UDS_SUCCESS;
} else if (!(session->state & IS_FLAG_LOADED)) {
session->state |= IS_FLAG_SUSPENDED;
broadcastCond(&session->requestCond);
if (session->router != NULL) {
flushIndex = true;
session->state |= IS_FLAG_WAITING;
} else {
session->state |= IS_FLAG_SUSPENDED;
broadcastCond(&session->requestCond);
}
result = UDS_SUCCESS;
} else {
saveIndex = save;
if (saveIndex) {
session->state |= IS_FLAG_WAITING;
} else if (session->router != NULL) {
flushIndex = true;
session->state |= IS_FLAG_WAITING;
} else {
session->state |= IS_FLAG_SUSPENDED;
broadcastCond(&session->requestCond);
Expand All @@ -248,7 +257,17 @@ int udsSuspendIndexSession(struct uds_index_session *session, bool save)
}
unlockMutex(&session->requestMutex);

if (!saveIndex && !suspendIndex) {
if (!saveIndex && !suspendIndex && !flushIndex) {
return result;
}

if (flushIndex) {
result = udsFlushIndexSession(session);
lockMutex(&session->requestMutex);
session->state &= ~IS_FLAG_WAITING;
session->state |= IS_FLAG_SUSPENDED;
broadcastCond(&session->requestCond);
unlockMutex(&session->requestMutex);
return result;
}

Expand Down
28 changes: 17 additions & 11 deletions utils/uds/indexVersion.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* $Id: //eng/uds-releases/jasper/src/uds/indexVersion.c#3 $
* $Id: //eng/uds-releases/jasper/src/uds/indexVersion.c#4 $
*/

#include "indexVersion.h"
Expand All @@ -43,20 +43,26 @@ void initializeIndexVersion(struct index_version *version,
* Version 3 was created when we discovered the the chapter index headers
* were written in native endian format. It was first used in RHEL8.2 and is
* the current version for new indices.
*
* Versions before 3 read and write native endian chapter headers. Version 3
* reads chapter headers in any endian order, and writes little-endian
* chapter headers.
*/

/*
* Versions 6 and 7 are equivalent to versions 2 and 3
* respectively, after the volume has been reduced in size by
* one chapter in order to make room to prepend LVM metadata
* to an existing VDO without losing all deduplication.
* Versions 4 through 6 were incremental development versions and are not
* supported.
*/

/*
* Version 7 is equivalent to version 3, after the volume has been reduced
* in size by one chapter in order to make room to prepend LVM metadata to
* an existing VDO without losing all deduplication.
*/
bool chapterIndexHeaderNativeEndian =
(superVersion < 3) || (superVersion == 6);

/*
* Versions before 3 read and write native endian chapter headers.
* Versions 3 and after read chapter headers in any endian order, and write
* little-endian chapter headers.
*/

bool chapterIndexHeaderNativeEndian = (superVersion < 3);
*version = (struct index_version) {
.chapterIndexHeaderNativeEndian = chapterIndexHeaderNativeEndian,
};
Expand Down
2 changes: 1 addition & 1 deletion utils/vdo/base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# $Id: //eng/vdo-releases/aluminum/src/packaging/src-dist/user/utils/vdo/base/Makefile#2 $

VDO_VERSION = 6.2.5.65
VDO_VERSION = 6.2.5.74

UDS_DIR = ../../uds

Expand Down
26 changes: 16 additions & 10 deletions utils/vdo/user/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
# 02110-1301, USA.
#

# $Id: //eng/vdo-releases/aluminum/src/packaging/src-dist/user/utils/vdo/user/Makefile#14 $
# $Id: //eng/vdo-releases/aluminum/src/packaging/src-dist/user/utils/vdo/user/Makefile#16 $

VDO_VERSION = 6.2.5.65
VDO_VERSION = 6.2.5.74

UDS_DIR = ../../uds
VDO_BASE_DIR = ../base
Expand Down Expand Up @@ -81,11 +81,7 @@ USER_OBJS = blockMapUtils.o \
vdoConfig.o \
vdoVolumeUtils.o

# To add a new program X, add X to the variable PROGS (and possibly
# also DIST_PROGS).

PROGS = vdo2lvm \
vdoaudit \
PROGS = vdoaudit \
vdodebugmetadata \
vdodmeventd \
vdodumpblockmap \
Expand All @@ -98,18 +94,22 @@ PROGS = vdo2lvm \
vdoregenerategeometry \
vdosetuuid

LIBPROGS = vdoprepareforlvm

ALLPROGS = $(PROGS) $(LIBPROGS)

DMEVENT_LIB = libdevmapper-event-lvm2vdo.so

.PHONY: all
all: $(PROGS)
all: $(ALLPROGS)
$(MAKE) -C man all

.PHONY: clean
clean:
$(MAKE) -C man clean
rm -f *.a *.so *.o core*
rm -fr $(DEPDIR) tmpdir
rm -f $(PROGS)
rm -f $(ALLPROGS)

libuser.a: $(USER_OBJS)
$(RM) $@
Expand All @@ -118,14 +118,20 @@ libuser.a: $(USER_OBJS)
INSTALL = install
INSTALLOWNER ?= -o root -g root
bindir ?= /usr/bin
libexecdir ?= /usr/libexec
INSTALLDIR=$(DESTDIR)$(bindir)
LIBEXECINSTALLDIR=$(DESTDIR)$(libexecdir)

.PHONY: install
install:
$(INSTALL) $(INSTALLOWNER) -d $(INSTALLDIR)
$(INSTALL) $(INSTALLOWNER) -d $(LIBEXECINSTALLDIR)
for i in $(PROGS); do \
$(INSTALL) $(INSTALLOWNER) -m 755 $$i $(INSTALLDIR); \
done
for i in $(LIBPROGS); do \
$(INSTALL) $(INSTALLOWNER) -m 755 $$i $(LIBEXECINSTALLDIR); \
done
$(MAKE) -C man install

########################################################################
Expand All @@ -147,7 +153,7 @@ $(DEPDIR)/%.d: %.c
$(CC) $(CFLAGS) -MM -MF $@ -MP -MT $*.o $<

.SECONDEXPANSION:
$(PROGS): $$@.o libuser.a $(DEPLIBS)
$(ALLPROGS): $$@.o libuser.a $(DEPLIBS)
echo "Building $@ from $^"
$(CC) $(LDFLAGS) $^ $(LDPRFLAGS) -o $@

Expand Down
28 changes: 14 additions & 14 deletions utils/vdo/user/man/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# $Id: //eng/vdo-releases/aluminum/src/packaging/src-dist/user/utils/vdo/user/man/Makefile#10 $
# $Id: //eng/vdo-releases/aluminum/src/packaging/src-dist/user/utils/vdo/user/man/Makefile#11 $

INSTALLFILES= \
vdo2lvm.8 \
vdoaudit.8 \
vdodebugmetadata.8 \
vdodmeventd.8 \
vdodumpblockmap.8 \
vdodumpconfig.8 \
vdodumpmetadata.8 \
vdoforcerebuild.8 \
vdoformat.8 \
vdolistmetadata.8 \
vdoreadonly.8 \
vdoregenerategeometry.8 \
vdosetuuid.8
vdoaudit.8 \
vdodebugmetadata.8 \
vdodmeventd.8 \
vdodumpblockmap.8 \
vdodumpconfig.8 \
vdodumpmetadata.8 \
vdoforcerebuild.8 \
vdoformat.8 \
vdolistmetadata.8 \
vdoprepareforlvm.8 \
vdoreadonly.8 \
vdoregenerategeometry.8 \
vdosetuuid.8

INSTALL = install
INSTALLOWNER ?= -o root -g root
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.TH VDO2LVM 8 "2020-09-23" "Red Hat" \" -*- nroff -*-
.TH VDOPREPAREFORLVM 8 "2020-09-23" "Red Hat" \" -*- nroff -*-
.SH NAME
vdo2lvm \- Converts a VDO device for use with LVM
vdoprepareforlvm \- Converts a VDO device for use with LVM
.SH SYNOPSIS
.B vdo2lvm
.B vdoprepareforlvm
.I filename
.SH DESCRIPTION
.B vdo2lvm
.B vdoprepareforlvm
converts the VDO block device named by \fIfilename\fP for use with LVM.
The VDO device to be converted must not be running, and should not
already be an LVM VDO.
Expand All @@ -16,7 +16,7 @@ already be an LVM VDO.
Print this help message and exit.
.TP
.B \-\-version
Show the version of vdo2lvm.
Show the version of vdoprepareforlvm.
.
.SH SEE ALSO
.BR vdo (8).
14 changes: 7 additions & 7 deletions utils/vdo/user/vdo2lvm.c → utils/vdo/user/vdoprepareforlvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/user/vdo2LVM.c#5 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/user/vdoPrepareForLVM.c#1 $
*/

#include <err.h>
Expand Down Expand Up @@ -47,22 +47,22 @@ static const char usageString[] =
" [--help] [--version] filename";

static const char helpString[] =
"vdo2lvm - Converts a VDO device for use with LVM\n"
"vdoprepareforlvm - Converts a VDO device for use with LVM\n"
"\n"
"SYNOPSIS\n"
" vdo2lvm <filename>\n"
" vdoprepareforlvm <filename>\n"
"\n"
"DESCRIPTION\n"
" vdo2lvm converts the VDO block device named by <filename> for use with\n"
" LVM. The VDO device to be converted must not be running, and should not\n"
" already be an LVM VDO.\n"
" vdoprepareforlvm converts the VDO block device named by <filename> for\n"
" use with LVM. The VDO device to be converted must not be running, and\n"
" should not already be an LVM VDO.\n"
"\n"
"OPTIONS\n"
" --help\n"
" Print this help message and exit.\n"
"\n"
" --version\n"
" Show the version of vdo2lvm.\n"
" Show the version of vdoprepareforlvm.\n"
"\n";

static struct option options[] = {
Expand Down
2 changes: 1 addition & 1 deletion vdo-manager/statistics/KernelStatistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self, name="KernelStatistics", **kwargs):
Uint32Field("releaseVersion", display = False),
# The VDO instance
Uint32Field("instance"),
StringField("fiveTwelveByteEmulation", derived = "'on' if ($logicalBlockSize == 512) else 'off'", label = "512 byte emulation"),
StringField("fiveTwelveByteEmulation", label = "512 byte emulation", derived = "'on' if ($logicalBlockSize == 512) else 'off'"),
# Current number of active VIOs
Uint32Field("currentVIOsInProgress", label = "current VDO IO requests in progress"),
# Maximum number of active VIOs
Expand Down
12 changes: 6 additions & 6 deletions vdo-manager/statistics/VDOStatistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ def __init__(self, name="VDOStatistics", **kwargs):
# number of logical blocks
Uint64Field("logicalBlocks"),
Uint64Field("oneKBlocks", label = "1K-blocks", derived = "$physicalBlocks * $blockSize // 1024"),
Uint64Field("oneKBlocksUsed", label = "1K-blocks used", available = "not $inRecoveryMode", derived = "($dataBlocksUsed + $overheadBlocksUsed) * $blockSize // 1024"),
Uint64Field("oneKBlocksAvailable", derived = "($physicalBlocks - $dataBlocksUsed - $overheadBlocksUsed) * $blockSize // 1024", label = "1K-blocks available", available = "not $inRecoveryMode"),
Uint64Field("oneKBlocksUsed", derived = "($dataBlocksUsed + $overheadBlocksUsed) * $blockSize // 1024", available = "not $inRecoveryMode", label = "1K-blocks used"),
Uint64Field("oneKBlocksAvailable", derived = "($physicalBlocks - $dataBlocksUsed - $overheadBlocksUsed) * $blockSize // 1024", available = "not $inRecoveryMode", label = "1K-blocks available"),
Uint8Field("usedPercent", derived = "int((100 * ($dataBlocksUsed + $overheadBlocksUsed) // $physicalBlocks) + 0.5)", available = "((not $inRecoveryMode) and ($mode != b'read-only'))"),
Uint8Field("savings", display = False, available = "not $inRecoveryMode", derived = "int(100 * ($logicalBlocksUsed - $dataBlocksUsed) // $logicalBlocksUsed) if ($logicalBlocksUsed > 0) else -1"),
Uint8Field("savingPercent", derived = "$savings if ($savings >= 0) else NotAvailable()", available = "((not $inRecoveryMode) and ($mode != b'read-only'))"),
Uint8Field("savings", available = "not $inRecoveryMode", derived = "int(100 * ($logicalBlocksUsed - $dataBlocksUsed) // $logicalBlocksUsed) if ($logicalBlocksUsed > 0) else -1", display = False),
Uint8Field("savingPercent", available = "((not $inRecoveryMode) and ($mode != b'read-only'))", derived = "$savings if ($savings >= 0) else NotAvailable()"),
# Size of the block map page cache, in bytes
Uint64Field("blockMapCacheSize"),
# String describing the active write policy of the VDO
Expand All @@ -217,11 +217,11 @@ def __init__(self, name="VDOStatistics", **kwargs):
# Number of times the VDO has recovered from read-only mode
Uint64Field("readOnlyRecoveries", label = "read-only recovery count"),
# String describing the operating mode of the VDO
StringField("mode", length = 15, label = "operating mode"),
StringField("mode", label = "operating mode", length = 15),
# Whether the VDO is in recovery mode
BoolField("inRecoveryMode", display = False),
# What percentage of recovery mode work has been completed
Uint8Field("recoveryPercentage", available = "$inRecoveryMode", label = "recovery progress (%)"),
Uint8Field("recoveryPercentage", label = "recovery progress (%)", available = "$inRecoveryMode"),
# The statistics for the compressed block packer
PackerStatistics("packer"),
# Counters for events in the block allocator
Expand Down
Loading

0 comments on commit c658747

Please sign in to comment.