linux/drivers/md/dm-ps-service-time.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2007-2009 NEC Corporation.  All Rights Reserved.
 *
 * Module Author: Kiyoshi Ueda
 *
 * This file is released under the GPL.
 *
 * Throughput oriented path selector.
 */

#include "dm.h"
#include "dm-path-selector.h"

#include <linux/slab.h>
#include <linux/module.h>

#define DM_MSG_PREFIX
#define ST_MIN_IO
#define ST_MAX_RELATIVE_THROUGHPUT
#define ST_MAX_RELATIVE_THROUGHPUT_SHIFT
#define ST_MAX_INFLIGHT_SIZE
#define ST_VERSION

struct selector {};

struct path_info {};

static struct selector *alloc_selector(void)
{}

static int st_create(struct path_selector *ps, unsigned int argc, char **argv)
{}

static void free_paths(struct list_head *paths)
{}

static void st_destroy(struct path_selector *ps)
{}

static int st_status(struct path_selector *ps, struct dm_path *path,
		     status_type_t type, char *result, unsigned int maxlen)
{}

static int st_add_path(struct path_selector *ps, struct dm_path *path,
		       int argc, char **argv, char **error)
{}

static void st_fail_path(struct path_selector *ps, struct dm_path *path)
{}

static int st_reinstate_path(struct path_selector *ps, struct dm_path *path)
{}

/*
 * Compare the estimated service time of 2 paths, pi1 and pi2,
 * for the incoming I/O.
 *
 * Returns:
 * < 0 : pi1 is better
 * 0   : no difference between pi1 and pi2
 * > 0 : pi2 is better
 *
 * Description:
 * Basically, the service time is estimated by:
 *     ('pi->in-flight-size' + 'incoming') / 'pi->relative_throughput'
 * To reduce the calculation, some optimizations are made.
 * (See comments inline)
 */
static int st_compare_load(struct path_info *pi1, struct path_info *pi2,
			   size_t incoming)
{}

static struct dm_path *st_select_path(struct path_selector *ps, size_t nr_bytes)
{}

static int st_start_io(struct path_selector *ps, struct dm_path *path,
		       size_t nr_bytes)
{}

static int st_end_io(struct path_selector *ps, struct dm_path *path,
		     size_t nr_bytes, u64 start_time)
{}

static struct path_selector_type st_ps =;

static int __init dm_st_init(void)
{}

static void __exit dm_st_exit(void)
{}

module_init();
module_exit(dm_st_exit);

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