Skip to content

Commit

Permalink
Merge pull request #64 from pkoutoupis/feature/support_newer_libmicro…
Browse files Browse the repository at this point in the history
…httpd

Feature/support newer libmicrohttpd
  • Loading branch information
pkoutoupis authored Jun 26, 2021
2 parents 619d12c + d24ff5d commit 3a44e02
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### Release 7.2.1 ###

- module: Added support for RHEL 8.4 kernel
- utility: Added support for libmicrohttpd v0.9.71 and newer while still supporting legacy versions

### Release 7.2.0 ###

- module: Updated for 5.12 kernels and later (thank you Michael)
Expand Down
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
rapiddisk (7.2.1-1) released; urgency=medium

* module: Added support for RHEL 8.4 kernel
* utility: added support for libmicrohttpd v0.9.71 and newer while still supporting legacy versions

rapiddisk (7.2.0-1) released; urgency=medium

* module: Updated for 5.12 kernels and later (thank you Michael)
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: rapiddisk
Version: 7.2.0-1
Version: 7.2.1-1
Section: base
Priority: optional
Architecture: amd64
Expand Down
6 changes: 3 additions & 3 deletions debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ fi
case "$1" in

configure)
dkms add -m rapiddisk -v 7.2.0
dkms build -m rapiddisk -v 7.2.0
dkms install -m rapiddisk -v 7.2.0
dkms add -m rapiddisk -v 7.2.1
dkms build -m rapiddisk -v 7.2.1
dkms install -m rapiddisk -v 7.2.1
echo "rapiddisk max_sectors=2048 nr_requests=1024" >> /etc/modules
echo "rapiddisk-cache" >> /etc/modules
echo "dm_mod" >> /etc/modules
Expand Down
2 changes: 1 addition & 1 deletion debian/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi

case "$1" in
remove|upgrade|deconfigure)
dkms remove -m rapiddisk -v 7.2.0 --all
dkms remove -m rapiddisk -v 7.2.1 --all
;;

failed-upgrade)
Expand Down
2 changes: 1 addition & 1 deletion misc/rapiddisk-legacy/rapiddisk-legacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fi
## usage ##
function help_menu()
{
echo -e "$1 7.2.0"
echo -e "$1 7.2.1"
echo -e "Copyright 2011 - 2021 Petros Koutoupis"
echo -e ""
echo -e "$1 is an administration tool to manage the RapidDisk RAM disk devices and"
Expand Down
2 changes: 1 addition & 1 deletion module/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# SPDX-License-Identifier: GPL-2.0-only

VERSION = 7.2.0
VERSION = 7.2.1

ifeq ($(KSRC),)
KSRC := /lib/modules/$(shell uname -r)/build
Expand Down
2 changes: 1 addition & 1 deletion module/dkms.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME="rapiddisk"
PACKAGE_VERSION="7.2.0"
PACKAGE_VERSION="7.2.1"
BUILT_MODULE_NAME[0]="rapiddisk"
BUILT_MODULE_NAME[1]="rapiddisk-cache"
DEST_MODULE_LOCATION[0]="/kernel/rapiddisk/"
Expand Down
4 changes: 2 additions & 2 deletions module/rapiddisk-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
} \
} while (0)

#define VERSION_STR "7.2.0"
#define VERSION_STR "7.2.1"
#define DM_MSG_PREFIX "rapiddisk-cache"

