Skip to content

Commit

Permalink
Adding 4.8 & 4.9 kernel support and releasing 4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoutoupis committed Oct 28, 2016
1 parent af178e2 commit da66331
Show file tree
Hide file tree
Showing 17 changed files with 68 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
*** Release 4.4 ***

- kernel: Update to 4.8 and 4.9 kernels.
- build: Cleaned up Makefiles (thanks Marcel!)

*** Release 4.3 ***

- kernel: Add support for the 4.7 kernel (patch supplied by Marcel Huber)
Expand Down
2 changes: 1 addition & 1 deletion module/Makefile
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = 4.3
VERSION = 4.4

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="4.3"
PACKAGE_VERSION="4.4"
BUILT_MODULE_NAME[0]="rapiddisk"
BUILT_MODULE_NAME[1]="rapiddisk-cache"
DEST_MODULE_LOCATION[0]="/kernel/rapiddisk/"
Expand Down
14 changes: 11 additions & 3 deletions module/rapiddisk-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
} \
} while (0)

#define VERSION_STR "4.3"
#define VERSION_STR "4.4"
#define DM_MSG_PREFIX "rapiddisk-cache"

#define READCACHE 1
Expand Down Expand Up @@ -167,7 +167,11 @@ int dm_io_async_bvec(unsigned int num_regions, struct dm_io_region *where,
struct cache_context *dmc = job->dmc;
struct dm_io_request iorq;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
iorq.bi_op = rw;
#else
iorq.bi_rw = rw;
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
iorq.mem.type = DM_IO_BIO;
iorq.mem.ptr.bio = bio;
Expand Down Expand Up @@ -768,10 +772,14 @@ static void cache_write(struct cache_context *dmc, struct bio *bio)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
#define bio_barrier(bio) ((bio)->bi_rw & REQ_HARDBARRIER)
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
#define bio_barrier(bio) ((bio)->bi_opf & REQ_PREFLUSH)
#else
#define bio_barrier(bio) ((bio)->bi_rw & REQ_FLUSH)
#endif
#endif
#endif
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
int rc_map(struct dm_target *ti, struct bio *bio)
Expand Down Expand Up @@ -1186,7 +1194,7 @@ cache_status(struct dm_target *ti, status_type_t type, unsigned status_flags,

static struct target_type cache_target = {
.name = "rapiddisk-cache",
.version = {4, 3, 0},
.version = {4, 4, 0},
.module = THIS_MODULE,
.ctr = cache_ctr,
.dtr = cache_dtr,
Expand Down Expand Up @@ -1228,4 +1236,4 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR("Petros Koutoupis <[email protected]>");
MODULE_DESCRIPTION("RapidDisk-Cache DM target is a write-through caching target with RapidDisk volumes.");
MODULE_VERSION(VERSION_STR);
MODULE_INFO(Copyright, "Copyright 2010 - 2015 Petros Koutoupis");
MODULE_INFO(Copyright, "Copyright 2010 - 2016 Petros Koutoupis");
33 changes: 31 additions & 2 deletions module/rapiddisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <linux/radix-tree.h>
#include <linux/io.h>

#define VERSION_STR "4.3"
#define VERSION_STR "4.4"
#define PREFIX "rapiddisk"
#define BYTES_PER_SECTOR 512
#define MAX_RDSKS 128
Expand Down Expand Up @@ -94,7 +94,11 @@ module_param(rd_max_nr, int, S_IRUGO);
MODULE_PARM_DESC(rd_max_nr, " Maximum number of RAM Disks. (Default = 128)");

static int rdsk_do_bvec(struct rdsk_device *, struct page *,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
unsigned int, unsigned int, bool, sector_t);
#else
unsigned int, unsigned int, int, sector_t);
#endif
static int rdsk_ioctl(struct block_device *, fmode_t,
unsigned int, unsigned long);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
Expand Down Expand Up @@ -422,12 +426,20 @@ static void copy_from_rdsk(void *dst, struct rdsk_device *rdsk,
}

static int rdsk_do_bvec(struct rdsk_device *rdsk, struct page *page,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
unsigned int len, unsigned int off, bool is_write,
#else
unsigned int len, unsigned int off, int rw,
#endif
sector_t sector){
void *mem;
int err = 0;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
if (is_write) {
#else
if (rw != READ) {
#endif
err = copy_to_rdsk_setup(rdsk, sector, len);
if (err)
goto out;
Expand All @@ -437,7 +449,11 @@ static int rdsk_do_bvec(struct rdsk_device *rdsk, struct page *page,
#else
mem = kmap_atomic(page, KM_USER0);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
if (!is_write) {
#else
if (rw == READ) {
#endif
copy_from_rdsk(mem + off, rdsk, sector, len);
flush_dcache_page(page);
} else {
Expand Down Expand Up @@ -466,7 +482,9 @@ rdsk_make_request(struct request_queue *q, struct bio *bio)
{
struct block_device *bdev = bio->bi_bdev;
struct rdsk_device *rdsk = bdev->bd_disk->private_data;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,8,0)
int rw;
#endif
sector_t sector;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
struct bio_vec bvec;
Expand All @@ -490,8 +508,12 @@ rdsk_make_request(struct request_queue *q, struct bio *bio)
#endif

err = 0;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,336)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
if (unlikely(bio_op(bio) == REQ_OP_DISCARD)) {
#else
if (unlikely(bio->bi_rw & REQ_DISCARD)) {
#endif
if (sector & ((PAGE_SIZE >> SECTOR_SHIFT) - 1) ||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
bio->bi_iter.bi_size & ~PAGE_MASK)
Expand All @@ -511,16 +533,23 @@ rdsk_make_request(struct request_queue *q, struct bio *bio)
goto out;
}
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(4,8,0)
rw = bio_rw(bio);
if (rw == READA)
rw = READ;
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
bio_for_each_segment(bvec, bio, iter) {
unsigned int len = bvec.bv_len;

err = rdsk_do_bvec(rdsk, bvec.bv_page, len,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
bvec.bv_offset, op_is_write(bio_op(bio)), sector);
#else
bvec.bv_offset, rw, sector);
#endif
#else
bio_for_each_segment(bvec, bio, i) {
unsigned int len = bvec->bv_len;
Expand Down
5 changes: 5 additions & 0 deletions pkg-mgmt/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
rapiddisk (4.4-1) released; urgency=medium

* kernel: Update to 4.8 and 4.9 kernels.
* build: Cleaned up Makefiles (thanks Marcel!)

rapiddisk (4.3-1) released; urgency=medium

* kernel: Add support for the 4.7 kernel (patch supplied by Marcel Huber)
Expand Down
2 changes: 1 addition & 1 deletion pkg-mgmt/debian/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: rapiddisk
Version: 4.3-1
Version: 4.4-1
Section: base
Priority: optional
Architecture: amd64
Expand Down
6 changes: 3 additions & 3 deletions pkg-mgmt/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 4.3
dkms build -m rapiddisk -v 4.3
dkms install -m rapiddisk -v 4.3
dkms add -m rapiddisk -v 4.4
dkms build -m rapiddisk -v 4.4
dkms install -m rapiddisk -v 4.4
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 pkg-mgmt/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 4.3 --all
dkms remove -m rapiddisk -v 4.4 --all
;;

failed-upgrade)
Expand Down
5 changes: 4 additions & 1 deletion pkg-mgmt/spec/rapiddisk.spec.opensuse
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: 4.3
Version: 4.4
Release: 1
License: General Public License Version 2
Group: Applications/System
Expand Down Expand Up @@ -85,6 +85,9 @@ rm -rf %{buildroot}
%doc %attr(0444,root,root) /usr/share/man/man1/*

%changelog
* Fri Oct 28 2016 Petros Koutoupis <[email protected]>
- kernel: Update to 4.8 and 4.9 kernels.
- build: Cleaned up Makefiles (thanks Marcel!)
* Fri Aug 12 2016 Petros Koutoupis <[email protected]>
- kernel: Add support for the 4.7 kernel (patch supplied by Marcel Huber)
* Sun May 22 2016 Petros Koutoupis <[email protected]>
Expand Down
5 changes: 4 additions & 1 deletion pkg-mgmt/spec/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: 4.3
Version: 4.4
Release: 1
License: General Public License Version 2
Group: Applications/System
Expand Down Expand Up @@ -85,6 +85,9 @@ rm -rf %{buildroot}
%doc %attr(0444,root,root) /usr/share/man/man1/*

%changelog
* Fri Oct 28 2016 Petros Koutoupis <[email protected]>
- kernel: Update to 4.8 and 4.9 kernels.
- build: Cleaned up Makefiles (thanks Marcel!)
* Fri Aug 12 2016 Petros Koutoupis <[email protected]>
- kernel: Add support for the 4.7 kernel (patch supplied by Marcel Huber)
* Sun May 22 2016 Petros Koutoupis <[email protected]>
Expand Down
Empty file modified src/Makefile
100755 → 100644
Empty file.
Empty file modified src/archive.c
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion src/common.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#define UTIL "rapiddisk"
#define COPYRIGHT "Copyright 2011-2016 Petros Koutoupis"
#define VERSION_NUM "4.3"
#define VERSION_NUM "4.4"
#define SUCCESS 0x0
#define NAMELEN 0x100
#define BYTES_PER_SECTOR 0x200
Expand Down
Empty file modified src/core.c
100755 → 100644
Empty file.
Empty file modified src/crypt.c
100755 → 100644
Empty file.
Empty file modified src/main.c
100755 → 100644
Empty file.

0 comments on commit da66331

Please sign in to comment.