linux/fs/gfs2/ops_fstype.c

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

#define pr_fmt(fmt)

#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/completion.h>
#include <linux/buffer_head.h>
#include <linux/blkdev.h>
#include <linux/kthread.h>
#include <linux/export.h>
#include <linux/namei.h>
#include <linux/mount.h>
#include <linux/gfs2_ondisk.h>
#include <linux/quotaops.h>
#include <linux/lockdep.h>
#include <linux/module.h>
#include <linux/backing-dev.h>
#include <linux/fs_parser.h>

#include "gfs2.h"
#include "incore.h"
#include "bmap.h"
#include "glock.h"
#include "glops.h"
#include "inode.h"
#include "recovery.h"
#include "rgrp.h"
#include "super.h"
#include "sys.h"
#include "util.h"
#include "log.h"
#include "quota.h"
#include "dir.h"
#include "meta_io.h"
#include "trace_gfs2.h"
#include "lops.h"

#define DO
#define UNDO

/**
 * gfs2_tune_init - Fill a gfs2_tune structure with default values
 * @gt: tune
 *
 */

static void gfs2_tune_init(struct gfs2_tune *gt)
{}

void free_sbd(struct gfs2_sbd *sdp)
{}

static struct gfs2_sbd *init_sbd(struct super_block *sb)
{}

/**
 * gfs2_check_sb - Check superblock
 * @sdp: the filesystem
 * @silent: Don't print a message if the check fails
 *
 * Checks the version code of the FS is one that we understand how to
 * read and that the sizes of the various on-disk structures have not
 * changed.
 */

static int gfs2_check_sb(struct gfs2_sbd *sdp, int silent)
{}

static void gfs2_sb_in(struct gfs2_sbd *sdp, const struct gfs2_sb *str)
{}

/**
 * gfs2_read_super - Read the gfs2 super block from disk
 * @sdp: The GFS2 super block
 * @sector: The location of the super block
 * @silent: Don't print a message if the check fails
 *
 * This uses the bio functions to read the super block from disk
 * because we want to be 100% sure that we never read cached data.
 * A super block is read twice only during each GFS2 mount and is
 * never written to by the filesystem. The first time its read no
 * locks are held, and the only details which are looked at are those
 * relating to the locking protocol. Once locking is up and working,
 * the sb is read again under the lock to establish the location of
 * the master directory (contains pointers to journals etc) and the
 * root directory.
 *
 * Returns: 0 on success or error
 */

static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent)
{}

/**
 * gfs2_read_sb - Read super block
 * @sdp: The GFS2 superblock
 * @silent: Don't print message if mount fails
 *
 */

static int gfs2_read_sb(struct gfs2_sbd *sdp, int silent)
{}

static int init_names(struct gfs2_sbd *sdp, int silent)
{}

static int init_locking(struct gfs2_sbd *sdp, struct gfs2_holder *mount_gh,
			int undo)
{}

static int gfs2_lookup_root(struct super_block *sb, struct dentry **dptr,
			    u64 no_addr, const char *name)
{}

static int init_sb(struct gfs2_sbd *sdp, int silent)
{}

static void gfs2_others_may_mount(struct gfs2_sbd *sdp)
{}

/**
 * gfs2_jindex_hold - Grab a lock on the jindex
 * @sdp: The GFS2 superblock
 * @ji_gh: the holder for the jindex glock
 *
 * Returns: errno
 */

static int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh)
{}

/**
 * init_statfs - look up and initialize master and local (per node) statfs inodes
 * @sdp: The GFS2 superblock
 *
 * This should be called after the jindex is initialized in init_journal() and
 * before gfs2_journal_recovery() is called because we need to be able to write
 * to these inodes during recovery.
 *
 * Returns: errno
 */
static int init_statfs(struct gfs2_sbd *sdp)
{}

/* Uninitialize and free up memory used by the list of statfs inodes */
static void uninit_statfs(struct gfs2_sbd *sdp)
{}

