diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-07-24 17:44:17 -0700 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-10 21:56:08 -0800 |
commit | c18536a72ddd7fe30d63e6c1500b5c930ac14594 (patch) | |
tree | 0794a00a28c810326b76a36f599e8eee1932008a /drivers/md/bcache/writeback.c | |
parent | cc23196631fbcd1bc3eafedbb712413fdbf946a3 (diff) | |
download | op-kernel-dev-c18536a72ddd7fe30d63e6c1500b5c930ac14594.zip op-kernel-dev-c18536a72ddd7fe30d63e6c1500b5c930ac14594.tar.gz |
bcache: Prune struct btree_op
Eventual goal is for struct btree_op to contain only what is necessary
for traversing the btree.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/writeback.c')
-rw-r--r-- | drivers/md/bcache/writeback.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c index c68de9f..b58c2bc 100644 --- a/drivers/md/bcache/writeback.c +++ b/drivers/md/bcache/writeback.c @@ -155,7 +155,7 @@ static void write_dirty_finish(struct closure *cl) for (i = 0; i < KEY_PTRS(&w->key); i++) atomic_inc(&PTR_BUCKET(dc->disk.c, &w->key, i)->pin); - bch_btree_insert(&op, dc->disk.c, &keys); + bch_btree_insert(&op, dc->disk.c, &keys, NULL); closure_sync(&op.cl); if (op.insert_collision) @@ -433,9 +433,16 @@ static int bch_writeback_thread(void *arg) /* Init */ -static int sectors_dirty_init_fn(struct btree_op *op, struct btree *b, +struct sectors_dirty_init { + struct btree_op op; + unsigned inode; +}; + +static int sectors_dirty_init_fn(struct btree_op *_op, struct btree *b, struct bkey *k) { + struct sectors_dirty_init *op = container_of(_op, + struct sectors_dirty_init, op); if (KEY_INODE(k) > op->inode) return MAP_DONE; @@ -448,12 +455,12 @@ static int sectors_dirty_init_fn(struct btree_op *op, struct btree *b, void bch_sectors_dirty_init(struct cached_dev *dc) { - struct btree_op op; + struct sectors_dirty_init op; - bch_btree_op_init_stack(&op); + bch_btree_op_init_stack(&op.op); op.inode = dc->disk.id; - bch_btree_map_keys(&op, dc->disk.c, &KEY(op.inode, 0, 0), + bch_btree_map_keys(&op.op, dc->disk.c, &KEY(op.inode, 0, 0), sectors_dirty_init_fn, 0); } |