linux/drivers/md/bcache/journal.c

// SPDX-License-Identifier: GPL-2.0
/*
 * bcache journalling code, for btree insertions
 *
 * Copyright 2012 Google, Inc.
 */

#include "bcache.h"
#include "btree.h"
#include "debug.h"
#include "extents.h"

#include <trace/events/bcache.h>

/*
 * Journal replay/recovery:
 *
 * This code is all driven from run_cache_set(); we first read the journal
 * entries, do some other stuff, then we mark all the keys in the journal
 * entries (same as garbage collection would), then we replay them - reinserting
 * them into the cache in precisely the same order as they appear in the
 * journal.
 *
 * We only journal keys that go in leaf nodes, which simplifies things quite a
 * bit.
 */

static void journal_read_endio(struct bio *bio)
{}

static int journal_read_bucket(struct cache *ca, struct list_head *list,
			       unsigned int bucket_index)
{}

int bch_journal_read(struct cache_set *c, struct list_head *list)
{}

void bch_journal_mark(struct cache_set *c, struct list_head *list)
{}

static bool is_discard_enabled(struct cache_set *s)
{}

int bch_journal_replay(struct cache_set *s, struct list_head *list)
{}

void bch_journal_space_reserve(struct journal *j)
{}

/* Journalling */

static void btree_flush_write(struct cache_set *c)
{}

#define last_seq(j)

static void journal_discard_endio(struct bio *bio)
{}

static void journal_discard_work(struct work_struct *work)
{}

static void do_journal_discard(struct cache *ca)
{}

static unsigned int free_journal_buckets(struct cache_set *c)
{}

static void journal_reclaim(struct cache_set *c)
{}

void bch_journal_next(struct journal *j)
{}

static void journal_write_endio(struct bio *bio)
{}

static CLOSURE_CALLBACK(journal_write);

static CLOSURE_CALLBACK(journal_write_done)
{}

static CLOSURE_CALLBACK(journal_write_unlock)
	__releases(&c->journal.lock)
{}

static CLOSURE_CALLBACK(journal_write_unlocked)
	__releases(c->journal.lock)
{}

static CLOSURE_CALLBACK(journal_write)
{}

static void journal_try_write(struct cache_set *c)
	__releases(c->journal.lock)
{}

static struct journal_write *journal_wait_for_write(struct cache_set *c,
						    unsigned int nkeys)
	__acquires(&c->journal.lock)
{}

static void journal_write_work(struct work_struct *work)
{}

/*
 * Entry point to the journalling code - bio_insert() and btree_invalidate()
 * pass bch_journal() a list of keys to be journalled, and then
 * bch_journal() hands those same keys off to btree_insert_async()
 */

atomic_t *bch_journal(struct cache_set *c,
		      struct keylist *keys,
		      struct closure *parent)
{}

void bch_journal_meta(struct cache_set *c, struct closure *cl)
{}

void bch_journal_free(struct cache_set *c)
{}

int bch_journal_alloc(struct cache_set *c)
{}