Skip to content

Commit

Permalink
Version 8.1.0.264
Browse files Browse the repository at this point in the history
- Rebased to upstream candidate.
- Added support for vdo volumes which were created with the vdo script, but
  have been converted to be managed by LVM.
- Fixed GCC implicit-fallthrough errors when building for latest kernel.
  • Loading branch information
corwin committed Jul 28, 2021
1 parent 36c3e1c commit 2e1a578
Show file tree
Hide file tree
Showing 329 changed files with 12,767 additions and 12,914 deletions.
11 changes: 8 additions & 3 deletions kvdo.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%define spec_release 1
%define kmod_name kvdo
%define kmod_driver_version 8.1.0.4
%define kmod_driver_version 8.1.0.264
%define kmod_rpm_release %{spec_release}
%define kmod_kernel_version 3.10.0-693.el7

Expand Down Expand Up @@ -96,5 +96,10 @@ rm -rf $RPM_BUILD_ROOT
%{_usr}/src/%{kmod_name}-%{version}

%changelog
* Wed May 05 2021 - Red Hat VDO Team <[email protected]> - 8.1.0.4-1
- Added missing lz4 symbols required to build on RHEL9.
* Wed Jul 28 2021 - Red Hat VDO Team <[email protected]> - 8.1.0.264-1
- Rebased to upstream candidate.
- Added support for vdo volumes which were created with the vdo script, but
have been converted to be managed by LVM.
- Fixed GCC implicit-fallthrough errors when building for latest kernel.


2 changes: 1 addition & 1 deletion uds/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
UDS_VERSION = 8.1.0.248
UDS_VERSION = 8.1.0.322

