journal.c (6f10f7d1b02b1bbc305f88d7696445dd38b13881) journal.c (1fae7cf05293d3a2c9e59c1bc59372322386467c)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * bcache journalling code, for btree insertions
4 *
5 * Copyright 2012 Google, Inc.
6 */
7
8#include "bcache.h"

--- 14 unchanged lines hidden (view full) ---

23 *
24 * We only journal keys that go in leaf nodes, which simplifies things quite a
25 * bit.
26 */
27
28static void journal_read_endio(struct bio *bio)
29{
30 struct closure *cl = bio->bi_private;
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * bcache journalling code, for btree insertions
4 *
5 * Copyright 2012 Google, Inc.
6 */
7
8#include "bcache.h"

--- 14 unchanged lines hidden (view full) ---

23 *
24 * We only journal keys that go in leaf nodes, which simplifies things quite a
25 * bit.
26 */
27
28static void journal_read_endio(struct bio *bio)
29{
30 struct closure *cl = bio->bi_private;
31
31 closure_put(cl);
32}
33
34static int journal_read_bucket(struct cache *ca, struct list_head *list,
35 unsigned int bucket_index)
36{
37 struct journal_device *ja = &ca->journal;
38 struct bio *bio = &ja->bio;

--- 570 unchanged lines hidden (view full) ---

609 struct cache *ca;
610 struct journal_write *w = c->journal.cur;
611 struct bkey *k = &c->journal.key;
612 unsigned int i, sectors = set_blocks(w->data, block_bytes(c)) *
613 c->sb.block_size;
614
615 struct bio *bio;
616 struct bio_list list;
32 closure_put(cl);
33}
34
35static int journal_read_bucket(struct cache *ca, struct list_head *list,
36 unsigned int bucket_index)
37{
38 struct journal_device *ja = &ca->journal;
39 struct bio *bio = &ja->bio;

--- 570 unchanged lines hidden (view full) ---

610 struct cache *ca;
611 struct journal_write *w = c->journal.cur;
612 struct bkey *k = &c->journal.key;
613 unsigned int i, sectors = set_blocks(w->data, block_bytes(c)) *
614 c->sb.block_size;
615
616 struct bio *bio;
617 struct bio_list list;
618
617 bio_list_init(&list);
618
619 if (!w->need_write) {
620 closure_return_with_destructor(cl, journal_write_unlock);
621 return;
622 } else if (journal_full(&c->journal)) {
623 journal_reclaim(c);
624 spin_unlock(&c->journal.lock);

--- 229 unchanged lines hidden ---
619 bio_list_init(&list);
620
621 if (!w->need_write) {
622 closure_return_with_destructor(cl, journal_write_unlock);
623 return;
624 } else if (journal_full(&c->journal)) {
625 journal_reclaim(c);
626 spin_unlock(&c->journal.lock);

--- 229 unchanged lines hidden ---