linux/fs/bcachefs/super-io.c

// SPDX-License-Identifier: GPL-2.0

#include "bcachefs.h"
#include "checksum.h"
#include "disk_groups.h"
#include "ec.h"
#include "error.h"
#include "journal.h"
#include "journal_sb.h"
#include "journal_seq_blacklist.h"
#include "recovery_passes.h"
#include "replicas.h"
#include "quota.h"
#include "sb-clean.h"
#include "sb-counters.h"
#include "sb-downgrade.h"
#include "sb-errors.h"
#include "sb-members.h"
#include "super-io.h"
#include "super.h"
#include "trace.h"
#include "vstructs.h"

#include <linux/backing-dev.h>
#include <linux/sort.h>

static const struct blk_holder_ops bch2_sb_handle_bdev_ops =;

struct bch2_metadata_version {};

static const struct bch2_metadata_version bch2_metadata_versions[] =;

void bch2_version_to_text(struct printbuf *out, unsigned v)
{}

unsigned bch2_latest_compatible_version(unsigned v)
{}

const char * const bch2_sb_fields[] =;

static int bch2_sb_field_validate(struct bch_sb *, struct bch_sb_field *,
				  enum bch_validate_flags, struct printbuf *);

struct bch_sb_field *bch2_sb_field_get_id(struct bch_sb *sb,
				      enum bch_sb_field_type type)
{}

static struct bch_sb_field *__bch2_sb_field_resize(struct bch_sb_handle *sb,
						   struct bch_sb_field *f,
						   unsigned u64s)
{}

void bch2_sb_field_delete(struct bch_sb_handle *sb,
			  enum bch_sb_field_type type)
{}

/* Superblock realloc/free: */

void bch2_free_super(struct bch_sb_handle *sb)
{}

int bch2_sb_realloc(struct bch_sb_handle *sb, unsigned u64s)
{}

struct bch_sb_field *bch2_sb_field_resize_id(struct bch_sb_handle *sb,
					  enum bch_sb_field_type type,
					  unsigned u64s)
{}

struct bch_sb_field *bch2_sb_field_get_minsize_id(struct bch_sb_handle *sb,
						  enum bch_sb_field_type type,
						  unsigned u64s)
{}

/* Superblock validate: */

static int validate_sb_layout(struct bch_sb_layout *layout, struct printbuf *out)
{}

static int bch2_sb_compatible(struct bch_sb *sb, struct printbuf *out)
{}

static int bch2_sb_validate(struct bch_sb_handle *disk_sb,
			    enum bch_validate_flags flags, struct printbuf *out)
{}

/* device open: */

static unsigned long le_ulong_to_cpu(unsigned long v)
{}

static void le_bitvector_to_cpu(unsigned long *dst, unsigned long *src, unsigned nr)
{}

static void bch2_sb_update(struct bch_fs *c)
{}

static int __copy_super(struct bch_sb_handle *dst_handle, struct bch_sb *src)
{}

int bch2_sb_to_fs(struct bch_fs *c, struct bch_sb *src)
{}

int bch2_sb_from_fs(struct bch_fs *c, struct bch_dev *ca)
{}

/* read superblock: */

static int read_one_super(struct bch_sb_handle *sb, u64 offset, struct printbuf *err)
{}

static int __bch2_read_super(const char *path, struct bch_opts *opts,
		    struct bch_sb_handle *sb, bool ignore_notbchfs_msg)
{}

int bch2_read_super(const char *path, struct bch_opts *opts,
		    struct bch_sb_handle *sb)
{}

/* provide a silenced version for mount.bcachefs */

int bch2_read_super_silent(const char *path, struct bch_opts *opts,
		    struct bch_sb_handle *sb)
{}

/* write superblock: */

static void write_super_endio(struct bio *bio)
{}

static void read_back_super(struct bch_fs *c, struct bch_dev *ca)
{}

static void write_one_super(struct bch_fs *c, struct bch_dev *ca, unsigned idx)
{}

int bch2_write_super(struct bch_fs *c)
{}

void __bch2_check_set_feature(struct bch_fs *c, unsigned feat)
{}

/* Downgrade if superblock is at a higher version than currently supported: */
bool bch2_check_version_downgrade(struct bch_fs *c)
{}

void bch2_sb_upgrade(struct bch_fs *c, unsigned new_version)
{}

static int bch2_sb_ext_validate(struct bch_sb *sb, struct bch_sb_field *f,
				enum bch_validate_flags flags, struct printbuf *err)
{}

static void bch2_sb_ext_to_text(struct printbuf *out, struct bch_sb *sb,
				struct bch_sb_field *f)
{}

static const struct bch_sb_field_ops bch_sb_field_ops_ext =;

static const struct bch_sb_field_ops *bch2_sb_field_ops[] =;

static const struct bch_sb_field_ops bch2_sb_field_null_ops;

static const struct bch_sb_field_ops *bch2_sb_field_type_ops(unsigned type)
{}

static int bch2_sb_field_validate(struct bch_sb *sb, struct bch_sb_field *f,
				  enum bch_validate_flags flags, struct printbuf *err)
{}

void __bch2_sb_field_to_text(struct printbuf *out, struct bch_sb *sb,
			     struct bch_sb_field *f)
{}

void bch2_sb_field_to_text(struct printbuf *out, struct bch_sb *sb,
			   struct bch_sb_field *f)
{}

void bch2_sb_layout_to_text(struct printbuf *out, struct bch_sb_layout *l)
{}

void bch2_sb_to_text(struct printbuf *out, struct bch_sb *sb,
		     bool print_layout, unsigned fields)
{}