summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMATSUU Takuto <matsuu@gentoo.org>2011-02-03 23:34:52 +0900
committerMATSUU Takuto <matsuu@gentoo.org>2011-02-03 23:34:52 +0900
commit6d5da25b327d3f360ac1b43f9b0c2a28d5ce8cf2 (patch)
tree9428bcb38865baf08863676fb76fb575517681b8
parentsys-auth/pam_google_authenticator: Initial import. (diff)
downloadmatsuu-6d5da25b327d3f360ac1b43f9b0c2a28d5ce8cf2.tar.gz
matsuu-6d5da25b327d3f360ac1b43f9b0c2a28d5ce8cf2.tar.bz2
matsuu-6d5da25b327d3f360ac1b43f9b0c2a28d5ce8cf2.zip
sys-block/flashcache: Initial import.
-rw-r--r--sys-block/flashcache/Manifest2
-rw-r--r--sys-block/flashcache/files/flashcache-9999-2.6.37.patch103
-rw-r--r--sys-block/flashcache/flashcache-9999.ebuild53
3 files changed, 158 insertions, 0 deletions
diff --git a/sys-block/flashcache/Manifest b/sys-block/flashcache/Manifest
new file mode 100644
index 0000000..d5e2aa1
--- /dev/null
+++ b/sys-block/flashcache/Manifest
@@ -0,0 +1,2 @@
+AUX flashcache-9999-2.6.37.patch 3636 RMD160 d2b638ef63d27b55102d0749552906ddfab579c9 SHA1 1f1c3106e723f620d7ed5f30962356009d96da5c SHA256 bd73edba758bec2fa14fe16913aa70fdb295af88a6046fd606e43cc0c4c5fb28
+EBUILD flashcache-9999.ebuild 1127 RMD160 61a09e51030422696d35f185eb6441b5d6818c58 SHA1 d73701b40fc017710fd3d41a8781cefe85caf9f3 SHA256 6c16fff1521202804580273f356130b5be4bbaf67dbbbb933e21c2f7ef46bb16
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,
diff --git a/sys-block/flashcache/flashcache-9999.ebuild b/sys-block/flashcache/flashcache-9999.ebuild
new file mode 100644
index 0000000..8c3ff89
--- /dev/null
+++ b/sys-block/flashcache/flashcache-9999.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=3
+inherit eutils git linux-mod
+
+DESCRIPTION="a general purpose writeback block cache for Linux"
+HOMEPAGE="https://github.com/facebook/flashcache"
+EGIT_REPO_URI="https://github.com/facebook/flashcache.git"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=virtual/linux-sources-2.6.18"
+RDEPEND=""
+
+CONFIG_CHECK="BLK_DEV_DM"
+
+MODULE_NAMES="flashcache(kernel/drivers/block:${S}:${S}/src)
+ flashcache-wt(kernel/drivers/block:${S}/flashcache-wt:${S}/flashcache-wt/src)"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-2.6.37.patch"
+}
+
+src_compile() {
+ set_arch_to_kernel
+
+ emake KERNEL_TREE="${KERNEL_DIR}" || die
+
+ cd flashcache-wt
+ emake KERNEL_TREE="${KERNEL_DIR}" || die
+}
+
+src_install() {
+ linux-mod_src_install
+
+ (
+ cd "${S}/src/utils"
+ dosbin flashcache_create flashcache_destroy flashcache_load || die
+ )
+ (
+ cd "${S}/flashcache-wt/src/utils"
+ dosbin flashcache_wt_create || die
+ )
+
+ dodoc README* doc/* || die
+ newdoc flashcache-wt/README README.flashcache-wt || die
+}