linux/drivers/target/target_core_fabric_configfs.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*******************************************************************************
* Filename: target_core_fabric_configfs.c
 *
 * This file contains generic fabric module configfs infrastructure for
 * TCM v4.x code
 *
 * (c) Copyright 2010-2013 Datera, Inc.
 *
 * Nicholas A. Bellinger <[email protected]>
*
 ****************************************************************************/

#include <linux/kstrtox.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/utsname.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/namei.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/unistd.h>
#include <linux/string.h>
#include <linux/syscalls.h>
#include <linux/configfs.h>

#include <target/target_core_base.h>
#include <target/target_core_backend.h>
#include <target/target_core_fabric.h>

#include "target_core_internal.h"
#include "target_core_alua.h"
#include "target_core_pr.h"

#define TF_CIT_SETUP(_name, _item_ops, _group_ops, _attrs)

#define TF_CIT_SETUP_DRV(_name, _item_ops, _group_ops)

static struct configfs_item_operations target_fabric_port_item_ops;

/* Start of tfc_tpg_mappedlun_cit */

static int target_fabric_mappedlun_link(
	struct config_item *lun_acl_ci,
	struct config_item *lun_ci)
{}

static void target_fabric_mappedlun_unlink(
	struct config_item *lun_acl_ci,
	struct config_item *lun_ci)
{}

static struct se_lun_acl *item_to_lun_acl(struct config_item *item)
{}

static ssize_t target_fabric_mappedlun_write_protect_show(
		struct config_item *item, char *page)
{}

static ssize_t target_fabric_mappedlun_write_protect_store(
		struct config_item *item, const char *page, size_t count)
{}

CONFIGFS_ATTR();

static struct configfs_attribute *target_fabric_mappedlun_attrs[] =;

static void target_fabric_mappedlun_release(struct config_item *item)
{}

static struct configfs_item_operations target_fabric_mappedlun_item_ops =;

TF_CIT_SETUP(tpg_mappedlun, &target_fabric_mappedlun_item_ops, NULL,
		target_fabric_mappedlun_attrs);

/* End of tfc_tpg_mappedlun_cit */

/* Start of tfc_tpg_mappedlun_port_cit */

static struct config_group *target_core_mappedlun_stat_mkdir(
	struct config_group *group,
	const char *name)
{}

static void target_core_mappedlun_stat_rmdir(
	struct config_group *group,
	struct config_item *item)
{}

static struct configfs_group_operations target_fabric_mappedlun_stat_group_ops =;

TF_CIT_SETUP(tpg_mappedlun_stat, NULL, &target_fabric_mappedlun_stat_group_ops,
		NULL);

/* End of tfc_tpg_mappedlun_port_cit */

TF_CIT_SETUP_DRV(tpg_nacl_attrib, NULL, NULL);
TF_CIT_SETUP_DRV(tpg_nacl_auth, NULL, NULL);
TF_CIT_SETUP_DRV(tpg_nacl_param, NULL, NULL);

/* Start of tfc_tpg_nacl_base_cit */

static struct config_group *target_fabric_make_mappedlun(
	struct config_group *group,
	const char *name)
{}

static void target_fabric_drop_mappedlun(
	struct config_group *group,
	struct config_item *item)
{}

static void target_fabric_nacl_base_release(struct config_item *item)
{}

static struct configfs_item_operations target_fabric_nacl_base_item_ops =;

static struct configfs_group_operations target_fabric_nacl_base_group_ops =;

TF_CIT_SETUP_DRV(tpg_nacl_base, &target_fabric_nacl_base_item_ops,
		&target_fabric_nacl_base_group_ops);

/* End of tfc_tpg_nacl_base_cit */

/* Start of tfc_node_fabric_stats_cit */
/*
 * This is used as a placeholder for struct se_node_acl->acl_fabric_stat_group
 * to allow fabrics access to ->acl_fabric_stat_group->default_groups[]
 */
TF_CIT_SETUP(tpg_nacl_stat, NULL, NULL, NULL);

/* End of tfc_wwn_fabric_stats_cit */

/* Start of tfc_tpg_nacl_cit */

static struct config_group *target_fabric_make_nodeacl(
	struct config_group *group,
	const char *name)
{}

static void target_fabric_drop_nodeacl(
	struct config_group *group,
	struct config_item *item)
{}

static struct configfs_group_operations target_fabric_nacl_group_ops =;

TF_CIT_SETUP(tpg_nacl, NULL, &target_fabric_nacl_group_ops, NULL);

/* End of tfc_tpg_nacl_cit */

/* Start of tfc_tpg_np_base_cit */

static void target_fabric_np_base_release(struct config_item *item)
{}

static struct configfs_item_operations target_fabric_np_base_item_ops =;

TF_CIT_SETUP_DRV(tpg_np_base, &target_fabric_np_base_item_ops, NULL);

/* End of tfc_tpg_np_base_cit */

/* Start of tfc_tpg_np_cit */

static struct config_group *target_fabric_make_np(
	struct config_group *group,
	const char *name)
{}

static void target_fabric_drop_np(
	struct config_group *group,
	struct config_item *item)
{}

static struct configfs_group_operations target_fabric_np_group_ops =;

TF_CIT_SETUP(tpg_np, NULL, &target_fabric_np_group_ops, NULL);

/* End of tfc_tpg_np_cit */

/* Start of tfc_tpg_port_cit */

static struct se_lun *item_to_lun(struct config_item *item)
{}

static ssize_t target_fabric_port_alua_tg_pt_gp_show(struct config_item *item,
		char *page)
{}

static ssize_t target_fabric_port_alua_tg_pt_gp_store(struct config_item *item,
		const char *page, size_t count)
{}

static ssize_t target_fabric_port_alua_tg_pt_offline_show(
		struct config_item *item, char *page)
{}

