Blame libmultipath/prio.h

Packit Service 0af388
#ifndef _PRIO_H
Packit Service 0af388
#define _PRIO_H
Packit Service 0af388
Packit Service 0af388
/*
Packit Service 0af388
 * knowing about path struct gives flexibility to prioritizers
Packit Service 0af388
 */
Packit Service 0af388
#include "checkers.h"
Packit Service 0af388
#include "vector.h"
Packit Service 0af388
Packit Service 0af388
/* forward declaration to avoid circular dependency */
Packit Service 0af388
struct path;
Packit Service 0af388
Packit Service 0af388
#include "list.h"
Packit Service 0af388
#include "memory.h"
Packit Service 0af388
#include "defaults.h"
Packit Service 0af388
Packit Service 0af388
/*
Packit Service 0af388
 * Known prioritizers for use in hwtable.c
Packit Service 0af388
 */
Packit Service 0af388
#define PRIO_ALUA		"alua"
Packit Service 0af388
#define PRIO_CONST		"const"
Packit Service 0af388
#define PRIO_DATACORE		"datacore"
Packit Service 0af388
#define PRIO_EMC		"emc"
Packit Service 0af388
#define PRIO_HDS		"hds"
Packit Service 0af388
#define PRIO_HP_SW		"hp_sw"
Packit Service 0af388
#define PRIO_IET		"iet"
Packit Service 0af388
#define PRIO_ONTAP		"ontap"
Packit Service 0af388
#define PRIO_RANDOM		"random"
Packit Service 0af388
#define PRIO_RDAC		"rdac"
Packit Service 0af388
#define PRIO_WEIGHTED_PATH	"weightedpath"
Packit Service 0af388
#define PRIO_SYSFS		"sysfs"
Packit Service 0af388
#define PRIO_PATH_LATENCY	"path_latency"
Packit Service 0af388
#define PRIO_ANA		"ana"
Packit Service 0af388
Packit Service 0af388
/*
Packit Service 0af388
 * Value used to mark the fact prio was not defined
Packit Service 0af388
 */
Packit Service 0af388
#define PRIO_UNDEF -1
Packit Service 0af388
Packit Service 0af388
/*
Packit Service 0af388
 * strings lengths
Packit Service 0af388
 */
Packit Service 0af388
#define LIB_PRIO_NAMELEN 255
Packit Service 0af388
#define PRIO_NAME_LEN 16
Packit Service 0af388
#define PRIO_ARGS_LEN 255
Packit Service 0af388
Packit Service 0af388
struct prio {
Packit Service 0af388
	void *handle;
Packit Service 0af388
	int refcount;
Packit Service 0af388
	struct list_head node;
Packit Service 0af388
	char name[PRIO_NAME_LEN];
Packit Service 0af388
	char args[PRIO_ARGS_LEN];
Packit Service 0af388
	int (*getprio)(struct path *, char *, unsigned int);
Packit Service 0af388
};
Packit Service 0af388
Packit Service 0af388
unsigned int get_prio_timeout(unsigned int checker_timeout,
Packit Service 0af388
			      unsigned int default_timeout);
Packit Service 0af388
int init_prio (char *);
Packit Service 0af388
void cleanup_prio (void);
Packit Service 0af388
struct prio * add_prio (char *, char *);
Packit Service 0af388
int prio_getprio (struct prio *, struct path *, unsigned int);
Packit Service 0af388
void prio_get (char *, struct prio *, char *, char *);
Packit Service 0af388
void prio_put (struct prio *);
Packit Service 0af388
int prio_selected (const struct prio *);
Packit Service 0af388
const char * prio_name (const struct prio *);
Packit Service 0af388
const char * prio_args (const struct prio *);
Packit Service 0af388
int prio_set_args (struct prio *, const char *);
Packit Service 0af388
Packit Service 0af388
/* The only function exported by prioritizer dynamic libraries (.so) */
Packit Service 0af388
int getprio(struct path *, char *, unsigned int);
Packit Service 0af388
Packit Service 0af388
#endif /* _PRIO_H */