SOURCES = $(notdir $(wildcard $(src)/*.c)) murmur/MurmurHash3.c
SOURCES += $(addprefix util/,$(notdir $(wildcard $(src)/util/*.c)))
Expand Down
26 changes: 0 additions & 26 deletions uds/atomicDefs.h

This file was deleted.

30 changes: 16 additions & 14 deletions uds/bits.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/krusty/src/uds/bits.c#6 $
* $Id: //eng/uds-releases/krusty/src/uds/bits.c#7 $
*/

#include "bits.h"
Expand Down Expand Up @@ -100,6 +100,9 @@ void move_bits(const byte *s_memory,
enum { UINT32_BIT = sizeof(uint32_t) * CHAR_BIT };
if (size > MAX_BIG_FIELD_BITS) {
if (source > destination) {
const byte *src;
byte *dest;
int offset;
// This is a large move from a higher to a lower
// address. We move the lower addressed bits first.
// Start by moving one field that ends on a destination
Expand All @@ -115,10 +118,9 @@ void move_bits(const byte *s_memory,
size -= count;
// Now do the main loop to copy 32 bit chunks that are
// int-aligned at the destination.
int offset = source % UINT32_BIT;
const byte *src =
s_memory + (source - offset) / CHAR_BIT;
byte *dest = d_memory + destination / CHAR_BIT;
offset = source % UINT32_BIT;
src = s_memory + (source - offset) / CHAR_BIT;
dest = d_memory + destination / CHAR_BIT;
while (size > MAX_BIG_FIELD_BITS) {
put_unaligned_le32(get_unaligned_le64(src) >>
offset,
Expand All @@ -130,28 +132,28 @@ void move_bits(const byte *s_memory,
size -= UINT32_BIT;
}
} else {
const byte *src;
byte *dest;
// This is a large move from a lower to a higher
// address. We move the higher addressed bits first.
// Start by moving one field that begins on a
// destination int boundary
int count = (destination + size) % UINT32_BIT;
int offset, count = (destination + size) % UINT32_BIT;
if (count > 0) {
uint64_t field;
size -= count;
uint64_t field = get_big_field(s_memory,
source + size,
count);
field = get_big_field(s_memory, source + size,
count);
set_big_field(field,
d_memory,
destination + size,
count);
}
// Now do the main loop to copy 32 bit chunks that are
// int-aligned at the destination.
int offset = (source + size) % UINT32_BIT;
const byte *src =
s_memory + (source + size - offset) / CHAR_BIT;
byte *dest =
d_memory + (destination + size) / CHAR_BIT;
offset = (source + size) % UINT32_BIT;
src = s_memory + (source + size - offset) / CHAR_BIT;
dest = d_memory + (destination + size) / CHAR_BIT;
while (size > MAX_BIG_FIELD_BITS) {
src -= sizeof(uint32_t);
dest -= sizeof(uint32_t);
Expand Down
39 changes: 21 additions & 18 deletions uds/buffer.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/krusty/src/uds/buffer.c#9 $
* $Id: //eng/uds-releases/krusty/src/uds/buffer.c#12 $
*/

#include "buffer.h"
Expand All @@ -39,7 +39,7 @@ int wrap_buffer(byte *bytes,
length,
content_length);
struct buffer *buffer;
result = ALLOCATE(1, struct buffer, "buffer", &buffer);
result = UDS_ALLOCATE(1, struct buffer, "buffer", &buffer);
if (result != UDS_SUCCESS) {
return result;
}
Expand All @@ -58,15 +58,15 @@ int wrap_buffer(byte *bytes,
int make_buffer(size_t size, struct buffer **new_buffer)
{
byte *data;
int result = ALLOCATE(size, byte, "buffer data", &data);
struct buffer *buffer;
int result = UDS_ALLOCATE(size, byte, "buffer data", &data);
if (result != UDS_SUCCESS) {
return result;
}

struct buffer *buffer;
result = wrap_buffer(data, size, 0, &buffer);
if (result != UDS_SUCCESS) {
FREE(data);
UDS_FREE(UDS_FORGET(data));
return result;
}

Expand All @@ -76,17 +76,17 @@ int make_buffer(size_t size, struct buffer **new_buffer)
}

/**********************************************************************/
void free_buffer(struct buffer **p_buffer)
void free_buffer(struct buffer *buffer)
{
struct buffer *buffer = *p_buffer;
*p_buffer = NULL;
if (buffer == NULL) {
return;
}

if (!buffer->wrapped) {
FREE(buffer->data);
UDS_FREE(UDS_FORGET(buffer->data));
}
FREE(buffer);

UDS_FREE(buffer);
}

/**********************************************************************/
Expand Down Expand Up @@ -139,10 +139,11 @@ void clear_buffer(struct buffer *buffer)
/**********************************************************************/
void compact_buffer(struct buffer *buffer)
{
size_t bytes_to_move;
if ((buffer->start == 0) || (buffer->end == 0)) {
return;
}
size_t bytes_to_move = buffer->end - buffer->start;
bytes_to_move = buffer->end - buffer->start;
memmove(buffer->data, buffer->data + buffer->start, bytes_to_move);
buffer->start = 0;
buffer->end = bytes_to_move;
Expand Down Expand Up @@ -244,14 +245,15 @@ int copy_bytes(struct buffer *buffer, size_t length, byte **destination_ptr)
{
byte *destination;
int result =
ALLOCATE(length, byte, "copy_bytes() buffer", &destination);
UDS_ALLOCATE(length, byte, "copy_bytes() buffer",
&destination);
if (result != UDS_SUCCESS) {
return result;
}

result = get_bytes_from_buffer(buffer, length, destination);
if (result != UDS_SUCCESS) {
FREE(destination);
UDS_FREE(destination);
} else {
*destination_ptr = destination;
}
Expand All @@ -272,11 +274,12 @@ int put_bytes(struct buffer *buffer, size_t length, const void *source)
/**********************************************************************/
int put_buffer(struct buffer *target, struct buffer *source, size_t length)
{
int result;
if (content_length(source) < length) {
return UDS_BUFFER_ERROR;
}

int result = put_bytes(target, length, get_buffer_contents(source));
result = put_bytes(target, length, get_buffer_contents(source));
if (result != UDS_SUCCESS) {
return result;
}
Expand Down Expand Up @@ -339,11 +342,11 @@ int put_uint16_le_into_buffer(struct buffer *buffer, uint16_t ui)
int get_uint16_les_from_buffer(struct buffer *buffer, size_t count,
uint16_t *ui)
{
unsigned int i;
if (content_length(buffer) < (sizeof(uint16_t) * count)) {
return UDS_BUFFER_ERROR;
}

unsigned int i;
for (i = 0; i < count; i++) {
decode_uint16_le(buffer->data, &buffer->start, ui + i);
}
Expand All @@ -355,11 +358,11 @@ int put_uint16_les_into_buffer(struct buffer *buffer,
size_t count,
const uint16_t *ui)
{
unsigned int i;
if (!ensure_available_space(buffer, sizeof(uint16_t) * count)) {
return UDS_BUFFER_ERROR;
}

unsigned int i;
for (i = 0; i < count; i++) {
encode_uint16_le(buffer->data, &buffer->end, ui[i]);
}
Expand Down Expand Up @@ -436,11 +439,11 @@ int put_uint64_le_into_buffer(struct buffer *buffer, uint64_t ui)
int get_uint64_les_from_buffer(struct buffer *buffer, size_t count,
uint64_t *ui)
{
unsigned int i;
if (content_length(buffer) < (sizeof(uint64_t) * count)) {
return UDS_BUFFER_ERROR;
}

unsigned int i;
for (i = 0; i < count; i++) {
decode_uint64_le(buffer->data, &buffer->start, ui + i);
}
Expand All @@ -452,11 +455,11 @@ int put_uint64_les_into_buffer(struct buffer *buffer,
size_t count,
const uint64_t *ui)
{
unsigned int i;
if (!ensure_available_space(buffer, sizeof(uint64_t) * count)) {
return UDS_BUFFER_ERROR;
}

unsigned int i;
for (i = 0; i < count; i++) {
encode_uint64_le(buffer->data, &buffer->end, ui[i]);
}
Expand Down
6 changes: 3 additions & 3 deletions uds/buffer.h
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/krusty/src/uds/buffer.h#6 $
* $Id: //eng/uds-releases/krusty/src/uds/buffer.h#7 $
*/

#ifndef BUFFER_H
Expand Down Expand Up @@ -54,9 +54,9 @@ int __must_check make_buffer(size_t length, struct buffer **buffer_ptr);
/**
* Release a buffer and, if not wrapped, free its memory.
*
* @param p_buffer Pointer to the buffer to release
* @param buffer The buffer to release
**/
void free_buffer(struct buffer **p_buffer);
void free_buffer(struct buffer *buffer);

/**
* Ensure that a buffer has a given amount of space available, compacting the
Expand Down
Loading

0 comments on commit 2e1a578

Please sign in to comment.