linux/fs/dlm/config.c

// SPDX-License-Identifier: GPL-2.0-only
/******************************************************************************
*******************************************************************************
**
**  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
**  Copyright (C) 2004-2011 Red Hat, Inc.  All rights reserved.
**
**
*******************************************************************************
******************************************************************************/

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/configfs.h>
#include <linux/slab.h>
#include <linux/in.h>
#include <linux/in6.h>
#include <linux/dlmconstants.h>
#include <net/ipv6.h>
#include <net/sock.h>

#include "config.h"
#include "midcomms.h"
#include "lowcomms.h"

/*
 * /config/dlm/<cluster>/spaces/<space>/nodes/<node>/nodeid
 * /config/dlm/<cluster>/spaces/<space>/nodes/<node>/weight
 * /config/dlm/<cluster>/comms/<comm>/nodeid
 * /config/dlm/<cluster>/comms/<comm>/local
 * /config/dlm/<cluster>/comms/<comm>/addr      (write only)
 * /config/dlm/<cluster>/comms/<comm>/addr_list (read only)
 * The <cluster> level is useless, but I haven't figured out how to avoid it.
 */

static struct config_group *space_list;
static struct config_group *comm_list;
static struct dlm_comm *local_comm;
static uint32_t dlm_comm_count;

struct dlm_clusters;
struct dlm_cluster;
struct dlm_spaces;
struct dlm_space;
struct dlm_comms;
struct dlm_comm;
struct dlm_nodes;
struct dlm_node;

static struct config_group *make_cluster(struct config_group *, const char *);
static void drop_cluster(struct config_group *, struct config_item *);
static void release_cluster(struct config_item *);
static struct config_group *make_space(struct config_group *, const char *);
static void drop_space(struct config_group *, struct config_item *);
static void release_space(struct config_item *);
static struct config_item *make_comm(struct config_group *, const char *);
static void drop_comm(struct config_group *, struct config_item *);
static void release_comm(struct config_item *);
static struct config_item *make_node(struct config_group *, const char *);
static void drop_node(struct config_group *, struct config_item *);
static void release_node(struct config_item *);

static struct configfs_attribute *comm_attrs[];
static struct configfs_attribute *node_attrs[];

const struct rhashtable_params dlm_rhash_rsb_params =;

struct dlm_cluster {};

static struct dlm_cluster *config_item_to_cluster(struct config_item *i)
{}

enum {};

static ssize_t cluster_cluster_name_show(struct config_item *item, char *buf)
{}

static ssize_t cluster_cluster_name_store(struct config_item *item,
					  const char *buf, size_t len)
{}

CONFIGFS_ATTR();

static ssize_t cluster_set(struct dlm_cluster *cl, unsigned int *cl_field,
			   int *info_field, int (*check_cb)(unsigned int x),
			   const char *buf, size_t len)
{}

#define CLUSTER_ATTR(name, check_cb)

static int dlm_check_protocol_and_dlm_running(unsigned int x)
{}

static int dlm_check_zero_and_dlm_running(unsigned int x)
{}

static int dlm_check_zero(unsigned int x)
{}

static int dlm_check_buffer_size(unsigned int x)
{}

CLUSTER_ATTR(tcp_port, dlm_check_zero_and_dlm_running);
CLUSTER_ATTR(buffer_size, dlm_check_buffer_size);
CLUSTER_ATTR(rsbtbl_size, dlm_check_zero);
CLUSTER_ATTR(recover_timer, dlm_check_zero);
CLUSTER_ATTR(toss_secs, dlm_check_zero);
CLUSTER_ATTR(scan_secs, dlm_check_zero);
CLUSTER_ATTR(log_debug, NULL);
CLUSTER_ATTR(log_info, NULL);
CLUSTER_ATTR(protocol, dlm_check_protocol_and_dlm_running);
CLUSTER_ATTR(mark, NULL);
CLUSTER_ATTR(new_rsb_count, NULL);
CLUSTER_ATTR(recover_callbacks, NULL);

static struct configfs_attribute *cluster_attrs[] =;

enum {};

enum {};

struct dlm_clusters {};

struct dlm_spaces {};

struct dlm_space {};

struct dlm_comms {};

struct dlm_comm {};

struct dlm_nodes {};

struct dlm_node {};

static struct configfs_group_operations clusters_ops =;

static struct configfs_item_operations cluster_ops =;

static struct configfs_group_operations spaces_ops =;

