linux/drivers/nvdimm/badrange.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright(c) 2017 Intel Corporation. All rights reserved.
 */
#include <linux/libnvdimm.h>
#include <linux/badblocks.h>
#include <linux/export.h>
#include <linux/module.h>
#include <linux/blkdev.h>
#include <linux/device.h>
#include <linux/ctype.h>
#include <linux/ndctl.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/io.h>
#include "nd-core.h"
#include "nd.h"

void badrange_init(struct badrange *badrange)
{}
EXPORT_SYMBOL_GPL();

static void append_badrange_entry(struct badrange *badrange,
		struct badrange_entry *bre, u64 addr, u64 length)
{}

static int alloc_and_append_badrange_entry(struct badrange *badrange,
		u64 addr, u64 length, gfp_t flags)
{}

static int add_badrange(struct badrange *badrange, u64 addr, u64 length)
{}

int badrange_add(struct badrange *badrange, u64 addr, u64 length)
{}
EXPORT_SYMBOL_GPL();

void badrange_forget(struct badrange *badrange, phys_addr_t start,
		unsigned int len)
{}
EXPORT_SYMBOL_GPL();

static void set_badblock(struct badblocks *bb, sector_t s, int num)
{}

/**
 * __add_badblock_range() - Convert a physical address range to bad sectors
 * @bb:		badblocks instance to populate
 * @ns_offset:	namespace offset where the error range begins (in bytes)
 * @len:	number of bytes of badrange to be added
 *
 * This assumes that the range provided with (ns_offset, len) is within
 * the bounds of physical addresses for this namespace, i.e. lies in the
 * interval [ns_start, ns_start + ns_size)
 */
static void __add_badblock_range(struct badblocks *bb, u64 ns_offset, u64 len)
{}

static void badblocks_populate(struct badrange *badrange,
		struct badblocks *bb, const struct range *range)
{}

/**
 * nvdimm_badblocks_populate() - Convert a list of badranges to badblocks
 * @nd_region: parent region of the range to interrogate
 * @bb: badblocks instance to populate
 * @range: resource range to consider
 *
 * The badrange list generated during bus initialization may contain
 * multiple, possibly overlapping physical address ranges.  Compare each
 * of these ranges to the resource range currently being initialized,
 * and add badblocks entries for all matching sub-ranges
 */
void nvdimm_badblocks_populate(struct nd_region *nd_region,
		struct badblocks *bb, const struct range *range)
{}
EXPORT_SYMBOL_GPL();