static ssize_t target_fabric_port_alua_tg_pt_offline_store(
		struct config_item *item, const char *page, size_t count)
{}

static ssize_t target_fabric_port_alua_tg_pt_status_show(
		struct config_item *item, char *page)
{}

static ssize_t target_fabric_port_alua_tg_pt_status_store(
		struct config_item *item, const char *page, size_t count)
{}

static ssize_t target_fabric_port_alua_tg_pt_write_md_show(
		struct config_item *item, char *page)
{}

static ssize_t target_fabric_port_alua_tg_pt_write_md_store(
		struct config_item *item, const char *page, size_t count)
{}

CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR();
CONFIGFS_ATTR();

static struct configfs_attribute *target_fabric_port_attrs[] =;

static int target_fabric_port_link(
	struct config_item *lun_ci,
	struct config_item *se_dev_ci)
{}

static void target_fabric_port_unlink(
	struct config_item *lun_ci,
	struct config_item *se_dev_ci)
{}

static void target_fabric_port_release(struct config_item *item)
{}

static struct configfs_item_operations target_fabric_port_item_ops =;

TF_CIT_SETUP(tpg_port, &target_fabric_port_item_ops, NULL, target_fabric_port_attrs);

/* End of tfc_tpg_port_cit */

/* Start of tfc_tpg_port_stat_cit */

static struct config_group *target_core_port_stat_mkdir(
	struct config_group *group,
	const char *name)
{}

static void target_core_port_stat_rmdir(
	struct config_group *group,
	struct config_item *item)
{}

static struct configfs_group_operations target_fabric_port_stat_group_ops =;

TF_CIT_SETUP(tpg_port_stat, NULL, &target_fabric_port_stat_group_ops, NULL);

/* End of tfc_tpg_port_stat_cit */

/* Start of tfc_tpg_lun_cit */

static struct config_group *target_fabric_make_lun(
	struct config_group *group,
	const char *name)
{}

static void target_fabric_drop_lun(
	struct config_group *group,
	struct config_item *item)
{}

static struct configfs_group_operations target_fabric_lun_group_ops =;

TF_CIT_SETUP(tpg_lun, NULL, &target_fabric_lun_group_ops, NULL);

/* End of tfc_tpg_lun_cit */

TF_CIT_SETUP_DRV(tpg_attrib, NULL, NULL);
TF_CIT_SETUP_DRV(tpg_auth, NULL, NULL);
TF_CIT_SETUP_DRV(tpg_param, NULL, NULL);

/* Start of tfc_tpg_base_cit */

static void target_fabric_tpg_release(struct config_item *item)
{}

static struct configfs_item_operations target_fabric_tpg_base_item_ops =;

static ssize_t target_fabric_tpg_base_enable_show(struct config_item *item,
						  char *page)
{}

static ssize_t target_fabric_tpg_base_enable_store(struct config_item *item,
						   const char *page,
						   size_t count)
{}
static ssize_t target_fabric_tpg_base_rtpi_show(struct config_item *item, char *page)
{}

static ssize_t target_fabric_tpg_base_rtpi_store(struct config_item *item,
				   const char *page, size_t count)
{}

CONFIGFS_ATTR();
CONFIGFS_ATTR();

static int
target_fabric_setup_tpg_base_cit(struct target_fabric_configfs *tf)
{}
/* End of tfc_tpg_base_cit */

/* Start of tfc_tpg_cit */

static struct config_group *target_fabric_make_tpg(
	struct config_group *group,
	const char *name)
{}

static void target_fabric_drop_tpg(
	struct config_group *group,
	struct config_item *item)
{}

static void target_fabric_release_wwn(struct config_item *item)
{}

static struct configfs_item_operations target_fabric_tpg_item_ops =;

static struct configfs_group_operations target_fabric_tpg_group_ops =;

TF_CIT_SETUP(tpg, &target_fabric_tpg_item_ops, &target_fabric_tpg_group_ops,
		NULL);

/* End of tfc_tpg_cit */

/* Start of tfc_wwn_fabric_stats_cit */
/*
 * This is used as a placeholder for struct se_wwn->fabric_stat_group
 * to allow fabrics access to ->fabric_stat_group->default_groups[]
 */
TF_CIT_SETUP(wwn_fabric_stats, NULL, NULL, NULL);

/* End of tfc_wwn_fabric_stats_cit */

static ssize_t
target_fabric_wwn_cmd_completion_affinity_show(struct config_item *item,
					       char *page)
{}

static ssize_t
target_fabric_wwn_cmd_completion_affinity_store(struct config_item *item,
						const char *page, size_t count)
{}
CONFIGFS_ATTR();

static ssize_t
target_fabric_wwn_default_submit_type_show(struct config_item *item,
					   char *page)
{}
CONFIGFS_ATTR_RO();

static ssize_t
target_fabric_wwn_direct_submit_supported_show(struct config_item *item,
					       char *page)
{}
CONFIGFS_ATTR_RO();

static struct configfs_attribute *target_fabric_wwn_param_attrs[] =;

TF_CIT_SETUP(wwn_param, NULL, NULL, target_fabric_wwn_param_attrs);

/* Start of tfc_wwn_cit */

static struct config_group *target_fabric_make_wwn(
	struct config_group *group,
	const char *name)
{}

static void target_fabric_drop_wwn(
	struct config_group *group,
	struct config_item *item)
{}

static struct configfs_group_operations target_fabric_wwn_group_ops =;

TF_CIT_SETUP_DRV(wwn, NULL, &target_fabric_wwn_group_ops);
TF_CIT_SETUP_DRV(discovery, NULL, NULL);

int target_fabric_setup_cits(struct target_fabric_configfs *tf)
{}