linux/fs/xfs/xfs_super.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2000-2006 Silicon Graphics, 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_sb.h"
#include "xfs_mount.h"
#include "xfs_inode.h"
#include "xfs_btree.h"
#include "xfs_bmap.h"
#include "xfs_alloc.h"
#include "xfs_fsops.h"
#include "xfs_trans.h"
#include "xfs_buf_item.h"
#include "xfs_log.h"
#include "xfs_log_priv.h"
#include "xfs_dir2.h"
#include "xfs_extfree_item.h"
#include "xfs_mru_cache.h"
#include "xfs_inode_item.h"
#include "xfs_icache.h"
#include "xfs_trace.h"
#include "xfs_icreate_item.h"
#include "xfs_filestream.h"
#include "xfs_quota.h"
#include "xfs_sysfs.h"
#include "xfs_ondisk.h"
#include "xfs_rmap_item.h"
#include "xfs_refcount_item.h"
#include "xfs_bmap_item.h"
#include "xfs_reflink.h"
#include "xfs_pwork.h"
#include "xfs_ag.h"
#include "xfs_defer.h"
#include "xfs_attr_item.h"
#include "xfs_xattr.h"
#include "xfs_iunlink_item.h"
#include "xfs_dahash_test.h"
#include "xfs_rtbitmap.h"
#include "xfs_exchmaps_item.h"
#include "xfs_parent.h"
#include "scrub/stats.h"
#include "scrub/rcbag_btree.h"

#include <linux/magic.h>
#include <linux/fs_context.h>
#include <linux/fs_parser.h>

static const struct super_operations xfs_super_operations;

static struct dentry *xfs_debugfs;	/* top-level xfs debugfs dir */
static struct kset *xfs_kset;		/* top-level xfs sysfs dir */
#ifdef DEBUG
static struct xfs_kobj xfs_dbg_kobj;	/* global debug sysfs attrs */
#endif

enum xfs_dax_mode {};

static void
xfs_mount_set_dax_mode(
	struct xfs_mount	*mp,
	enum xfs_dax_mode	mode)
{}

static const struct constant_table dax_param_enums[] =;

/*
 * Table driven mount option parser.
 */
enum {};

static const struct fs_parameter_spec xfs_fs_parameters[] =;

struct proc_xfs_info {};

static int
xfs_fs_show_options(
	struct seq_file		*m,
	struct dentry		*root)
{}

static bool
xfs_set_inode_alloc_perag(
	struct xfs_perag	*pag,
	xfs_ino_t		ino,
	xfs_agnumber_t		max_metadata)
{}

/*
 * Set parameters for inode allocation heuristics, taking into account
 * filesystem size and inode32/inode64 mount options; i.e. specifically
 * whether or not XFS_FEAT_SMALL_INUMS is set.
 *
 * Inode allocation patterns are altered only if inode32 is requested
 * (XFS_FEAT_SMALL_INUMS), and the filesystem is sufficiently large.
 * If altered, XFS_OPSTATE_INODE32 is set as well.
 *
 * An agcount independent of that in the mount structure is provided
 * because in the growfs case, mp->m_sb.sb_agcount is not yet updated
 * to the potentially higher ag count.
 *
 * Returns the maximum AG index which may contain inodes.
 */
xfs_agnumber_t
xfs_set_inode_alloc(
	struct xfs_mount *mp,
	xfs_agnumber_t	agcount)
{}

static int
xfs_setup_dax_always(
	struct xfs_mount	*mp)
{}

STATIC int
xfs_blkdev_get(
	xfs_mount_t		*mp,
	const char		*name,
	struct file		**bdev_filep)
{}

STATIC void
xfs_shutdown_devices(
	struct xfs_mount	*mp)
{}

/*
 * The file system configurations are:
 *	(1) device (partition) with data and internal log
 *	(2) logical volume with data and log subvolumes.
 *	(3) logical volume with data, log, and realtime subvolumes.
 *
 * We only have to handle opening the log and realtime volumes here if
 * they are present.  The data subvolume has already been opened by
 * get_sb_bdev() and is stored in sb->s_bdev.
 */
STATIC int
xfs_open_devices(
	struct xfs_mount	*mp)
{}

/*
 * Setup xfs_mount buffer target pointers based on superblock
 */
STATIC int
xfs_setup_devices(
	struct xfs_mount	*mp)
{}

STATIC int
xfs_init_mount_workqueues(
	struct xfs_mount	*mp)
{}

STATIC void
xfs_destroy_mount_workqueues(
	struct xfs_mount	*mp)
{}

static void
xfs_flush_inodes_worker(
	struct work_struct	*work)
{}

/*
 * Flush all dirty data to disk. Must not be called while holding an XFS_ILOCK
 * or a page lock. We use sync_inodes_sb() here to ensure we block while waiting
 * for IO to complete so that we effectively throttle multiple callers to the
 * rate at which IO is completing.
 */
void
xfs_flush_inodes(
	struct xfs_mount	*mp)
{}

/* Catch misguided souls that try to use this interface on XFS */
STATIC struct inode *
xfs_fs_alloc_inode(
	struct super_block	*sb)
{}

/*
 * Now that the generic code is guaranteed not to be accessing
 * the linux inode, we can inactivate and reclaim the inode.
 */
STATIC void
xfs_fs_destroy_inode(
	struct inode		*inode)
{}