#define READCACHE 1
Expand Down Expand Up @@ -1234,7 +1234,7 @@ cache_status(struct dm_target *ti, status_type_t type, unsigned status_flags,

static struct target_type cache_target = {
.name = "rapiddisk-cache",
.version = {7, 2, 0},
.version = {7, 2, 1},
.module = THIS_MODULE,
.ctr = cache_ctr,
.dtr = cache_dtr,
Expand Down
4 changes: 2 additions & 2 deletions module/rapiddisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <linux/radix-tree.h>
#include <linux/io.h>

#define VERSION_STR "7.2.0"
#define VERSION_STR "7.2.1"
#define PREFIX "rapiddisk"
#define BYTES_PER_SECTOR 512
#define MAX_RDSKS 128
Expand Down Expand Up @@ -637,7 +637,7 @@ static int rdsk_ioctl(struct block_device *bdev, fmode_t mode,
error = -EBUSY;
if (bdev->bd_openers <= 1) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) || (defined(RHEL_MAJOR) && RHEL_MAJOR == 8 && RHEL_MINOR >= 4)
invalidate_bdev(bdev);
#else
kill_bdev(bdev);
Expand Down
5 changes: 4 additions & 1 deletion rapiddisk.spec.rhel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Summary: The RapidDisk software defined advanced RAM drive and storage caching solution.
Name: rapiddisk
Version: 7.2.0
Version: 7.2.1
Release: 1
License: General Public License Version 2
Group: Applications/System
Expand Down Expand Up @@ -78,6 +78,9 @@ rm -rf %{buildroot}
%doc %attr(0444,root,root) /usr/share/man/man1/*

%changelog
* Sun Jun 13 2021 Petros Koutoupis <[email protected]>
- module: Added support for RHEL 8.4 kernel
- utility: added support for libmicrohttpd v0.9.71 and newer while still supporting legacy versions
* Fri May 28 2021 Petros Koutoupis <[email protected]>
- module: Updated for 5.12 kernels and later (thank you Michael)
- utility: remove unused headers (thank you Marcel Huber)
Expand Down
5 changes: 4 additions & 1 deletion rapiddisk.spec.sles
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Summary: The RapidDisk software defined advanced RAM drive and storage caching solution.
Name: rapiddisk
Version: 7.2.0
Version: 7.2.1
Release: 1
License: General Public License Version 2
Group: Applications/System
Expand Down Expand Up @@ -79,6 +79,9 @@ rm -rf %{buildroot}
%doc %attr(0444,root,root) /usr/share/man/man1/*

%changelog
* Sun Jun 13 2021 Petros Koutoupis <[email protected]>
- module: Added support for RHEL 8.4 kernel
- utility: added support for libmicrohttpd v0.9.71 and newer while still supporting legacy versions
* Fri May 28 2021 Petros Koutoupis <[email protected]>
- module: Updated for 5.12 kernels and later (thank you Michael)
- utility: remove unused headers (thank you Marcel Huber)
Expand Down
4 changes: 4 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ json-server.o: json.c
$(CC) -c json.c -DSERVER -o json-server.o

net.o: net.c
ifeq ($(shell grep -q "enum MHD_Result" $(DESTDIR)/usr/include/microhttpd.h; echo $$?),1)
$(CC) -c net.c -DLEGACY -o net.o
else
$(CC) -c net.c -o net.o
endif

rdsk.o: rdsk.c
$(CC) -c rdsk.c -o rdsk.o
Expand Down
2 changes: 1 addition & 1 deletion src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#define PROCESS "rapiddisk"
#define DAEMON PROCESS "d"
#define COPYRIGHT "Copyright 2011 - 2021 Petros Koutoupis"
#define VERSION_NUM "7.2.0"
#define VERSION_NUM "7.2.1"
#define SUCCESS 0
#define INVALID_VALUE -1
#define NAMELEN 0x200
Expand Down
8 changes: 8 additions & 0 deletions src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ unsigned char path[NAMELEN] = {0};
* The responses to our GET requests. Although, we are not SPECIFICALLY checking that they are GETs.
* We are just check the URL and the string command.
*/
#if !defined LEGACY
static enum MHD_Result answer_to_connection(void *cls, struct MHD_Connection *connection, const char *url,
#else
static int answer_to_connection(void *cls, struct MHD_Connection *connection, const char *url,
#endif
const char *method, const char *version, const char *upload_data,
size_t *upload_data_size, void **con_cls)
{
Expand All @@ -54,7 +58,11 @@ static int answer_to_connection(void *cls, struct MHD_Connection *connection, co
unsigned char *page = (unsigned char *)calloc(1, BUFSZ);
if (page == NULL) {
printf("%s: %s: calloc: %s\n", DAEMON, __func__, strerror(errno));
#if !defined LEGACY
return MHD_NO;
#else
return INVALID_VALUE;
#endif
}

if (strcmp(method, "GET") == SUCCESS) {
Expand Down

0 comments on commit 3a44e02

Please sign in to comment.