diff options
Diffstat (limited to 'sys-block/flashcache/files/flashcache-9999-2.6.37.patch')
-rw-r--r-- | sys-block/flashcache/files/flashcache-9999-2.6.37.patch | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/sys-block/flashcache/files/flashcache-9999-2.6.37.patch b/sys-block/flashcache/files/flashcache-9999-2.6.37.patch new file mode 100644 index 0000000..b19e5ca --- /dev/null +++ b/sys-block/flashcache/files/flashcache-9999-2.6.37.patch @@ -0,0 +1,103 @@ +diff --git a/flashcache-wt/Makefile b/flashcache-wt/Makefile +index c9beb28..79f5505 100644 +--- a/flashcache-wt/Makefile ++++ b/flashcache-wt/Makefile +@@ -1,3 +1,5 @@ ++KERNEL_TREE ?= /lib/modules/$(shell uname -r)/build ++ + all: + $(MAKE) -C src KERNEL_TREE=$(KERNEL_TREE) PWD=$(PWD)/src + +diff --git a/flashcache-wt/src/Makefile b/flashcache-wt/src/Makefile +index d21ff2a..8f81c20 100644 +--- a/flashcache-wt/src/Makefile ++++ b/flashcache-wt/src/Makefile +@@ -1,13 +1,15 @@ + EXTRA_CFLAGS=-I$(KERNEL_TREE)/drivers/md -I./ + UTILS_CFLAGS=-I./ + ++KERNEL_TREE ?= /lib/modules/$(shell uname -r)/build ++ + obj-m += flashcache-wt.o + flashcache-wt-objs := flashcache_wt.o + + KERNEL_SOURCE_VERSION ?= $(shell uname -r) + + all: +- make -C $(KERNEL_TREE) M=$(PWD) modules ++ $(MAKE) -C $(KERNEL_TREE) M=$(PWD) modules + $(CC) $(UTILS_CFLAGS) -o utils/flashcache_wt_create utils/flashcache_wt_create.c + + install: all +@@ -17,5 +19,5 @@ install: all + install -o root -g root -m 0755 utils/flashcache_wt_create /sbin/ + + clean: +- make -C $(KERNEL_TREE) M=$(PWD) clean ++ $(MAKE) -C $(KERNEL_TREE) M=$(PWD) clean + rm -f utils/flashcache_wt_create +diff --git a/flashcache-wt/src/flashcache_wt.c b/flashcache-wt/src/flashcache_wt.c +index 6cd2a3d..0259e26 100644 +--- a/flashcache-wt/src/flashcache_wt.c ++++ b/flashcache-wt/src/flashcache_wt.c +@@ -826,8 +826,10 @@ cache_write(struct cache_c *dmc, struct bio* bio) + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) + #define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER)) +-#else ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) + #define bio_barrier(bio) ((bio)->bi_rw & REQ_HARDBARRIER) ++#else ++#define bio_barrier(bio) ((bio)->bi_rw & REQ_FLUSH) + #endif + #endif + +diff --git a/src/Makefile b/src/Makefile +index 5938043..536f4a7 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -9,7 +9,7 @@ flashcache-objs := flashcache_conf.o flashcache_main.o flashcache_subr.o flashca + KERNEL_SOURCE_VERSION ?= $(shell uname -r) + + all: +- make -C $(KERNEL_TREE) M=$(PWD) modules V=0 ++ $(MAKE) -C $(KERNEL_TREE) M=$(PWD) modules V=0 + @echo "building utils" + @$(CC) $(UTILS_CFLAGS) -o utils/flashcache_create utils/flashcache_create.c + @$(CC) $(UTILS_CFLAGS) -o utils/flashcache_destroy utils/flashcache_destroy.c +@@ -24,5 +24,5 @@ install: all + install -o root -g root -m 0755 utils/flashcache_load /sbin/ + + clean: +- make -C $(KERNEL_TREE) M=$(PWD) clean ++ $(MAKE) -C $(KERNEL_TREE) M=$(PWD) clean + rm -f utils/flashcache_{create,destroy,load} +diff --git a/src/flashcache_main.c b/src/flashcache_main.c +index d9e47ee..e8240db 100644 +--- a/src/flashcache_main.c ++++ b/src/flashcache_main.c +@@ -1533,8 +1533,10 @@ flashcache_write(struct cache_c *dmc, struct bio *bio) + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) + #define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER)) +-#else ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) + #define bio_barrier(bio) ((bio)->bi_rw & REQ_HARDBARRIER) ++#else ++#define bio_barrier(bio) ((bio)->bi_rw & REQ_FLUSH) + #endif + #endif + +diff --git a/src/utils/flashcache_create.c b/src/utils/flashcache_create.c +index 839205d..23fd4e7 100644 +--- a/src/utils/flashcache_create.c ++++ b/src/utils/flashcache_create.c +@@ -274,7 +274,7 @@ main(int argc, char **argv) + exit(1); + } + } +- sprintf(dmsetup_cmd, "echo 0 %lu flashcache %s %s 2 %lu %lu %lu" ++ sprintf(dmsetup_cmd, "echo 0 %lu flashcache %s %s 2 %lu %lu %d" + " | dmsetup create %s", + disk_devsize, disk_devname, ssd_devname, block_size, + cache_size, associativity, |