linux/fs/xfs/xfs_sysfs.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2014 Red Hat, Inc.
 * All Rights Reserved.
 */

#include "xfs.h"
#include "xfs_shared.h"
#include "xfs_format.h"
#include "xfs_log_format.h"
#include "xfs_trans_resv.h"
#include "xfs_sysfs.h"
#include "xfs_log.h"
#include "xfs_log_priv.h"
#include "xfs_mount.h"

struct xfs_sysfs_attr {};

static inline struct xfs_sysfs_attr *
to_attr(struct attribute *attr)
{}

#define XFS_SYSFS_ATTR_RW(name)
#define XFS_SYSFS_ATTR_RO(name)
#define XFS_SYSFS_ATTR_WO(name)

#define ATTR_LIST(name)

STATIC ssize_t
xfs_sysfs_object_show(
	struct kobject		*kobject,
	struct attribute	*attr,
	char			*buf)
{}

STATIC ssize_t
xfs_sysfs_object_store(
	struct kobject		*kobject,
	struct attribute	*attr,
	const char		*buf,
	size_t			count)
{}

static const struct sysfs_ops xfs_sysfs_ops =;

static struct attribute *xfs_mp_attrs[] =;
ATTRIBUTE_GROUPS();

const struct kobj_type xfs_mp_ktype =;

#ifdef DEBUG
/* debug */

STATIC ssize_t
bug_on_assert_store(
	struct kobject		*kobject,
	const char		*buf,
	size_t			count)
{}

STATIC ssize_t
bug_on_assert_show(
	struct kobject		*kobject,
	char			*buf)
{}
XFS_SYSFS_ATTR_RW();

STATIC ssize_t
log_recovery_delay_store(
	struct kobject	*kobject,
	const char	*buf,
	size_t		count)
{}

STATIC ssize_t
log_recovery_delay_show(
	struct kobject	*kobject,
	char		*buf)
{}
XFS_SYSFS_ATTR_RW();

STATIC ssize_t
mount_delay_store(
	struct kobject	*kobject,
	const char	*buf,
	size_t		count)
{}

STATIC ssize_t
mount_delay_show(
	struct kobject	*kobject,
	char		*buf)
{}
XFS_SYSFS_ATTR_RW();

static ssize_t
always_cow_store(
	struct kobject	*kobject,
	const char	*buf,
	size_t		count)
{}

static ssize_t
always_cow_show(
	struct kobject	*kobject,
	char		*buf)
{}
XFS_SYSFS_ATTR_RW();

/*
 * Override how many threads the parallel work queue is allowed to create.
 * This has to be a debug-only global (instead of an errortag) because one of
 * the main users of parallel workqueues is mount time quotacheck.
 */
STATIC ssize_t
pwork_threads_store(
	struct kobject	*kobject,
	const char	*buf,
	size_t		count)
{}

STATIC ssize_t
pwork_threads_show(
	struct kobject	*kobject,
	char		*buf)
{}
XFS_SYSFS_ATTR_RW();

/*
 * The "LARP" (Logged extended Attribute Recovery Persistence) debugging knob
 * sets the XFS_DA_OP_LOGGED flag on all xfs_attr_set operations performed on
 * V5 filesystems.  As a result, the intermediate progress of all setxattr and
 * removexattr operations are tracked via the log and can be restarted during
 * recovery.  This is useful for testing xattr recovery prior to merging of the
 * parent pointer feature which requires it to maintain consistency, and may be
 * enabled for userspace xattrs in the future.
 */
static ssize_t
larp_store(
	struct kobject	*kobject,
	const char	*buf,
	size_t		count)
{}

STATIC ssize_t
larp_show(
	struct kobject	*kobject,
	char		*buf)
{}
XFS_SYSFS_ATTR_RW();

STATIC ssize_t
bload_leaf_slack_store(
	struct kobject	*kobject,
	const char	*buf,
	size_t		count)
{}

STATIC ssize_t
bload_leaf_slack_show(
	struct kobject	*kobject,
	char		*buf)
{}
XFS_SYSFS_ATTR_RW();

STATIC ssize_t
bload_node_slack_store(
	struct kobject	*kobject,
	const char	*buf,
	size_t		count)
{}