static int init_journal(struct gfs2_sbd *sdp, int undo)
{}

static struct lock_class_key gfs2_quota_imutex_key;

static int init_inodes(struct gfs2_sbd *sdp, int undo)
{}

static int init_per_node(struct gfs2_sbd *sdp, int undo)
{}

static const match_table_t nolock_tokens =;

static const struct lm_lockops nolock_ops =;

/**
 * gfs2_lm_mount - mount a locking protocol
 * @sdp: the filesystem
 * @silent: if 1, don't complain if the FS isn't a GFS2 fs
 *
 * Returns: errno
 */

static int gfs2_lm_mount(struct gfs2_sbd *sdp, int silent)
{}

void gfs2_lm_unmount(struct gfs2_sbd *sdp)
{}

static int wait_on_journal(struct gfs2_sbd *sdp)
{}

void gfs2_online_uevent(struct gfs2_sbd *sdp)
{}

static int init_threads(struct gfs2_sbd *sdp)
{}

void gfs2_destroy_threads(struct gfs2_sbd *sdp)
{}

/**
 * gfs2_fill_super - Read in superblock
 * @sb: The VFS superblock
 * @fc: Mount options and flags
 *
 * Returns: -errno
 */
static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc)
{}

/**
 * gfs2_get_tree - Get the GFS2 superblock and root directory
 * @fc: The filesystem context
 *
 * Returns: 0 or -errno on error
 */
static int gfs2_get_tree(struct fs_context *fc)
{}

static void gfs2_fc_free(struct fs_context *fc)
{}

enum gfs2_param {};

static const struct constant_table gfs2_param_quota[] =;

enum opt_data {};

static const struct constant_table gfs2_param_data[] =;

enum opt_errors {};

static const struct constant_table gfs2_param_errors[] =;

static const struct fs_parameter_spec gfs2_fs_parameters[] =;

/* Parse a single mount parameter */
static int gfs2_parse_param(struct fs_context *fc, struct fs_parameter *param)
{}

static int gfs2_reconfigure(struct fs_context *fc)
{}

static const struct fs_context_operations gfs2_context_ops =;

/* Set up the filesystem mount context */
static int gfs2_init_fs_context(struct fs_context *fc)
{}

static int set_meta_super(struct super_block *s, struct fs_context *fc)
{}

static int test_meta_super(struct super_block *s, struct fs_context *fc)
{}

static int gfs2_meta_get_tree(struct fs_context *fc)
{}

static const struct fs_context_operations gfs2_meta_context_ops =;

static int gfs2_meta_init_fs_context(struct fs_context *fc)
{}

/**
 * gfs2_evict_inodes - evict inodes cooperatively
 * @sb: the superblock
 *
 * When evicting an inode with a zero link count, we are trying to upgrade the
 * inode's iopen glock from SH to EX mode in order to determine if we can
 * delete the inode.  The other nodes are supposed to evict the inode from
 * their caches if they can, and to poke the inode's inode glock if they cannot
 * do so.  Either behavior allows gfs2_upgrade_iopen_glock() to proceed
 * quickly, but if the other nodes are not cooperating, the lock upgrading
 * attempt will time out.  Since inodes are evicted sequentially, this can add
 * up quickly.
 *
 * Function evict_inodes() tries to keep the s_inode_list_lock list locked over
 * a long time, which prevents other inodes from being evicted concurrently.
 * This precludes the cooperative behavior we are looking for.  This special
 * version of evict_inodes() avoids that.
 *
 * Modeled after drop_pagecache_sb().
 */
static void gfs2_evict_inodes(struct super_block *sb)
{}

static void gfs2_kill_sb(struct super_block *sb)
{}

struct file_system_type gfs2_fs_type =;
MODULE_ALIAS_FS();

struct file_system_type gfs2meta_fs_type =;
MODULE_ALIAS_FS();