linux/fs/nilfs2/super.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * NILFS module and super block management.
 *
 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
 *
 * Written by Ryusuke Konishi.
 */
/*
 *  linux/fs/ext2/super.c
 *
 * Copyright (C) 1992, 1993, 1994, 1995
 * Remy Card ([email protected])
 * Laboratoire MASI - Institut Blaise Pascal
 * Universite Pierre et Marie Curie (Paris VI)
 *
 *  from
 *
 *  linux/fs/minix/inode.c
 *
 *  Copyright (C) 1991, 1992  Linus Torvalds
 *
 *  Big-endian to little-endian byte-swapping/bitmaps by
 *        David S. Miller ([email protected]), 1995
 */

#include <linux/module.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/blkdev.h>
#include <linux/crc32.h>
#include <linux/vfs.h>
#include <linux/writeback.h>
#include <linux/seq_file.h>
#include <linux/mount.h>
#include <linux/fs_context.h>
#include <linux/fs_parser.h>
#include "nilfs.h"
#include "export.h"
#include "mdt.h"
#include "alloc.h"
#include "btree.h"
#include "btnode.h"
#include "page.h"
#include "cpfile.h"
#include "sufile.h" /* nilfs_sufile_resize(), nilfs_sufile_set_alloc_range() */
#include "ifile.h"
#include "dat.h"
#include "segment.h"
#include "segbuf.h"

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

static struct kmem_cache *nilfs_inode_cachep;
struct kmem_cache *nilfs_transaction_cachep;
struct kmem_cache *nilfs_segbuf_cachep;
struct kmem_cache *nilfs_btree_path_cache;

static int nilfs_setup_super(struct super_block *sb, int is_mount);

void __nilfs_msg(struct super_block *sb, const char *fmt, ...)
{}

static void nilfs_set_error(struct super_block *sb)
{}

/**
 * __nilfs_error() - report failure condition on a filesystem
 *
 * __nilfs_error() sets an ERROR_FS flag on the superblock as well as
 * reporting an error message.  This function should be called when
 * NILFS detects incoherences or defects of meta data on disk.
 *
 * This implements the body of nilfs_error() macro.  Normally,
 * nilfs_error() should be used.  As for sustainable errors such as a
 * single-shot I/O error, nilfs_err() should be used instead.
 *
 * Callers should not add a trailing newline since this will do it.
 */
void __nilfs_error(struct super_block *sb, const char *function,
		   const char *fmt, ...)
{}

struct inode *nilfs_alloc_inode(struct super_block *sb)
{}

static void nilfs_free_inode(struct inode *inode)
{}

static int nilfs_sync_super(struct super_block *sb, int flag)
{}

void nilfs_set_log_cursor(struct nilfs_super_block *sbp,
			  struct the_nilfs *nilfs)
{}

struct nilfs_super_block **nilfs_prepare_super(struct super_block *sb,
					       int flip)
{}

int nilfs_commit_super(struct super_block *sb, int flag)
{}

/**
 * nilfs_cleanup_super() - write filesystem state for cleanup
 * @sb: super block instance to be unmounted or degraded to read-only
 *
 * This function restores state flags in the on-disk super block.
 * This will set "clean" flag (i.e. NILFS_VALID_FS) unless the
 * filesystem was not clean previously.
 */
int nilfs_cleanup_super(struct super_block *sb)
{}

/**
 * nilfs_move_2nd_super - relocate secondary super block
 * @sb: super block instance
 * @sb2off: new offset of the secondary super block (in bytes)
 */
static int nilfs_move_2nd_super(struct super_block *sb, loff_t sb2off)
{}

/**
 * nilfs_resize_fs - resize the filesystem
 * @sb: super block instance
 * @newsize: new size of the filesystem (in bytes)
 */
int nilfs_resize_fs(struct super_block *sb, __u64 newsize)
{}

static void nilfs_put_super(struct super_block *sb)
{}

static int nilfs_sync_fs(struct super_block *sb, int wait)
{}

int nilfs_attach_checkpoint(struct super_block *sb, __u64 cno, int curr_mnt,
			    struct nilfs_root **rootp)
{}

static int nilfs_freeze(struct super_block *sb)
{}

static int nilfs_unfreeze(struct super_block *sb)
{}

static int nilfs_statfs(struct dentry *dentry, struct kstatfs *buf)
{}

static int nilfs_show_options(struct seq_file *seq, struct dentry *dentry)
{}

static const struct super_operations nilfs_sops =;

enum {};

static const struct constant_table nilfs_param_err[] =;

static const struct fs_parameter_spec nilfs_param_spec[] =;

struct nilfs_fs_context {};

static int nilfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
{}

static int nilfs_setup_super(struct super_block *sb, int is_mount)
{}

struct nilfs_super_block *nilfs_read_super_block(struct super_block *sb,
						 u64 pos, int blocksize,
						 struct buffer_head **pbh)
{}

int nilfs_store_magic(struct super_block *sb,
		      struct nilfs_super_block *sbp)
{}

int nilfs_check_feature_compatibility(struct super_block *sb,
				      struct nilfs_super_block *sbp)
{}

static int nilfs_get_root_dentry(struct super_block *sb,
				 struct nilfs_root *root,
				 struct dentry **root_dentry)
{}

static int nilfs_attach_snapshot(struct super_block *s, __u64 cno,
				 struct dentry **root_dentry)
{}

/**
 * nilfs_tree_is_busy() - try to shrink dentries of a checkpoint
 * @root_dentry: root dentry of the tree to be shrunk
 *
 * This function returns true if the tree was in-use.
 */
static bool nilfs_tree_is_busy(struct dentry *root_dentry)
{}

int nilfs_checkpoint_is_mounted(struct super_block *sb, __u64 cno)
{}

/**
 * nilfs_fill_super() - initialize a super block instance
 * @sb: super_block
 * @fc: filesystem context
 *
 * This function is called exclusively by nilfs->ns_mount_mutex.
 * So, the recovery process is protected from other simultaneous mounts.
 */
static int
nilfs_fill_super(struct super_block *sb, struct fs_context *fc)
{}

static int nilfs_reconfigure(struct fs_context *fc)
{}

static int
nilfs_get_tree(struct fs_context *fc)
{}

static void nilfs_free_fc(struct fs_context *fc)
{}

static const struct fs_context_operations nilfs_context_ops =;

static int nilfs_init_fs_context(struct fs_context *fc)
{}

struct file_system_type nilfs_fs_type =;
MODULE_ALIAS_FS();

static void nilfs_inode_init_once(void *obj)
{}

static void nilfs_segbuf_init_once(void *obj)
{}

static void nilfs_destroy_cachep(void)
{}

static int __init nilfs_init_cachep(void)
{}

static int __init init_nilfs_fs(void)
{}

static void __exit exit_nilfs_fs(void)
{}

module_init()
module_exit()