linux/drivers/md/dm-log.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2003 Sistina Software
 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
 *
 * This file is released under the LGPL.
 */

#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/vmalloc.h>
#include <linux/dm-io.h>
#include <linux/dm-dirty-log.h>

#include <linux/device-mapper.h>

#define DM_MSG_PREFIX

static LIST_HEAD(_log_types);
static DEFINE_SPINLOCK(_lock);

static struct dm_dirty_log_type *__find_dirty_log_type(const char *name)
{}

static struct dm_dirty_log_type *_get_dirty_log_type(const char *name)
{}

/*
 * get_type
 * @type_name
 *
 * Attempt to retrieve the dm_dirty_log_type by name.  If not already
 * available, attempt to load the appropriate module.
 *
 * Log modules are named "dm-log-" followed by the 'type_name'.
 * Modules may contain multiple types.
 * This function will first try the module "dm-log-<type_name>",
 * then truncate 'type_name' on the last '-' and try again.
 *
 * For example, if type_name was "clustered-disk", it would search
 * 'dm-log-clustered-disk' then 'dm-log-clustered'.
 *
 * Returns: dirty_log_type* on success, NULL on failure
 */
static struct dm_dirty_log_type *get_type(const char *type_name)
{}

static void put_type(struct dm_dirty_log_type *type)
{}

int dm_dirty_log_type_register(struct dm_dirty_log_type *type)
{}
EXPORT_SYMBOL();

int dm_dirty_log_type_unregister(struct dm_dirty_log_type *type)
{}
EXPORT_SYMBOL();

struct dm_dirty_log *dm_dirty_log_create(const char *type_name,
			struct dm_target *ti,
			int (*flush_callback_fn)(struct dm_target *ti),
			unsigned int argc, char **argv)
{}
EXPORT_SYMBOL();

void dm_dirty_log_destroy(struct dm_dirty_log *log)
{}
EXPORT_SYMBOL();

/*
 *---------------------------------------------------------------
 * Persistent and core logs share a lot of their implementation.
 * FIXME: need a reload method to be called from a resume
 *---------------------------------------------------------------
 */
/*
 * Magic for persistent mirrors: "MiRr"
 */
#define MIRROR_MAGIC

/*
 * The on-disk version of the metadata.
 */
#define MIRROR_DISK_VERSION
#define LOG_OFFSET

struct log_header_disk {} __packed;

struct log_header_core {};

struct log_c {};

/*
 * The touched member needs to be updated every time we access
 * one of the bitsets.
 */
static inline int log_test_bit(uint32_t *bs, unsigned int bit)
{}

static inline void log_set_bit(struct log_c *l,
			       uint32_t *bs, unsigned int bit)
{}

static inline void log_clear_bit(struct log_c *l,
				 uint32_t *bs, unsigned int bit)
{}

/*
 *---------------------------------------------------------------
 * Header IO
 *--------------------------------------------------------------
 */
static void header_to_disk(struct log_header_core *core, struct log_header_disk *disk)
{}

static void header_from_disk(struct log_header_core *core, struct log_header_disk *disk)
{}

static int rw_header(struct log_c *lc, enum req_op op)
{}

static int flush_header(struct log_c *lc)
{}

static int read_header(struct log_c *log)
{}

static int _check_region_size(struct dm_target *ti, uint32_t region_size)
{}

/*
 *--------------------------------------------------------------
 * core log constructor/destructor
 *
 * argv contains region_size followed optionally by [no]sync
 *--------------------------------------------------------------
 */
#define BYTE_SHIFT
static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti,
			      unsigned int argc, char **argv,
			      struct dm_dev *dev)
{}

static int core_ctr(struct dm_dirty_log *log, struct dm_target *ti,
		    unsigned int argc, char **argv)
{}

static void destroy_log_context(struct log_c *lc)
{}

static void core_dtr(struct dm_dirty_log *log)
{}

/*
 *---------------------------------------------------------------------
 * disk log constructor/destructor
 *
 * argv contains log_device region_size followed optionally by [no]sync
 *---------------------------------------------------------------------
 */
static int disk_ctr(struct dm_dirty_log *log, struct dm_target *ti,
		    unsigned int argc, char **argv)
{}

static void disk_dtr(struct dm_dirty_log *log)
{}

static void fail_log_device(struct log_c *lc)
{}

static int disk_resume(struct dm_dirty_log *log)
{}

static uint32_t core_get_region_size(struct dm_dirty_log *log)
{}

static int core_resume(struct dm_dirty_log *log)
{}

static int core_is_clean(struct dm_dirty_log *log, region_t region)
{}

static int core_in_sync(struct dm_dirty_log *log, region_t region, int block)
{}

static int core_flush(struct dm_dirty_log *log)
{}

static int disk_flush(struct dm_dirty_log *log)
{}

static void core_mark_region(struct dm_dirty_log *log, region_t region)
{}

static void core_clear_region(struct dm_dirty_log *log, region_t region)
{}

static int core_get_resync_work(struct dm_dirty_log *log, region_t *region)
{}

static void core_set_region_sync(struct dm_dirty_log *log, region_t region,
				 int in_sync)
{}

static region_t core_get_sync_count(struct dm_dirty_log *log)
{}

#define DMEMIT_SYNC

static int core_status(struct dm_dirty_log *log, status_type_t status,
		       char *result, unsigned int maxlen)
{}

static int disk_status(struct dm_dirty_log *log, status_type_t status,
		       char *result, unsigned int maxlen)
{}

static struct dm_dirty_log_type _core_type =;

static struct dm_dirty_log_type _disk_type =;

static int __init dm_dirty_log_init(void)
{}

static void __exit dm_dirty_log_exit(void)
{}

module_init();
module_exit(dm_dirty_log_exit);

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();