summaryrefslogtreecommitdiff
path: root/drivers/md/bcache/bcache.h
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-07-25 04:50:06 +0400
committerKent Overstreet <kmo@daterainc.com>2013-11-11 09:56:05 +0400
commit5e6926daac267dd99552ae613f041a9e88bbf258 (patch)
tree0d9ebb689cccc61bc3bfca19c48ac83c5591df28 /drivers/md/bcache/bcache.h
parent72a44517f3ca3725dc86081d105457df46448679 (diff)
downloadlinux-5e6926daac267dd99552ae613f041a9e88bbf258.tar.xz
bcache: Convert writeback to a kthread
This simplifies the writeback flow control quite a bit - previously, it was conceptually two coroutines, refill_dirty() and read_dirty(). This makes the code quite a bit more straightforward. Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/bcache.h')
-rw-r--r--drivers/md/bcache/bcache.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index 09410eb07d82..674e2f42e778 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -509,7 +509,7 @@ struct cached_dev {
/* Limit number of writeback bios in flight */
struct semaphore in_flight;
- struct closure_with_timer writeback;
+ struct task_struct *writeback_thread;
struct keybuf writeback_keys;
@@ -1038,7 +1038,11 @@ static inline void bkey_init(struct bkey *k)
#define KEY_START(k) (KEY_OFFSET(k) - KEY_SIZE(k))
#define START_KEY(k) KEY(KEY_INODE(k), KEY_START(k), 0)
-#define MAX_KEY KEY(~(~0 << 20), ((uint64_t) ~0) >> 1, 0)
+
+#define MAX_KEY_INODE (~(~0 << 20))
+#define MAX_KEY_OFFSET (((uint64_t) ~0) >> 1)
+#define MAX_KEY KEY(MAX_KEY_INODE, MAX_KEY_OFFSET, 0)
+
#define ZERO_KEY KEY(0, 0, 0)
/*
@@ -1214,8 +1218,6 @@ int bch_cache_allocator_init(struct cache *ca);
void bch_debug_exit(void);
int bch_debug_init(struct kobject *);
-void bch_writeback_exit(void);
-int bch_writeback_init(void);
void bch_request_exit(void);
int bch_request_init(void);
void bch_btree_exit(void);