static void
xfs_fs_dirty_inode(
	struct inode			*inode,
	int				flags)
{}

/*
 * Slab object creation initialisation for the XFS inode.
 * This covers only the idempotent fields in the XFS inode;
 * all other fields need to be initialised on allocation
 * from the slab. This avoids the need to repeatedly initialise
 * fields in the xfs inode that left in the initialise state
 * when freeing the inode.
 */
STATIC void
xfs_fs_inode_init_once(
	void			*inode)
{}

/*
 * We do an unlocked check for XFS_IDONTCACHE here because we are already
 * serialised against cache hits here via the inode->i_lock and igrab() in
 * xfs_iget_cache_hit(). Hence a lookup that might clear this flag will not be
 * racing with us, and it avoids needing to grab a spinlock here for every inode
 * we drop the final reference on.
 */
STATIC int
xfs_fs_drop_inode(
	struct inode		*inode)
{}

static void
xfs_mount_free(
	struct xfs_mount	*mp)
{}

STATIC int
xfs_fs_sync_fs(
	struct super_block	*sb,
	int			wait)
{}

STATIC int
xfs_fs_statfs(
	struct dentry		*dentry,
	struct kstatfs		*statp)
{}

STATIC void
xfs_save_resvblks(struct xfs_mount *mp)
{}

STATIC void
xfs_restore_resvblks(struct xfs_mount *mp)
{}

/*
 * Second stage of a freeze. The data is already frozen so we only
 * need to take care of the metadata. Once that's done sync the superblock
 * to the log to dirty it in case of a crash while frozen. This ensures that we
 * will recover the unlinked inode lists on the next mount.
 */
STATIC int
xfs_fs_freeze(
	struct super_block	*sb)
{}

STATIC int
xfs_fs_unfreeze(
	struct super_block	*sb)
{}

/*
 * This function fills in xfs_mount_t fields based on mount args.
 * Note: the superblock _has_ now been read in.
 */
STATIC int
xfs_finish_flags(
	struct xfs_mount	*mp)
{}

static int
xfs_init_percpu_counters(
	struct xfs_mount	*mp)
{}

void
xfs_reinit_percpu_counters(
	struct xfs_mount	*mp)
{}

static void
xfs_destroy_percpu_counters(
	struct xfs_mount	*mp)
{}

static int
xfs_inodegc_init_percpu(
	struct xfs_mount	*mp)
{}

static void
xfs_inodegc_free_percpu(
	struct xfs_mount	*mp)
{}

static void
xfs_fs_put_super(
	struct super_block	*sb)
{}

static long
xfs_fs_nr_cached_objects(
	struct super_block	*sb,
	struct shrink_control	*sc)
{}

static long
xfs_fs_free_cached_objects(
	struct super_block	*sb,
	struct shrink_control	*sc)
{}

static void
xfs_fs_shutdown(
	struct super_block	*sb)
{}

static const struct super_operations xfs_super_operations =;

static int
suffix_kstrtoint(
	const char	*s,
	unsigned int	base,
	int		*res)
{}

static inline void
xfs_fs_warn_deprecated(
	struct fs_context	*fc,
	struct fs_parameter	*param,
	uint64_t		flag,
	bool			value)
{}

/*
 * Set mount state from a mount option.
 *
 * NOTE: mp->m_super is NULL here!
 */
static int
xfs_fs_parse_param(
	struct fs_context	*fc,
	struct fs_parameter	*param)
{}

static int
xfs_fs_validate_params(
	struct xfs_mount	*mp)
{}

struct dentry *
xfs_debugfs_mkdir(
	const char	*name,
	struct dentry	*parent)
{}

static int
xfs_fs_fill_super(
	struct super_block	*sb,
	struct fs_context	*fc)
{}

static int
xfs_fs_get_tree(
	struct fs_context	*fc)
{}

static int
xfs_remount_rw(
	struct xfs_mount	*mp)
{}

static int
xfs_remount_ro(
	struct xfs_mount	*mp)
{}

/*
 * Logically we would return an error here to prevent users from believing
 * they might have changed mount options using remount which can't be changed.
 *
 * But unfortunately mount(8) adds all options from mtab and fstab to the mount
 * arguments in some cases so we can't blindly reject options, but have to
 * check for each specified option if it actually differs from the currently
 * set option and only reject it if that's the case.
 *
 * Until that is implemented we return success for every remount request, and
 * silently ignore all options that we can't actually change.
 */
static int
xfs_fs_reconfigure(
	struct fs_context *fc)
{}

static void
xfs_fs_free(
	struct fs_context	*fc)
{}

static const struct fs_context_operations xfs_context_ops =;

/*
 * WARNING: do not initialise any parameters in this function that depend on
 * mount option parsing having already been performed as this can be called from
 * fsopen() before any parameters have been set.
 */
static int xfs_init_fs_context(
	struct fs_context	*fc)
{}

static void
xfs_kill_sb(
	struct super_block		*sb)
{}

static struct file_system_type xfs_fs_type =;
MODULE_ALIAS_FS();

STATIC int __init
xfs_init_caches(void)
{}

STATIC void
xfs_destroy_caches(void)
{}

STATIC int __init
xfs_init_workqueues(void)
{}

STATIC void
xfs_destroy_workqueues(void)
{}

STATIC int __init
init_xfs_fs(void)
{}

STATIC void __exit
exit_xfs_fs(void)
{}

module_init();
module_exit(exit_xfs_fs);

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