summaryrefslogtreecommitdiff
path: root/third-party
diff options
context:
space:
mode:
authorIgor Canadi <icanadi@fb.com>2015-03-30 09:51:11 -0700
committerIgor Canadi <icanadi@fb.com>2015-03-30 09:51:11 -0700
commitd61cb0b9dea95510a78d1cf5b9f0d4d1137ad14e (patch)
tree5a48bd6a38e29b9dc6aac63c4159b59f97b0840b /third-party
parent1c47c433ba2c391dc0367edf16b3138afb3e8af1 (diff)
db_bench can now disable flashcache for background threads
Summary: Most of the approach is copied from WebSQL's MySQL branch. It's nice that we can do this without touching core RocksDB code. Test Plan: Compiles and runs. Didn't test flashback code, as I don't have flashback device and most if it is c/p Reviewers: MarkCallaghan, sdong Reviewed By: sdong Subscribers: rven, lgalanis, kradhakrishnan, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D35391
Diffstat (limited to 'third-party')
-rw-r--r--third-party/flashcache/flashcache_ioctl.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/third-party/flashcache/flashcache_ioctl.h b/third-party/flashcache/flashcache_ioctl.h
new file mode 100644
index 000000000..af111ab4d
--- /dev/null
+++ b/third-party/flashcache/flashcache_ioctl.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+ * flashcache_ioctl.h
+ * FlashCache: Device mapper target for block-level disk caching
+ *
+ * Copyright 2010 Facebook, Inc.
+ * Author: Mohan Srinivasan (mohan@facebook.com)
+ *
+ * Based on DM-Cache:
+ * Copyright (C) International Business Machines Corp., 2006
+ * Author: Ming Zhao (mingzhao@ufl.edu)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; under version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ ****************************************************************************/
+
+#ifdef OS_LINUX
+#ifndef FLASHCACHE_IOCTL_H
+#define FLASHCACHE_IOCTL_H
+
+#include <linux/types.h>
+
+#define FLASHCACHE_IOCTL 0xfe
+
+enum {
+ FLASHCACHEADDNCPID_CMD=200,
+ FLASHCACHEDELNCPID_CMD,
+ FLASHCACHEDELNCALL_CMD,
+ FLASHCACHEADDWHITELIST_CMD,
+ FLASHCACHEDELWHITELIST_CMD,
+ FLASHCACHEDELWHITELISTALL_CMD,
+};
+
+#define FLASHCACHEADDNCPID _IOW(FLASHCACHE_IOCTL, FLASHCACHEADDNCPID_CMD, pid_t)
+#define FLASHCACHEDELNCPID _IOW(FLASHCACHE_IOCTL, FLASHCACHEDELNCPID_CMD, pid_t)
+#define FLASHCACHEDELNCALL _IOW(FLASHCACHE_IOCTL, FLASHCACHEDELNCALL_CMD, pid_t)
+
+#define FLASHCACHEADDBLACKLIST FLASHCACHEADDNCPID
+#define FLASHCACHEDELBLACKLIST FLASHCACHEDELNCPID
+#define FLASHCACHEDELALLBLACKLIST FLASHCACHEDELNCALL
+
+#define FLASHCACHEADDWHITELIST _IOW(FLASHCACHE_IOCTL, FLASHCACHEADDWHITELIST_CMD, pid_t)
+#define FLASHCACHEDELWHITELIST _IOW(FLASHCACHE_IOCTL, FLASHCACHEDELWHITELIST_CMD, pid_t)
+#define FLASHCACHEDELALLWHITELIST _IOW(FLASHCACHE_IOCTL, FLASHCACHEDELWHITELISTALL_CMD, pid_t)
+
+#endif /* FLASHCACHE_IOCTL_H */
+#endif /* OS_LINUX */