static struct configfs_item_operations space_ops =;

static struct configfs_group_operations comms_ops =;

static struct configfs_item_operations comm_ops =;

static struct configfs_group_operations nodes_ops =;

static struct configfs_item_operations node_ops =;

static const struct config_item_type clusters_type =;

static const struct config_item_type cluster_type =;

static const struct config_item_type spaces_type =;

static const struct config_item_type space_type =;

static const struct config_item_type comms_type =;

static const struct config_item_type comm_type =;

static const struct config_item_type nodes_type =;

static const struct config_item_type node_type =;

static struct dlm_space *config_item_to_space(struct config_item *i)
{}

static struct dlm_comm *config_item_to_comm(struct config_item *i)
{}

static struct dlm_node *config_item_to_node(struct config_item *i)
{}

static struct config_group *make_cluster(struct config_group *g,
					 const char *name)
{}

static void drop_cluster(struct config_group *g, struct config_item *i)
{}

static void release_cluster(struct config_item *i)
{}

static struct config_group *make_space(struct config_group *g, const char *name)
{}

static void drop_space(struct config_group *g, struct config_item *i)
{}

static void release_space(struct config_item *i)
{}

static struct config_item *make_comm(struct config_group *g, const char *name)
{}

static void drop_comm(struct config_group *g, struct config_item *i)
{}

static void release_comm(struct config_item *i)
{}

static struct config_item *make_node(struct config_group *g, const char *name)
{}

static void drop_node(struct config_group *g, struct config_item *i)
{}

static void release_node(struct config_item *i)
{}

static struct dlm_clusters clusters_root =;

int __init dlm_config_init(void)
{}

void dlm_config_exit(void)
{}

/*
 * Functions for user space to read/write attributes
 */

static ssize_t comm_nodeid_show(struct config_item *item, char *buf)
{}

static ssize_t comm_nodeid_store(struct config_item *item, const char *buf,
				 size_t len)
{}

static ssize_t comm_local_show(struct config_item *item, char *buf)
{}

static ssize_t comm_local_store(struct config_item *item, const char *buf,
				size_t len)
{}

static ssize_t comm_addr_store(struct config_item *item, const char *buf,
		size_t len)
{}

static ssize_t comm_addr_list_show(struct config_item *item, char *buf)
{}

static ssize_t comm_mark_show(struct config_item *item, char *buf)
{}

static ssize_t comm_mark_store(struct config_item *item, const char *buf,
			       size_t len)
{}

CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR_WO();
CONFIGFS_ATTR_RO();

static struct configfs_attribute *comm_attrs[] =;

static ssize_t node_nodeid_show(struct config_item *item, char *buf)
{}

static ssize_t node_nodeid_store(struct config_item *item, const char *buf,
				 size_t len)
{}

static ssize_t node_weight_show(struct config_item *item, char *buf)
{}

static ssize_t node_weight_store(struct config_item *item, const char *buf,
				 size_t len)
{}

CONFIGFS_ATTR();
CONFIGFS_ATTR();

static struct configfs_attribute *node_attrs[] =;

/*
 * Functions for the dlm to get the info that's been configured
 */

static struct dlm_space *get_space(char *name)
{}

static void put_space(struct dlm_space *sp)
{}

static struct dlm_comm *get_comm(int nodeid)
{}

static void put_comm(struct dlm_comm *cm)
{}

/* caller must free mem */
int dlm_config_nodes(char *lsname, struct dlm_config_node **nodes_out,
		     int *count_out)
{}

int dlm_comm_seq(int nodeid, uint32_t *seq)
{}

int dlm_our_nodeid(void)
{}

/* num 0 is first addr, num 1 is second addr */
int dlm_our_addr(struct sockaddr_storage *addr, int num)
{}

/* Config file defaults */
#define DEFAULT_TCP_PORT
#define DEFAULT_RSBTBL_SIZE
#define DEFAULT_RECOVER_TIMER
#define DEFAULT_TOSS_SECS
#define DEFAULT_SCAN_SECS
#define DEFAULT_LOG_DEBUG
#define DEFAULT_LOG_INFO
#define DEFAULT_PROTOCOL
#define DEFAULT_MARK
#define DEFAULT_NEW_RSB_COUNT
#define DEFAULT_RECOVER_CALLBACKS
#define DEFAULT_CLUSTER_NAME

struct dlm_config_info dlm_config =;