STATIC ssize_t
bload_node_slack_show(
	struct kobject	*kobject,
	char		*buf)
{}
XFS_SYSFS_ATTR_RW();

static struct attribute *xfs_dbg_attrs[] =;
ATTRIBUTE_GROUPS();

const struct kobj_type xfs_dbg_ktype =;

#endif /* DEBUG */

/* stats */

static inline struct xstats *
to_xstats(struct kobject *kobject)
{}

STATIC ssize_t
stats_show(
	struct kobject	*kobject,
	char		*buf)
{}
XFS_SYSFS_ATTR_RO();

STATIC ssize_t
stats_clear_store(
	struct kobject	*kobject,
	const char	*buf,
	size_t		count)
{}
XFS_SYSFS_ATTR_WO();

static struct attribute *xfs_stats_attrs[] =;
ATTRIBUTE_GROUPS();

const struct kobj_type xfs_stats_ktype =;

/* xlog */

static inline struct xlog *
to_xlog(struct kobject *kobject)
{}

STATIC ssize_t
log_head_lsn_show(
	struct kobject	*kobject,
	char		*buf)
{}
XFS_SYSFS_ATTR_RO();

STATIC ssize_t
log_tail_lsn_show(
	struct kobject	*kobject,
	char		*buf)
{}
XFS_SYSFS_ATTR_RO();

STATIC ssize_t
reserve_grant_head_bytes_show(
	struct kobject	*kobject,
	char		*buf)
{}
XFS_SYSFS_ATTR_RO();

STATIC ssize_t
write_grant_head_bytes_show(
	struct kobject	*kobject,
	char		*buf)
{}
XFS_SYSFS_ATTR_RO();

static struct attribute *xfs_log_attrs[] =;
ATTRIBUTE_GROUPS();

const struct kobj_type xfs_log_ktype =;

/*
 * Metadata IO error configuration
 *
 * The sysfs structure here is:
 *	...xfs/<dev>/error/<class>/<errno>/<error_attrs>
 *
 * where <class> allows us to discriminate between data IO and metadata IO,
 * and any other future type of IO (e.g. special inode or directory error
 * handling) we care to support.
 */
static inline struct xfs_error_cfg *
to_error_cfg(struct kobject *kobject)
{}

static inline struct xfs_mount *
err_to_mp(struct kobject *kobject)
{}

static ssize_t
max_retries_show(
	struct kobject	*kobject,
	char		*buf)
{}

static ssize_t
max_retries_store(
	struct kobject	*kobject,
	const char	*buf,
	size_t		count)
{}
XFS_SYSFS_ATTR_RW();

static ssize_t
retry_timeout_seconds_show(
	struct kobject	*kobject,
	char		*buf)
{}

static ssize_t
retry_timeout_seconds_store(
	struct kobject	*kobject,
	const char	*buf,
	size_t		count)
{}
XFS_SYSFS_ATTR_RW();

static ssize_t
fail_at_unmount_show(
	struct kobject	*kobject,
	char		*buf)
{}

static ssize_t
fail_at_unmount_store(
	struct kobject	*kobject,
	const char	*buf,
	size_t		count)
{}
XFS_SYSFS_ATTR_RW();

static struct attribute *xfs_error_attrs[] =;
ATTRIBUTE_GROUPS();

static const struct kobj_type xfs_error_cfg_ktype =;

static const struct kobj_type xfs_error_ktype =;

/*
 * Error initialization tables. These need to be ordered in the same
 * order as the enums used to index the array. All class init tables need to
 * define a "default" behaviour as the first entry, all other entries can be
 * empty.
 */
struct xfs_error_init {};

static const struct xfs_error_init xfs_error_meta_init[XFS_ERR_ERRNO_MAX] =;

static int
xfs_error_sysfs_init_class(
	struct xfs_mount	*mp,
	int			class,
	const char		*parent_name,
	struct xfs_kobj		*parent_kobj,
	const struct xfs_error_init init[])
{}

int
xfs_error_sysfs_init(
	struct xfs_mount	*mp)
{}

void
xfs_error_sysfs_del(
	struct xfs_mount	*mp)
{}

struct xfs_error_cfg *
xfs_error_get_cfg(
	struct xfs_mount	*mp,
	int			error_class,
	int			error)
{}