Commit c846b2f6 authored by Natanael Copa's avatar Natanael Copa
Browse files

testing/flashcache-grsec: rebuild against 3.18.11 kernel

parent c3a2a8d1
......@@ -4,8 +4,8 @@ _kpkg=linux-$_flavor
_realname=flashcache
_name=$_realname-$_flavor
_kver=3.14.37
_kpkgrel=3
_kver=3.18.11
_kpkgrel=0
_realver=3.1.2
_mypkgrel=0
......@@ -33,7 +33,10 @@ install=
install_if="linux-$_flavor=$_kernelver $_realname"
subpackages=
source="$_realname-$_realver.tar.gz::https://github.com/facebook/flashcache/archive/$_realver.tar.gz
depmod.patch"
depmod.patch
kernel-3.18.patch
"
# override kernel's prepare()
prepare() {
......@@ -61,8 +64,11 @@ package() {
}
md5sums="b569604f7efce881e87752c9efc01965 flashcache-3.1.2.tar.gz
ef9bd511f2b964bf22863814679bfba3 depmod.patch"
ef9bd511f2b964bf22863814679bfba3 depmod.patch
24462dd41268d045bd91ba88274115fb kernel-3.18.patch"
sha256sums="f1d97395c744850a909e5f57b69a0ce87c773f2761e0147dd78de5fec3ea61e2 flashcache-3.1.2.tar.gz
05c0fefaaaea624c12b9ff3e66e0029b8dcc0c0d3246e10683bf217e10b3c450 depmod.patch"
05c0fefaaaea624c12b9ff3e66e0029b8dcc0c0d3246e10683bf217e10b3c450 depmod.patch
34a008e4c2382c757e030280fc6ce66c739251ca7883ef7d45feba44e2a05134 kernel-3.18.patch"
sha512sums="03d88b2622b7a41b66cd5cf4637be52c3bd6f25ac1099d7ea247e8e9bdad8a040bf0d10bcee2f49de8621f0da755dfd8a03810d709faaa330b78b6c564872e72 flashcache-3.1.2.tar.gz
55543347d76171352199294a29bcf19ba6b511f57e63c2a4254c4ebad8829912c65cdbef95bc7485d079dd66c56c1624b9570e7faf038cc5cb80e81079fcadc6 depmod.patch"
55543347d76171352199294a29bcf19ba6b511f57e63c2a4254c4ebad8829912c65cdbef95bc7485d079dd66c56c1624b9570e7faf038cc5cb80e81079fcadc6 depmod.patch
f09255bdc66711e35736a018f870b7a398bf05e3f1e8e4574a84967672152c510a4d6f8687ced49f52cfa63c57b407a393805e4df900de8ee6817e9c8c455306 kernel-3.18.patch"
From 387fce7bf2143b55147ce4822cd68f694c0bc49a Mon Sep 17 00:00:00 2001
From: Mohan Srinivasan <mohan@fb.com>
Date: Mon, 3 Nov 2014 11:57:38 -0800
Subject: [PATCH] 3.17. 3.18 compilation fixes.
Summary:
3.17. 3.18 compilation fixes.
Test Plan:
Reviewers:
CC:
Task ID: #
Blame Rev:
---
src/flashcache_conf.c | 32 ++++++++++++++++++++++++++++-
src/flashcache_procfs.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/src/flashcache_conf.c b/src/flashcache_conf.c
index 36d1e25..ad20539 100644
--- a/src/flashcache_conf.c
+++ b/src/flashcache_conf.c
@@ -91,12 +91,14 @@ static void flashcache_sync_for_remove(struct cache_c *dmc);
extern char *flashcache_sw_version;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
static int
flashcache_wait_schedule(void *unused)
{
schedule();
return 0;
}
+#endif
static int
flashcache_jobs_init(void)
@@ -1222,13 +1224,21 @@ flashcache_ctr(struct dm_target *ti, unsigned int argc, char **argv)
seq_io_move_to_lruhead(dmc, &dmc->seq_recent_ios[i]);
}
dmc->seq_io_tail = &dmc->seq_recent_ios[0];
-
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
(void)wait_on_bit_lock(&flashcache_control->synch_flags, FLASHCACHE_UPDATE_LIST,
flashcache_wait_schedule, TASK_UNINTERRUPTIBLE);
+#else
+ (void)wait_on_bit_lock(&flashcache_control->synch_flags, FLASHCACHE_UPDATE_LIST,
+ TASK_UNINTERRUPTIBLE);
+#endif
dmc->next_cache = cache_list_head;
cache_list_head = dmc;
clear_bit(FLASHCACHE_UPDATE_LIST, &flashcache_control->synch_flags);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
smp_mb__after_clear_bit();
+#else
+ smp_mb__after_atomic();
+#endif
wake_up_bit(&flashcache_control->synch_flags, FLASHCACHE_UPDATE_LIST);
for (i = 0 ; i < dmc->size ; i++) {
@@ -1438,10 +1448,16 @@ flashcache_dtr(struct dm_target *ti)
VERIFY(dmc->num_blacklist_pids == 0);
dm_put_device(ti, dmc->disk_dev);
dm_put_device(ti, dmc->cache_dev);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
(void)wait_on_bit_lock(&flashcache_control->synch_flags,
FLASHCACHE_UPDATE_LIST,
flashcache_wait_schedule,
TASK_UNINTERRUPTIBLE);
+#else
+ (void)wait_on_bit_lock(&flashcache_control->synch_flags,
+ FLASHCACHE_UPDATE_LIST,
+ TASK_UNINTERRUPTIBLE);
+#endif
nodepp = &cache_list_head;
while (*nodepp != NULL) {
if (*nodepp == dmc) {
@@ -1451,7 +1467,11 @@ flashcache_dtr(struct dm_target *ti)
nodepp = &((*nodepp)->next_cache);
}
clear_bit(FLASHCACHE_UPDATE_LIST, &flashcache_control->synch_flags);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
smp_mb__after_clear_bit();
+#else
+ smp_mb__after_atomic();
+#endif
wake_up_bit(&flashcache_control->synch_flags, FLASHCACHE_UPDATE_LIST);
kfree(dmc);
}
@@ -1735,10 +1755,16 @@ flashcache_notify_reboot(struct notifier_block *this,
{
struct cache_c *dmc;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
(void)wait_on_bit_lock(&flashcache_control->synch_flags,
FLASHCACHE_UPDATE_LIST,
flashcache_wait_schedule,
TASK_UNINTERRUPTIBLE);
+#else
+ (void)wait_on_bit_lock(&flashcache_control->synch_flags,
+ FLASHCACHE_UPDATE_LIST,
+ TASK_UNINTERRUPTIBLE);
+#endif
for (dmc = cache_list_head ;
dmc != NULL ;
dmc = dmc->next_cache) {
@@ -1750,7 +1776,11 @@ flashcache_notify_reboot(struct notifier_block *this,
}
}
clear_bit(FLASHCACHE_UPDATE_LIST, &flashcache_control->synch_flags);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
smp_mb__after_clear_bit();
+#else
+ smp_mb__after_atomic();
+#endif
wake_up_bit(&flashcache_control->synch_flags, FLASHCACHE_UPDATE_LIST);
return NOTIFY_DONE;
}
diff --git a/src/flashcache_procfs.c b/src/flashcache_procfs.c
index 2ff33c0..23c5a81 100644
--- a/src/flashcache_procfs.c
+++ b/src/flashcache_procfs.c
@@ -70,12 +70,18 @@ static char *flashcache_cons_sysctl_devname(struct cache_c *dmc);
#define FLASHCACHE_PROC_ROOTDIR_NAME "flashcache"
static int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+flashcache_io_latency_init(struct ctl_table *table, int write,
+ void __user *buffer,
+ size_t *length, loff_t *ppos)
+#else
flashcache_io_latency_init(ctl_table *table, int write,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
struct file *file,
#endif
void __user *buffer,
size_t *length, loff_t *ppos)
+#endif
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
@@ -97,12 +103,18 @@ flashcache_io_latency_init(ctl_table *table, int write,
}
static int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+flashcache_sync_sysctl(struct ctl_table *table, int write,
+ void __user *buffer,
+ size_t *length, loff_t *ppos)
+#else
flashcache_sync_sysctl(ctl_table *table, int write,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
struct file *file,
#endif
void __user *buffer,
size_t *length, loff_t *ppos)
+#endif
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
@@ -123,12 +135,18 @@ flashcache_sync_sysctl(ctl_table *table, int write,
}
static int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+flashcache_zerostats_sysctl(struct ctl_table *table, int write,
+ void __user *buffer,
+ size_t *length, loff_t *ppos)
+#else
flashcache_zerostats_sysctl(ctl_table *table, int write,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
struct file *file,
#endif
void __user *buffer,
size_t *length, loff_t *ppos)
+#endif
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
@@ -151,12 +169,18 @@ flashcache_zerostats_sysctl(ctl_table *table, int write,
}
static int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+flashcache_fallow_clean_speed_sysctl(struct ctl_table *table, int write,
+ void __user *buffer,
+ size_t *length, loff_t *ppos)
+#else
flashcache_fallow_clean_speed_sysctl(ctl_table *table, int write,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
struct file *file,
#endif
void __user *buffer,
size_t *length, loff_t *ppos)
+#endif
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
@@ -176,12 +200,18 @@ flashcache_fallow_clean_speed_sysctl(ctl_table *table, int write,
}
static int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+flashcache_dirty_thresh_sysctl(struct ctl_table *table, int write,
+ void __user *buffer,
+ size_t *length, loff_t *ppos)
+#else
flashcache_dirty_thresh_sysctl(ctl_table *table, int write,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
struct file *file,
#endif
void __user *buffer,
size_t *length, loff_t *ppos)
+#endif
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
@@ -204,12 +234,18 @@ flashcache_dirty_thresh_sysctl(ctl_table *table, int write,
}
static int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+flashcache_lru_hot_pct_sysctl(struct ctl_table *table, int write,
+ void __user *buffer,
+ size_t *length, loff_t *ppos)
+#else
flashcache_lru_hot_pct_sysctl(ctl_table *table, int write,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
struct file *file,
#endif
void __user *buffer,
size_t *length, loff_t *ppos)
+#endif
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
@@ -236,10 +272,17 @@ flashcache_lru_hot_pct_sysctl(ctl_table *table, int write,
static struct flashcache_writeback_sysctl_table {
struct ctl_table_header *sysctl_header;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+ struct ctl_table vars[FLASHCACHE_NUM_WRITEBACK_SYSCTLS];
+ struct ctl_table dev[2];
+ struct ctl_table dir[2];
+ struct ctl_table root[2];
+#else
ctl_table vars[FLASHCACHE_NUM_WRITEBACK_SYSCTLS];
ctl_table dev[2];
ctl_table dir[2];
ctl_table root[2];
+#endif
} flashcache_writeback_sysctl = {
.vars = {
{
@@ -510,10 +553,17 @@ static struct flashcache_writeback_sysctl_table {
static struct flashcache_writethrough_sysctl_table {
struct ctl_table_header *sysctl_header;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+ struct ctl_table vars[FLASHCACHE_NUM_WRITETHROUGH_SYSCTLS];
+ struct ctl_table dev[2];
+ struct ctl_table dir[2];
+ struct ctl_table root[2];
+#else
ctl_table vars[FLASHCACHE_NUM_WRITETHROUGH_SYSCTLS];
ctl_table dev[2];
ctl_table dir[2];
ctl_table root[2];
+#endif
} flashcache_writethrough_sysctl = {
.vars = {
{
@@ -668,7 +718,11 @@ static struct flashcache_writethrough_sysctl_table {
};
int *
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+flashcache_find_sysctl_data(struct cache_c *dmc, struct ctl_table *vars)
+#else
flashcache_find_sysctl_data(struct cache_c *dmc, ctl_table *vars)
+#endif
{
if (strcmp(vars->procname, "io_latency_hist") == 0)
return &dmc->sysctl_io_latency_hist;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment