linux/drivers/md/persistent-data/dm-transaction-manager.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2011 Red Hat, Inc.
 *
 * This file is released under the GPL.
 */
#include "dm-transaction-manager.h"
#include "dm-space-map.h"
#include "dm-space-map-disk.h"
#include "dm-space-map-metadata.h"
#include "dm-persistent-data-internal.h"

#include <linux/export.h>
#include <linux/mutex.h>
#include <linux/hash.h>
#include <linux/slab.h>
#include <linux/device-mapper.h>

#define DM_MSG_PREFIX

/*----------------------------------------------------------------*/

#define PREFETCH_SIZE
#define PREFETCH_BITS
#define PREFETCH_SENTINEL

struct prefetch_set {};

static unsigned int prefetch_hash(dm_block_t b)
{}

static void prefetch_wipe(struct prefetch_set *p)
{}

static void prefetch_init(struct prefetch_set *p)
{}

static void prefetch_add(struct prefetch_set *p, dm_block_t b)
{}

static void prefetch_issue(struct prefetch_set *p, struct dm_block_manager *bm)
{}

/*----------------------------------------------------------------*/

struct shadow_info {};

/*
 * It would be nice if we scaled with the size of transaction.
 */
#define DM_HASH_SIZE
#define DM_HASH_MASK

struct dm_transaction_manager {};

/*----------------------------------------------------------------*/

static int is_shadow(struct dm_transaction_manager *tm, dm_block_t b)
{}

/*
 * This can silently fail if there's no memory.  We're ok with this since
 * creating redundant shadows causes no harm.
 */
static void insert_shadow(struct dm_transaction_manager *tm, dm_block_t b)
{}

static void wipe_shadow_table(struct dm_transaction_manager *tm)
{}

/*----------------------------------------------------------------*/

static struct dm_transaction_manager *dm_tm_create(struct dm_block_manager *bm,
						   struct dm_space_map *sm)
{}

struct dm_transaction_manager *dm_tm_create_non_blocking_clone(struct dm_transaction_manager *real)
{}
EXPORT_SYMBOL_GPL();

void dm_tm_destroy(struct dm_transaction_manager *tm)
{}
EXPORT_SYMBOL_GPL();

int dm_tm_pre_commit(struct dm_transaction_manager *tm)
{}
EXPORT_SYMBOL_GPL();

int dm_tm_commit(struct dm_transaction_manager *tm, struct dm_block *root)
{}
EXPORT_SYMBOL_GPL();

int dm_tm_new_block(struct dm_transaction_manager *tm,
		    const struct dm_block_validator *v,
		    struct dm_block **result)
{}

static int __shadow_block(struct dm_transaction_manager *tm, dm_block_t orig,
			  const struct dm_block_validator *v,
			  struct dm_block **result)
{}

int dm_tm_shadow_block(struct dm_transaction_manager *tm, dm_block_t orig,
		       const struct dm_block_validator *v, struct dm_block **result,
		       int *inc_children)
{}
EXPORT_SYMBOL_GPL();

int dm_tm_read_lock(struct dm_transaction_manager *tm, dm_block_t b,
		    const struct dm_block_validator *v,
		    struct dm_block **blk)
{}
EXPORT_SYMBOL_GPL();

void dm_tm_unlock(struct dm_transaction_manager *tm, struct dm_block *b)
{}
EXPORT_SYMBOL_GPL();

void dm_tm_inc(struct dm_transaction_manager *tm, dm_block_t b)
{}
EXPORT_SYMBOL_GPL();

void dm_tm_inc_range(struct dm_transaction_manager *tm, dm_block_t b, dm_block_t e)
{}
EXPORT_SYMBOL_GPL();

void dm_tm_dec(struct dm_transaction_manager *tm, dm_block_t b)
{}
EXPORT_SYMBOL_GPL();

void dm_tm_dec_range(struct dm_transaction_manager *tm, dm_block_t b, dm_block_t e)
{}
EXPORT_SYMBOL_GPL();

void dm_tm_with_runs(struct dm_transaction_manager *tm,
		     const __le64 *value_le, unsigned int count, dm_tm_run_fn fn)
{}
EXPORT_SYMBOL_GPL();

int dm_tm_ref(struct dm_transaction_manager *tm, dm_block_t b,
	      uint32_t *result)
{}

int dm_tm_block_is_shared(struct dm_transaction_manager *tm, dm_block_t b,
			  int *result)
{}

struct dm_block_manager *dm_tm_get_bm(struct dm_transaction_manager *tm)
{}

void dm_tm_issue_prefetches(struct dm_transaction_manager *tm)
{}
EXPORT_SYMBOL_GPL();

/*----------------------------------------------------------------*/

static int dm_tm_create_internal(struct dm_block_manager *bm,
				 dm_block_t sb_location,
				 struct dm_transaction_manager **tm,
				 struct dm_space_map **sm,
				 int create,
				 void *sm_root, size_t sm_len)
{}

int dm_tm_create_with_sm(struct dm_block_manager *bm, dm_block_t sb_location,
			 struct dm_transaction_manager **tm,
			 struct dm_space_map **sm)
{}
EXPORT_SYMBOL_GPL();

int dm_tm_open_with_sm(struct dm_block_manager *bm, dm_block_t sb_location,
		       void *sm_root, size_t root_len,
		       struct dm_transaction_manager **tm,
		       struct dm_space_map **sm)
{}
EXPORT_SYMBOL_GPL();

/*----------------------------------------------------------------*/