linux/fs/ext4/ext4.h

// SPDX-License-Identifier: GPL-2.0
/*
 *  ext4.h
 *
 * Copyright (C) 1992, 1993, 1994, 1995
 * Remy Card ([email protected])
 * Laboratoire MASI - Institut Blaise Pascal
 * Universite Pierre et Marie Curie (Paris VI)
 *
 *  from
 *
 *  linux/include/linux/minix_fs.h
 *
 *  Copyright (C) 1991, 1992  Linus Torvalds
 */

#ifndef _EXT4_H
#define _EXT4_H

#include <linux/refcount.h>
#include <linux/types.h>
#include <linux/blkdev.h>
#include <linux/magic.h>
#include <linux/jbd2.h>
#include <linux/quota.h>
#include <linux/rwsem.h>
#include <linux/rbtree.h>
#include <linux/seqlock.h>
#include <linux/mutex.h>
#include <linux/timer.h>
#include <linux/wait.h>
#include <linux/sched/signal.h>
#include <linux/blockgroup_lock.h>
#include <linux/percpu_counter.h>
#include <linux/ratelimit.h>
#include <crypto/hash.h>
#include <linux/falloc.h>
#include <linux/percpu-rwsem.h>
#include <linux/fiemap.h>
#ifdef __KERNEL__
#include <linux/compat.h>
#endif
#include <uapi/linux/ext4.h>

#include <linux/fscrypt.h>
#include <linux/fsverity.h>

#include <linux/compiler.h>

/*
 * The fourth extended filesystem constants/structures
 */

/*
 * with AGGRESSIVE_CHECK allocator runs consistency checks over
 * structures. these checks slow things down a lot
 */
#define AGGRESSIVE_CHECK__

/*
 * with DOUBLE_CHECK defined mballoc creates persistent in-core
 * bitmaps, maintains and uses them to check for double allocations
 */
#define DOUBLE_CHECK__

/*
 * Define EXT4FS_DEBUG to produce debug messages
 */
#undef EXT4FS_DEBUG

/*
 * Debug code
 */
#ifdef EXT4FS_DEBUG
#define ext4_debug
#else
#define ext4_debug(fmt, ...)
#endif

 /*
  * Turn on EXT_DEBUG to enable ext4_ext_show_path/leaf/move in extents.c
  */
#define EXT_DEBUG__

/*
 * Dynamic printk for controlled extents debugging.
 */
#ifdef CONFIG_EXT4_DEBUG
#define ext_debug(ino, fmt, ...)
#else
#define ext_debug
#endif

#define ASSERT(assert)

/* data type for block offset of block group */
ext4_grpblk_t;

/* data type for filesystem-wide blocks number */
ext4_fsblk_t;

/* data type for file logical block number */
ext4_lblk_t;

/* data type for block group number */
ext4_group_t;

enum SHIFT_DIRECTION {};

/*
 * For each criteria, mballoc has slightly different way of finding
 * the required blocks nad usually, higher the criteria the slower the
 * allocation.  We start at lower criterias and keep falling back to
 * higher ones if we are not able to find any blocks.  Lower (earlier)
 * criteria are faster.
 */
enum criteria {};

/*
 * Flags used in mballoc's allocation_context flags field.
 *
 * Also used to show what's going on for debugging purposes when the
 * flag field is exported via the traceport interface
 */

/* prefer goal again. length */
#define EXT4_MB_HINT_MERGE
/* blocks already reserved */
#define EXT4_MB_HINT_RESERVED
/* metadata is being allocated */
#define EXT4_MB_HINT_METADATA
/* first blocks in the file */
#define EXT4_MB_HINT_FIRST
/* search for the best chunk */
#define EXT4_MB_HINT_BEST
/* data is being allocated */
#define EXT4_MB_HINT_DATA
/* don't preallocate (for tails) */
#define EXT4_MB_HINT_NOPREALLOC
/* allocate for locality group */
#define EXT4_MB_HINT_GROUP_ALLOC
/* allocate goal blocks or none */
#define EXT4_MB_HINT_GOAL_ONLY
/* goal is meaningful */
#define EXT4_MB_HINT_TRY_GOAL
/* blocks already pre-reserved by delayed allocation */
#define EXT4_MB_DELALLOC_RESERVED
/* We are doing stream allocation */
#define EXT4_MB_STREAM_ALLOC
/* Use reserved root blocks if needed */
#define EXT4_MB_USE_ROOT_BLOCKS
/* Use blocks from reserved pool */
#define EXT4_MB_USE_RESERVED
/* Do strict check for free blocks while retrying block allocation */
#define EXT4_MB_STRICT_CHECK
/* Large fragment size list lookup succeeded at least once for
 * CR_POWER2_ALIGNED */
#define EXT4_MB_CR_POWER2_ALIGNED_OPTIMIZED
/* Avg fragment size rb tree lookup succeeded at least once for
 * CR_GOAL_LEN_FAST */
#define EXT4_MB_CR_GOAL_LEN_FAST_OPTIMIZED
/* Avg fragment size rb tree lookup succeeded at least once for
 * CR_BEST_AVAIL_LEN */
#define EXT4_MB_CR_BEST_AVAIL_LEN_OPTIMIZED

struct ext4_allocation_request {};

/*
 * Logical to physical block mapping, used by ext4_map_blocks()
 *
 * This structure is used to pass requests into ext4_map_blocks() as
 * well as to store the information returned by ext4_map_blocks().  It
 * takes less room on the stack than a struct buffer_head.
 */
#define EXT4_MAP_NEW
#define EXT4_MAP_MAPPED
#define EXT4_MAP_UNWRITTEN
#define EXT4_MAP_BOUNDARY
#define EXT4_MAP_DELAYED
#define EXT4_MAP_FLAGS

struct ext4_map_blocks {};

/*
 * Block validity checking, system zone rbtree.
 */
struct ext4_system_blocks {};

/*
 * Flags for ext4_io_end->flags
 */
#define EXT4_IO_END_UNWRITTEN

struct ext4_io_end_vec {};

/*
 * For converting unwritten extents on a work queue. 'handle' is used for
 * buffered writeback.
 */
ext4_io_end_t;

struct ext4_io_submit {};

/*
 * Special inodes numbers
 */
#define EXT4_BAD_INO
#define EXT4_ROOT_INO
#define EXT4_USR_QUOTA_INO
#define EXT4_GRP_QUOTA_INO
#define EXT4_BOOT_LOADER_INO
#define EXT4_UNDEL_DIR_INO
#define EXT4_RESIZE_INO
#define EXT4_JOURNAL_INO

/* First non-reserved inode for old ext4 filesystems */
#define EXT4_GOOD_OLD_FIRST_INO

/*
 * Maximal count of links to a file
 */
#define EXT4_LINK_MAX

/*
 * Macro-instructions used to manage several block sizes
 */
#define EXT4_MIN_BLOCK_SIZE
#define EXT4_MAX_BLOCK_SIZE
#define EXT4_MIN_BLOCK_LOG_SIZE
#define EXT4_MAX_BLOCK_LOG_SIZE
#define EXT4_MAX_CLUSTER_LOG_SIZE
#ifdef __KERNEL__
#define EXT4_BLOCK_SIZE(s)
#else
#define EXT4_BLOCK_SIZE
#endif
#define EXT4_ADDR_PER_BLOCK(s)
#define EXT4_CLUSTER_SIZE(s)
#ifdef __KERNEL__
#define EXT4_BLOCK_SIZE_BITS(s)
#define EXT4_CLUSTER_BITS(s)
#else
#define EXT4_BLOCK_SIZE_BITS
#endif
#ifdef __KERNEL__
#define EXT4_ADDR_PER_BLOCK_BITS(s)
#define EXT4_INODE_SIZE(s)
#define EXT4_FIRST_INO(s)
#else
#define EXT4_INODE_SIZE
#define EXT4_FIRST_INO
#endif
#define EXT4_BLOCK_ALIGN(size, blkbits)
#define EXT4_MAX_BLOCKS(size, offset, blkbits)

/* Translate a block number to a cluster number */
#define EXT4_B2C(sbi, blk)
/* Translate a cluster number to a block number */
#define EXT4_C2B(sbi, cluster)
/* Translate # of blks to # of clusters */
#define EXT4_NUM_B2C(sbi, blks)
/* Mask out the low bits to get the starting block of the cluster */
#define EXT4_PBLK_CMASK(s, pblk)
#define EXT4_LBLK_CMASK(s, lblk)
/* Fill in the low bits to get the last block of the cluster */
#define EXT4_LBLK_CFILL(sbi, lblk)
/* Get the cluster offset */
#define EXT4_PBLK_COFF(s, pblk)
#define EXT4_LBLK_COFF(s, lblk)

/*
 * Structure of a blocks group descriptor
 */
struct ext4_group_desc
{};

#define EXT4_BG_INODE_BITMAP_CSUM_HI_END
#define EXT4_BG_BLOCK_BITMAP_CSUM_HI_END

/*
 * Structure of a flex block group info
 */

struct flex_groups {};

#define EXT4_BG_INODE_UNINIT
#define EXT4_BG_BLOCK_UNINIT
#define EXT4_BG_INODE_ZEROED

/*
 * Macro-instructions used to manage group descriptors
 */
#define EXT4_MIN_DESC_SIZE
#define EXT4_MIN_DESC_SIZE_64BIT
#define EXT4_MAX_DESC_SIZE
#define EXT4_DESC_SIZE(s)
#ifdef __KERNEL__
#define EXT4_BLOCKS_PER_GROUP(s)
#define EXT4_CLUSTERS_PER_GROUP(s)
#define EXT4_DESC_PER_BLOCK(s)
#define EXT4_INODES_PER_GROUP(s)
#define EXT4_DESC_PER_BLOCK_BITS(s)
#else
#define EXT4_BLOCKS_PER_GROUP
#define EXT4_DESC_PER_BLOCK
#define EXT4_INODES_PER_GROUP
#endif

/*
 * Constants relative to the data blocks
 */
#define EXT4_NDIR_BLOCKS
#define EXT4_IND_BLOCK
#define EXT4_DIND_BLOCK
#define EXT4_TIND_BLOCK
#define EXT4_N_BLOCKS

/*
 * Inode flags
 */
#define EXT4_SECRM_FL
#define EXT4_UNRM_FL
#define EXT4_COMPR_FL
#define EXT4_SYNC_FL
#define EXT4_IMMUTABLE_FL
#define EXT4_APPEND_FL
#define EXT4_NODUMP_FL
#define EXT4_NOATIME_FL
/* Reserved for compression usage... */
#define EXT4_DIRTY_FL
#define EXT4_COMPRBLK_FL
#define EXT4_NOCOMPR_FL
	/* nb: was previously EXT2_ECOMPR_FL */
#define EXT4_ENCRYPT_FL
/* End compression flags --- maybe not all used */
#define EXT4_INDEX_FL
#define EXT4_IMAGIC_FL
#define EXT4_JOURNAL_DATA_FL
#define EXT4_NOTAIL_FL
#define EXT4_DIRSYNC_FL
#define EXT4_TOPDIR_FL
#define EXT4_HUGE_FILE_FL
#define EXT4_EXTENTS_FL
#define EXT4_VERITY_FL
#define EXT4_EA_INODE_FL
/* 0x00400000 was formerly EXT4_EOFBLOCKS_FL */

#define EXT4_DAX_FL

#define EXT4_INLINE_DATA_FL
#define EXT4_PROJINHERIT_FL
#define EXT4_CASEFOLD_FL
#define EXT4_RESERVED_FL

/* User modifiable flags */
#define EXT4_FL_USER_MODIFIABLE

/* User visible flags */
#define EXT4_FL_USER_VISIBLE

/* Flags that should be inherited by new inodes from their parent. */
#define EXT4_FL_INHERITED

/* Flags that are appropriate for regular files (all but dir-specific ones). */
#define EXT4_REG_FLMASK

/* Flags that are appropriate for non-directories/regular files. */
#define EXT4_OTHER_FLMASK

/* The only flags that should be swapped */
#define EXT4_FL_SHOULD_SWAP

/* Flags which are mutually exclusive to DAX */
#define EXT4_DAX_MUT_EXCL

/* Mask out flags that are inappropriate for the given type of inode. */
static inline __u32 ext4_mask_flags(umode_t mode, __u32 flags)
{}

/*
 * Inode flags used for atomic set/get
 */
enum {};

/*
 * Since it's pretty easy to mix up bit numbers and hex values, we use a
 * build-time check to make sure that EXT4_XXX_FL is consistent with respect to
 * EXT4_INODE_XXX. If all is well, the macros will be dropped, so, it won't cost
 * any extra space in the compiled kernel image, otherwise, the build will fail.
 * It's important that these values are the same, since we are using
 * EXT4_INODE_XXX to test for flag values, but EXT4_XXX_FL must be consistent
 * with the values of FS_XXX_FL defined in include/linux/fs.h and the on-disk
 * values found in ext2, ext3 and ext4 filesystems, and of course the values
 * defined in e2fsprogs.
 *
 * It's not paranoia if the Murphy's Law really *is* out to get you.  :-)
 */
#define TEST_FLAG_VALUE(FLAG)
#define CHECK_FLAG_VALUE(FLAG)

static inline void ext4_check_flag_values(void)
{}

#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
struct compat_ext4_new_group_input {};
#endif

/* The struct ext4_new_group_input in kernel space, with free_blocks_count */
struct ext4_new_group_data {};

/* Indexes used to index group tables in ext4_new_group_data */
enum {};

/*
 * Flags used by ext4_map_blocks()
 */
	/* Allocate any needed blocks and/or convert an unwritten
	   extent to be an initialized ext4 */
#define EXT4_GET_BLOCKS_CREATE
	/* Request the creation of an unwritten extent */
#define EXT4_GET_BLOCKS_UNWRIT_EXT
#define EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT
	/* Caller is from the delayed allocation writeout path
	 * finally doing the actual allocation of delayed blocks */
#define EXT4_GET_BLOCKS_DELALLOC_RESERVE
	/* caller is from the direct IO path, request to creation of an
	unwritten extents if not allocated, split the unwritten
	extent if blocks has been preallocated already*/
#define EXT4_GET_BLOCKS_PRE_IO
#define EXT4_GET_BLOCKS_CONVERT
#define EXT4_GET_BLOCKS_IO_CREATE_EXT
	/* Convert extent to initialized after IO complete */
#define EXT4_GET_BLOCKS_IO_CONVERT_EXT
	/* Eventual metadata allocation (due to growing extent tree)
	 * should not fail, so try to use reserved blocks for that.*/
#define EXT4_GET_BLOCKS_METADATA_NOFAIL
	/* Don't normalize allocation size (used for fallocate) */
#define EXT4_GET_BLOCKS_NO_NORMALIZE
	/* Convert written extents to unwritten */
#define EXT4_GET_BLOCKS_CONVERT_UNWRITTEN
	/* Write zeros to newly created written extents */
#define EXT4_GET_BLOCKS_ZERO
#define EXT4_GET_BLOCKS_CREATE_ZERO
	/* Caller will submit data before dropping transaction handle. This
	 * allows jbd2 to avoid submitting data before commit. */
#define EXT4_GET_BLOCKS_IO_SUBMIT
	/* Caller is in the atomic contex, find extent if it has been cached */
#define EXT4_GET_BLOCKS_CACHED_NOWAIT

/*
 * The bit position of these flags must not overlap with any of the
 * EXT4_GET_BLOCKS_*.  They are used by ext4_find_extent(),
 * read_extent_tree_block(), ext4_split_extent_at(),
 * ext4_ext_insert_extent(), and ext4_ext_create_new_leaf().
 * EXT4_EX_NOCACHE is used to indicate that the we shouldn't be
 * caching the extents when reading from the extent tree while a
 * truncate or punch hole operation is in progress.
 */
#define EXT4_EX_NOCACHE
#define EXT4_EX_FORCE_CACHE
#define EXT4_EX_NOFAIL

/*
 * Flags used by ext4_free_blocks
 */
#define EXT4_FREE_BLOCKS_METADATA
#define EXT4_FREE_BLOCKS_FORGET
#define EXT4_FREE_BLOCKS_VALIDATED
#define EXT4_FREE_BLOCKS_NO_QUOT_UPDATE
#define EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER
#define EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER
#define EXT4_FREE_BLOCKS_RERESERVE_CLUSTER

#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
/*
 * ioctl commands in 32 bit emulation
 */
#define EXT4_IOC32_GETVERSION
#define EXT4_IOC32_SETVERSION
#define EXT4_IOC32_GETRSVSZ
#define EXT4_IOC32_SETRSVSZ
#define EXT4_IOC32_GROUP_EXTEND
#define EXT4_IOC32_GROUP_ADD
#define EXT4_IOC32_GETVERSION_OLD
#define EXT4_IOC32_SETVERSION_OLD
#endif

/* Max physical block we can address w/o extents */
#define EXT4_MAX_BLOCK_FILE_PHYS

/* Max logical block we can support */
#define EXT4_MAX_LOGICAL_BLOCK

/*
 * Structure of an inode on the disk
 */
struct ext4_inode {};

#define EXT4_EPOCH_BITS
#define EXT4_EPOCH_MASK
#define EXT4_NSEC_MASK

/*
 * Extended fields will fit into an inode if the filesystem was formatted
 * with large inodes (-I 256 or larger) and there are not currently any EAs
 * consuming all of the available space. For new inodes we always reserve
 * enough space for the kernel's known extended fields, but for inodes
 * created with an old kernel this might not have been the case. None of
 * the extended inode fields is critical for correct filesystem operation.
 * This macro checks if a certain field fits in the inode. Note that
 * inode-size = GOOD_OLD_INODE_SIZE + i_extra_isize
 */
#define EXT4_FITS_IN_INODE(ext4_inode, einode, field)			\

/*
 * We use an encoding that preserves the times for extra epoch "00":
 *
 * extra  msb of                         adjust for signed
 * epoch  32-bit                         32-bit tv_sec to
 * bits   time    decoded 64-bit tv_sec  64-bit tv_sec      valid time range
 * 0 0    1    -0x80000000..-0x00000001  0x000000000 1901-12-13..1969-12-31
 * 0 0    0    0x000000000..0x07fffffff  0x000000000 1970-01-01..2038-01-19
 * 0 1    1    0x080000000..0x0ffffffff  0x100000000 2038-01-19..2106-02-07
 * 0 1    0    0x100000000..0x17fffffff  0x100000000 2106-02-07..2174-02-25
 * 1 0    1    0x180000000..0x1ffffffff  0x200000000 2174-02-25..2242-03-16
 * 1 0    0    0x200000000..0x27fffffff  0x200000000 2242-03-16..2310-04-04
 * 1 1    1    0x280000000..0x2ffffffff  0x300000000 2310-04-04..2378-04-22
 * 1 1    0    0x300000000..0x37fffffff  0x300000000 2378-04-22..2446-05-10
 *
 * Note that previous versions of the kernel on 64-bit systems would
 * incorrectly use extra epoch bits 1,1 for dates between 1901 and
 * 1970.  e2fsck will correct this, assuming that it is run on the
 * affected filesystem before 2242.
 */

static inline __le32 ext4_encode_extra_time(struct timespec64 ts)
{}

static inline struct timespec64 ext4_decode_extra_time(__le32 base,
						       __le32 extra)
{}

#define EXT4_INODE_SET_XTIME_VAL(xtime, inode, raw_inode, ts)

#define EXT4_INODE_SET_ATIME(inode, raw_inode)

#define EXT4_INODE_SET_MTIME(inode, raw_inode)

#define EXT4_INODE_SET_CTIME(inode, raw_inode)

#define EXT4_EINODE_SET_XTIME(xtime, einode, raw_inode)

#define EXT4_INODE_GET_XTIME_VAL(xtime, inode, raw_inode)

#define EXT4_INODE_GET_ATIME(inode, raw_inode)

#define EXT4_INODE_GET_MTIME(inode, raw_inode)

#define EXT4_INODE_GET_CTIME(inode, raw_inode)

#define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode)

#define i_disk_version

#if defined(__KERNEL__) || defined(__linux__)
#define i_reserved1
#define i_file_acl_high
#define i_blocks_high
#define i_uid_low
#define i_gid_low
#define i_uid_high
#define i_gid_high
#define i_checksum_lo

#elif defined(__GNU__)

#define i_translator
#define i_uid_high
#define i_gid_high
#define i_author

#elif defined(__masix__)

#define i_reserved1
#define i_file_acl_high
#define i_reserved2

#endif /* defined(__KERNEL__) || defined(__linux__) */

#include "extents_status.h"
#include "fast_commit.h"

/*
 * Lock subclasses for i_data_sem in the ext4_inode_info structure.
 *
 * These are needed to avoid lockdep false positives when we need to
 * allocate blocks to the quota inode during ext4_map_blocks(), while
 * holding i_data_sem for a normal (non-quota) inode.  Since we don't
 * do quota tracking for the quota inode, this avoids deadlock (as
 * well as infinite recursion, since it isn't turtles all the way
 * down...)
 *
 *  I_DATA_SEM_NORMAL - Used for most inodes
 *  I_DATA_SEM_OTHER  - Used by move_inode.c for the second normal inode
 *			  where the second inode has larger inode number
 *			  than the first
 *  I_DATA_SEM_QUOTA  - Used for quota inodes only
 *  I_DATA_SEM_EA     - Used for ea_inodes only
 */
enum {};


/*
 * fourth extended file system inode data in memory
 */
struct ext4_inode_info {};

/*
 * File system states
 */
#define EXT4_VALID_FS
#define EXT4_ERROR_FS
#define EXT4_ORPHAN_FS
#define EXT4_FC_REPLAY

/*
 * Misc. filesystem flags
 */
#define EXT2_FLAGS_SIGNED_HASH
#define EXT2_FLAGS_UNSIGNED_HASH
#define EXT2_FLAGS_TEST_FILESYS

/*
 * Mount flags set via mount options or defaults
 */
#define EXT4_MOUNT_NO_MBCACHE
#define EXT4_MOUNT_GRPID
#define EXT4_MOUNT_DEBUG
#define EXT4_MOUNT_ERRORS_CONT
#define EXT4_MOUNT_ERRORS_RO
#define EXT4_MOUNT_ERRORS_PANIC
#define EXT4_MOUNT_ERRORS_MASK
#define EXT4_MOUNT_MINIX_DF
#define EXT4_MOUNT_NOLOAD
#ifdef CONFIG_FS_DAX
#define EXT4_MOUNT_DAX_ALWAYS
#else
#define EXT4_MOUNT_DAX_ALWAYS
#endif
#define EXT4_MOUNT_DATA_FLAGS
#define EXT4_MOUNT_JOURNAL_DATA
#define EXT4_MOUNT_ORDERED_DATA
#define EXT4_MOUNT_WRITEBACK_DATA
#define EXT4_MOUNT_UPDATE_JOURNAL
#define EXT4_MOUNT_NO_UID32
#define EXT4_MOUNT_XATTR_USER
#define EXT4_MOUNT_POSIX_ACL
#define EXT4_MOUNT_NO_AUTO_DA_ALLOC
#define EXT4_MOUNT_BARRIER
#define EXT4_MOUNT_QUOTA
#define EXT4_MOUNT_USRQUOTA
#define EXT4_MOUNT_GRPQUOTA
#define EXT4_MOUNT_PRJQUOTA
#define EXT4_MOUNT_DIOREAD_NOLOCK
#define EXT4_MOUNT_JOURNAL_CHECKSUM
#define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT
#define EXT4_MOUNT_WARN_ON_ERROR
#define EXT4_MOUNT_NO_PREFETCH_BLOCK_BITMAPS
#define EXT4_MOUNT_DELALLOC
#define EXT4_MOUNT_DATA_ERR_ABORT
#define EXT4_MOUNT_BLOCK_VALIDITY
#define EXT4_MOUNT_DISCARD
#define EXT4_MOUNT_INIT_INODE_TABLE

/*
 * Mount flags set either automatically (could not be set by mount option)
 * based on per file system feature or property or in special cases such as
 * distinguishing between explicit mount option definition and default.
 */
#define EXT4_MOUNT2_EXPLICIT_DELALLOC
#define EXT4_MOUNT2_STD_GROUP_SIZE
#define EXT4_MOUNT2_HURD_COMPAT
#define EXT4_MOUNT2_EXPLICIT_JOURNAL_CHECKSUM

#define EXT4_MOUNT2_JOURNAL_FAST_COMMIT
#define EXT4_MOUNT2_DAX_NEVER
#define EXT4_MOUNT2_DAX_INODE
#define EXT4_MOUNT2_MB_OPTIMIZE_SCAN
#define EXT4_MOUNT2_ABORT

#define clear_opt(sb, opt)
#define set_opt(sb, opt)
#define test_opt(sb, opt)

#define clear_opt2(sb, opt)
#define set_opt2(sb, opt)
#define test_opt2(sb, opt)

#define ext4_test_and_set_bit
#define ext4_set_bit
#define ext4_test_and_clear_bit
#define ext4_clear_bit
#define ext4_test_bit
#define ext4_find_next_zero_bit
#define ext4_find_next_bit

extern void mb_set_bits(void *bm, int cur, int len);

/*
 * Maximal mount counts between two filesystem checks
 */
#define EXT4_DFL_MAX_MNT_COUNT
#define EXT4_DFL_CHECKINTERVAL

/*
 * Behaviour when detecting errors
 */
#define EXT4_ERRORS_CONTINUE
#define EXT4_ERRORS_RO
#define EXT4_ERRORS_PANIC
#define EXT4_ERRORS_DEFAULT

/* Metadata checksum algorithm codes */
#define EXT4_CRC32C_CHKSUM

#define EXT4_LABEL_MAX

/*
 * Structure of the super block
 */
struct ext4_super_block {};

#define EXT4_S_ERR_LEN

#ifdef __KERNEL__

/* Number of quota types we support */
#define EXT4_MAXQUOTAS

#define EXT4_ENC_UTF8_12_1

/* Types of ext4 journal triggers */
enum ext4_journal_trigger_type {};

#define EXT4_JOURNAL_TRIGGER_COUNT

struct ext4_journal_trigger {};

static inline struct ext4_journal_trigger *EXT4_TRIGGER(
				struct jbd2_buffer_trigger_type *trigger)
{}

#define EXT4_ORPHAN_BLOCK_MAGIC

/* Structure at the tail of orphan block */
struct ext4_orphan_block_tail {};

static inline int ext4_inodes_per_orphan_block(struct super_block *sb)
{}

struct ext4_orphan_block {};

/*
 * Info about orphan file.
 */
struct ext4_orphan_info {};

/*
 * fourth extended-fs super-block data in memory
 */
struct ext4_sb_info {};

static inline struct ext4_sb_info *EXT4_SB(struct super_block *sb)
{}
static inline struct ext4_inode_info *EXT4_I(struct inode *inode)
{}

static inline int ext4_writepages_down_read(struct super_block *sb)
{}

static inline void ext4_writepages_up_read(struct super_block *sb, int ctx)
{}

static inline int ext4_writepages_down_write(struct super_block *sb)
{}

static inline void ext4_writepages_up_write(struct super_block *sb, int ctx)
{}

static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
{}

/*
 * Returns: sbi->field[index]
 * Used to access an array element from the following sbi fields which require
 * rcu protection to avoid dereferencing an invalid pointer due to reassignment
 * - s_group_desc
 * - s_group_info
 * - s_flex_group
 */
#define sbi_array_rcu_deref(sbi, field, index)

/*
 * run-time mount flags
 */
enum {};

static inline void ext4_set_mount_flag(struct super_block *sb, int bit)
{}

static inline void ext4_clear_mount_flag(struct super_block *sb, int bit)
{}

static inline int ext4_test_mount_flag(struct super_block *sb, int bit)
{}


/*
 * Simulate_fail codes
 */
#define EXT4_SIM_BBITMAP_EIO
#define EXT4_SIM_BBITMAP_CRC
#define EXT4_SIM_IBITMAP_EIO
#define EXT4_SIM_IBITMAP_CRC
#define EXT4_SIM_INODE_EIO
#define EXT4_SIM_INODE_CRC
#define EXT4_SIM_DIRBLOCK_EIO
#define EXT4_SIM_DIRBLOCK_CRC

static inline bool ext4_simulate_fail(struct super_block *sb,
				     unsigned long code)
{}

static inline void ext4_simulate_fail_bh(struct super_block *sb,
					 struct buffer_head *bh,
					 unsigned long code)
{}

/*
 * Error number codes for s_{first,last}_error_errno
 *
 * Linux errno numbers are architecture specific, so we need to translate
 * them into something which is architecture independent.   We don't define
 * codes for all errno's; just the ones which are most likely to be the cause
 * of an ext4_error() call.
 */
#define EXT4_ERR_UNKNOWN
#define EXT4_ERR_EIO
#define EXT4_ERR_ENOMEM
#define EXT4_ERR_EFSBADCRC
#define EXT4_ERR_EFSCORRUPTED
#define EXT4_ERR_ENOSPC
#define EXT4_ERR_ENOKEY
#define EXT4_ERR_EROFS
#define EXT4_ERR_EFBIG
#define EXT4_ERR_EEXIST
#define EXT4_ERR_ERANGE
#define EXT4_ERR_EOVERFLOW
#define EXT4_ERR_EBUSY
#define EXT4_ERR_ENOTDIR
#define EXT4_ERR_ENOTEMPTY
#define EXT4_ERR_ESHUTDOWN
#define EXT4_ERR_EFAULT

/*
 * Inode dynamic state flags
 */
enum {};

#define EXT4_INODE_BIT_FNS(name, field, offset)

/* Add these declarations here only so that these functions can be
 * found by name.  Otherwise, they are very hard to locate. */
static inline int ext4_test_inode_flag(struct inode *inode, int bit);
static inline void ext4_set_inode_flag(struct inode *inode, int bit);
static inline void ext4_clear_inode_flag(struct inode *inode, int bit);
EXT4_INODE_BIT_FNS()

/* Add these declarations here only so that these functions can be
 * found by name.  Otherwise, they are very hard to locate. */
static inline int ext4_test_inode_state(struct inode *inode, int bit);
static inline void ext4_set_inode_state(struct inode *inode, int bit);
static inline void ext4_clear_inode_state(struct inode *inode, int bit);
#if (BITS_PER_LONG < 64)
EXT4_INODE_BIT_FNS(state, state_flags, 0)

static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
{
	(ei)->i_state_flags = 0;
}
#else
EXT4_INODE_BIT_FNS()

static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
{}
#endif
#else
/* Assume that user mode programs are passing in an ext4fs superblock, not
 * a kernel struct super_block.  This will allow us to call the feature-test
 * macros from user land. */
#define EXT4_SB
#endif

static inline bool ext4_verity_in_progress(struct inode *inode)
{}

#define NEXT_ORPHAN(inode)

/*
 * Codes for operating systems
 */
#define EXT4_OS_LINUX
#define EXT4_OS_HURD
#define EXT4_OS_MASIX
#define EXT4_OS_FREEBSD
#define EXT4_OS_LITES

/*
 * Revision levels
 */
#define EXT4_GOOD_OLD_REV
#define EXT4_DYNAMIC_REV

#define EXT4_MAX_SUPP_REV

#define EXT4_GOOD_OLD_INODE_SIZE

#define EXT4_EXTRA_TIMESTAMP_MAX
#define EXT4_NON_EXTRA_TIMESTAMP_MAX
#define EXT4_TIMESTAMP_MIN

/*
 * Feature set definitions
 */

#define EXT4_FEATURE_COMPAT_DIR_PREALLOC
#define EXT4_FEATURE_COMPAT_IMAGIC_INODES
#define EXT4_FEATURE_COMPAT_HAS_JOURNAL
#define EXT4_FEATURE_COMPAT_EXT_ATTR
#define EXT4_FEATURE_COMPAT_RESIZE_INODE
#define EXT4_FEATURE_COMPAT_DIR_INDEX
#define EXT4_FEATURE_COMPAT_SPARSE_SUPER2
/*
 * The reason why "FAST_COMMIT" is a compat feature is that, FS becomes
 * incompatible only if fast commit blocks are present in the FS. Since we
 * clear the journal (and thus the fast commit blocks), we don't mark FS as
 * incompatible. We also have a JBD2 incompat feature, which gets set when
 * there are fast commit blocks present in the journal.
 */
#define EXT4_FEATURE_COMPAT_FAST_COMMIT
#define EXT4_FEATURE_COMPAT_STABLE_INODES
#define EXT4_FEATURE_COMPAT_ORPHAN_FILE

#define EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER
#define EXT4_FEATURE_RO_COMPAT_LARGE_FILE
#define EXT4_FEATURE_RO_COMPAT_BTREE_DIR
#define EXT4_FEATURE_RO_COMPAT_HUGE_FILE
#define EXT4_FEATURE_RO_COMPAT_GDT_CSUM
#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK
#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE
#define EXT4_FEATURE_RO_COMPAT_QUOTA
#define EXT4_FEATURE_RO_COMPAT_BIGALLOC
/*
 * METADATA_CSUM also enables group descriptor checksums (GDT_CSUM).  When
 * METADATA_CSUM is set, group descriptor checksums use the same algorithm as
 * all other data structures' checksums.  However, the METADATA_CSUM and
 * GDT_CSUM bits are mutually exclusive.
 */
#define EXT4_FEATURE_RO_COMPAT_METADATA_CSUM
#define EXT4_FEATURE_RO_COMPAT_READONLY
#define EXT4_FEATURE_RO_COMPAT_PROJECT
#define EXT4_FEATURE_RO_COMPAT_VERITY
#define EXT4_FEATURE_RO_COMPAT_ORPHAN_PRESENT

#define EXT4_FEATURE_INCOMPAT_COMPRESSION
#define EXT4_FEATURE_INCOMPAT_FILETYPE
#define EXT4_FEATURE_INCOMPAT_RECOVER
#define EXT4_FEATURE_INCOMPAT_JOURNAL_DEV
#define EXT4_FEATURE_INCOMPAT_META_BG
#define EXT4_FEATURE_INCOMPAT_EXTENTS
#define EXT4_FEATURE_INCOMPAT_64BIT
#define EXT4_FEATURE_INCOMPAT_MMP
#define EXT4_FEATURE_INCOMPAT_FLEX_BG
#define EXT4_FEATURE_INCOMPAT_EA_INODE
#define EXT4_FEATURE_INCOMPAT_DIRDATA
#define EXT4_FEATURE_INCOMPAT_CSUM_SEED
#define EXT4_FEATURE_INCOMPAT_LARGEDIR
#define EXT4_FEATURE_INCOMPAT_INLINE_DATA
#define EXT4_FEATURE_INCOMPAT_ENCRYPT
#define EXT4_FEATURE_INCOMPAT_CASEFOLD

extern void ext4_update_dynamic_rev(struct super_block *sb);

#define EXT4_FEATURE_COMPAT_FUNCS(name, flagname)

#define EXT4_FEATURE_RO_COMPAT_FUNCS(name, flagname)

#define EXT4_FEATURE_INCOMPAT_FUNCS(name, flagname)

EXT4_FEATURE_COMPAT_FUNCS()
EXT4_FEATURE_COMPAT_FUNCS()
EXT4_FEATURE_COMPAT_FUNCS()
EXT4_FEATURE_COMPAT_FUNCS()
EXT4_FEATURE_COMPAT_FUNCS()
EXT4_FEATURE_COMPAT_FUNCS()
EXT4_FEATURE_COMPAT_FUNCS()
EXT4_FEATURE_COMPAT_FUNCS()
EXT4_FEATURE_COMPAT_FUNCS()
EXT4_FEATURE_COMPAT_FUNCS()

EXT4_FEATURE_RO_COMPAT_FUNCS()
EXT4_FEATURE_RO_COMPAT_FUNCS()
EXT4_FEATURE_RO_COMPAT_FUNCS()
EXT4_FEATURE_RO_COMPAT_FUNCS()
EXT4_FEATURE_RO_COMPAT_FUNCS()
EXT4_FEATURE_RO_COMPAT_FUNCS()
EXT4_FEATURE_RO_COMPAT_FUNCS()
EXT4_FEATURE_RO_COMPAT_FUNCS()
EXT4_FEATURE_RO_COMPAT_FUNCS()
EXT4_FEATURE_RO_COMPAT_FUNCS()
EXT4_FEATURE_RO_COMPAT_FUNCS()
EXT4_FEATURE_RO_COMPAT_FUNCS()
EXT4_FEATURE_RO_COMPAT_FUNCS()
EXT4_FEATURE_RO_COMPAT_FUNCS()

EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()
EXT4_FEATURE_INCOMPAT_FUNCS()

#define EXT2_FEATURE_COMPAT_SUPP
#define EXT2_FEATURE_INCOMPAT_SUPP
#define EXT2_FEATURE_RO_COMPAT_SUPP

#define EXT3_FEATURE_COMPAT_SUPP
#define EXT3_FEATURE_INCOMPAT_SUPP
#define EXT3_FEATURE_RO_COMPAT_SUPP

#define EXT4_FEATURE_COMPAT_SUPP
#define EXT4_FEATURE_INCOMPAT_SUPP
#define EXT4_FEATURE_RO_COMPAT_SUPP

#define EXTN_FEATURE_FUNCS(ver)

EXTN_FEATURE_FUNCS()
EXTN_FEATURE_FUNCS()
EXTN_FEATURE_FUNCS()

static inline bool ext4_has_compat_features(struct super_block *sb)
{}
static inline bool ext4_has_ro_compat_features(struct super_block *sb)
{}
static inline bool ext4_has_incompat_features(struct super_block *sb)
{}

extern int ext4_feature_set_ok(struct super_block *sb, int readonly);

/*
 * Superblock flags
 */
#define EXT4_FLAGS_RESIZING
#define EXT4_FLAGS_SHUTDOWN
#define EXT4_FLAGS_BDEV_IS_DAX

static inline int ext4_forced_shutdown(struct super_block *sb)
{}

/*
 * Default values for user and/or group using reserved blocks
 */
#define EXT4_DEF_RESUID
#define EXT4_DEF_RESGID

/*
 * Default project ID
 */
#define EXT4_DEF_PROJID

#define EXT4_DEF_INODE_READAHEAD_BLKS

/*
 * Default mount options
 */
#define EXT4_DEFM_DEBUG
#define EXT4_DEFM_BSDGROUPS
#define EXT4_DEFM_XATTR_USER
#define EXT4_DEFM_ACL
#define EXT4_DEFM_UID16
#define EXT4_DEFM_JMODE
#define EXT4_DEFM_JMODE_DATA
#define EXT4_DEFM_JMODE_ORDERED
#define EXT4_DEFM_JMODE_WBACK
#define EXT4_DEFM_NOBARRIER
#define EXT4_DEFM_BLOCK_VALIDITY
#define EXT4_DEFM_DISCARD
#define EXT4_DEFM_NODELALLOC

/*
 * Default journal batch times
 */
#define EXT4_DEF_MIN_BATCH_TIME
#define EXT4_DEF_MAX_BATCH_TIME

/*
 * Minimum number of groups in a flexgroup before we separate out
 * directories into the first block group of a flexgroup
 */
#define EXT4_FLEX_SIZE_DIR_ALLOC_SCHEME

/*
 * Structure of a directory entry
 */
#define EXT4_NAME_LEN
/*
 * Base length of the ext4 directory entry excluding the name length
 */
#define EXT4_BASE_DIR_LEN

struct ext4_dir_entry {};


/*
 * Encrypted Casefolded entries require saving the hash on disk. This structure
 * followed ext4_dir_entry_2's name[name_len] at the next 4 byte aligned
 * boundary.
 */
struct ext4_dir_entry_hash {};

/*
 * The new version of the directory entry.  Since EXT4 structures are
 * stored in intel byte order, and the name_len field could never be
 * bigger than 255 chars, it's safe to reclaim the extra byte for the
 * file_type field.
 */
struct ext4_dir_entry_2 {};

/*
 * Access the hashes at the end of ext4_dir_entry_2
 */
#define EXT4_DIRENT_HASHES(entry)
#define EXT4_DIRENT_HASH(entry)
#define EXT4_DIRENT_MINOR_HASH(entry)

static inline bool ext4_hash_in_dirent(const struct inode *inode)
{}

/*
 * This is a bogus directory entry at the end of each leaf block that
 * records checksums.
 */
struct ext4_dir_entry_tail {};

#define EXT4_DIRENT_TAIL(block, blocksize)

/*
 * Ext4 directory file types.  Only the low 3 bits are used.  The
 * other bits are reserved for now.
 */
#define EXT4_FT_UNKNOWN
#define EXT4_FT_REG_FILE
#define EXT4_FT_DIR
#define EXT4_FT_CHRDEV
#define EXT4_FT_BLKDEV
#define EXT4_FT_FIFO
#define EXT4_FT_SOCK
#define EXT4_FT_SYMLINK

#define EXT4_FT_MAX

#define EXT4_FT_DIR_CSUM

/*
 * EXT4_DIR_PAD defines the directory entries boundaries
 *
 * NOTE: It must be a multiple of 4
 */
#define EXT4_DIR_PAD
#define EXT4_DIR_ROUND
#define EXT4_MAX_REC_LEN

/*
 * The rec_len is dependent on the type of directory. Directories that are
 * casefolded and encrypted need to store the hash as well, so we add room for
 * ext4_extended_dir_entry_2. For all entries related to '.' or '..' you should
 * pass NULL for dir, as those entries do not use the extra fields.
 */
static inline unsigned int ext4_dir_rec_len(__u8 name_len,
						const struct inode *dir)
{}

/*
 * If we ever get support for fs block sizes > page_size, we'll need
 * to remove the #if statements in the next two functions...
 */
static inline unsigned int
ext4_rec_len_from_disk(__le16 dlen, unsigned blocksize)
{}

static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize)
{}

/*
 * Hash Tree Directory indexing
 * (c) Daniel Phillips, 2001
 */

#define is_dx(dir)
#define EXT4_DIR_LINK_MAX(dir)
#define EXT4_DIR_LINK_EMPTY(dir)

/* Legal values for the dx_root hash_version field: */

#define DX_HASH_LEGACY
#define DX_HASH_HALF_MD4
#define DX_HASH_TEA
#define DX_HASH_LEGACY_UNSIGNED
#define DX_HASH_HALF_MD4_UNSIGNED
#define DX_HASH_TEA_UNSIGNED
#define DX_HASH_SIPHASH

static inline u32 ext4_chksum(struct ext4_sb_info *sbi, u32 crc,
			      const void *address, unsigned int length)
{}

#ifdef __KERNEL__

/* hash info structure used by the directory hash */
struct dx_hash_info
{};


/* 32 and 64 bit signed EOF for dx directories */
#define EXT4_HTREE_EOF_32BIT
#define EXT4_HTREE_EOF_64BIT


/*
 * Control parameters used by ext4_htree_next_block
 */
#define HASH_NB_ALWAYS

struct ext4_filename {};

#define fname_name(p)
#define fname_usr_name(p)
#define fname_len(p)

/*
 * Describe an inode's exact location on disk and in memory
 */
struct ext4_iloc
{};

static inline struct ext4_inode *ext4_raw_inode(struct ext4_iloc *iloc)
{}

static inline bool ext4_is_quota_file(struct inode *inode)
{}

/*
 * This structure is stuffed into the struct file's private_data field
 * for directories.  It is where we put information so that we can do
 * readdir operations in hash tree order.
 */
struct dir_private_info {};

/* calculate the first block number of the group */
static inline ext4_fsblk_t
ext4_group_first_block_no(struct super_block *sb, ext4_group_t group_no)
{}

/*
 * Special error return code only used by dx_probe() and its callers.
 */
#define ERR_BAD_DX_DIR

/* htree levels for ext4 */
#define EXT4_HTREE_LEVEL_COMPAT
#define EXT4_HTREE_LEVEL

static inline int ext4_dir_htree_level(struct super_block *sb)
{}

/*
 * Timeout and state flag for lazy initialization inode thread.
 */
#define EXT4_DEF_LI_WAIT_MULT
#define EXT4_DEF_LI_MAX_START_DELAY
#define EXT4_LAZYINIT_QUIT
#define EXT4_LAZYINIT_RUNNING

/*
 * Lazy inode table initialization info
 */
struct ext4_lazy_init {};

enum ext4_li_mode {};

struct ext4_li_request {};

struct ext4_features {};

/*
 * This structure will be used for multiple mount protection. It will be
 * written into the block number saved in the s_mmp_block field in the
 * superblock. Programs that check MMP should assume that if
 * SEQ_FSCK (or any unknown code above SEQ_MAX) is present then it is NOT safe
 * to use the filesystem, regardless of how old the timestamp is.
 */
#define EXT4_MMP_MAGIC
#define EXT4_MMP_SEQ_CLEAN
#define EXT4_MMP_SEQ_FSCK
#define EXT4_MMP_SEQ_MAX

struct mmp_struct {};

/* arguments passed to the mmp thread */
struct mmpd_data {};

/*
 * Check interval multiplier
 * The MMP block is written every update interval and initially checked every
 * update interval x the multiplier (the value is then adapted based on the
 * write latency). The reason is that writes can be delayed under load and we
 * don't want readers to incorrectly assume that the filesystem is no longer
 * in use.
 */
#define EXT4_MMP_CHECK_MULT

/*
 * Minimum interval for MMP checking in seconds.
 */
#define EXT4_MMP_MIN_CHECK_INTERVAL

/*
 * Maximum interval for MMP checking in seconds.
 */
#define EXT4_MMP_MAX_CHECK_INTERVAL

/*
 * Function prototypes
 */

/*
 * Ok, these declarations are also in <linux/kernel.h> but none of the
 * ext4 source programs needs to include it so they are duplicated here.
 */
#define NORET_TYPE
#define ATTRIB_NORET
#define NORET_AND

/* bitmap.c */
extern unsigned int ext4_count_free(char *bitmap, unsigned numchars);
void ext4_inode_bitmap_csum_set(struct super_block *sb,
				struct ext4_group_desc *gdp,
				struct buffer_head *bh, int sz);
int ext4_inode_bitmap_csum_verify(struct super_block *sb,
				  struct ext4_group_desc *gdp,
				  struct buffer_head *bh, int sz);
void ext4_block_bitmap_csum_set(struct super_block *sb,
				struct ext4_group_desc *gdp,
				struct buffer_head *bh);
int ext4_block_bitmap_csum_verify(struct super_block *sb,
				  struct ext4_group_desc *gdp,
				  struct buffer_head *bh);

/* balloc.c */
extern void ext4_get_group_no_and_offset(struct super_block *sb,
					 ext4_fsblk_t blocknr,
					 ext4_group_t *blockgrpp,
					 ext4_grpblk_t *offsetp);
extern ext4_group_t ext4_get_group_number(struct super_block *sb,
					  ext4_fsblk_t block);

extern int ext4_bg_has_super(struct super_block *sb, ext4_group_t group);
extern unsigned long ext4_bg_num_gdb(struct super_block *sb,
			ext4_group_t group);
extern ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
					 ext4_fsblk_t goal,
					 unsigned int flags,
					 unsigned long *count,
					 int *errp);
extern int ext4_claim_free_clusters(struct ext4_sb_info *sbi,
				    s64 nclusters, unsigned int flags);
extern ext4_fsblk_t ext4_count_free_clusters(struct super_block *);
extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,
						    ext4_group_t block_group,
						    struct buffer_head ** bh);
extern struct ext4_group_info *ext4_get_group_info(struct super_block *sb,
						   ext4_group_t group);
extern int ext4_should_retry_alloc(struct super_block *sb, int *retries);

extern struct buffer_head *ext4_read_block_bitmap_nowait(struct super_block *sb,
						ext4_group_t block_group,
						bool ignore_locked);
extern int ext4_wait_block_bitmap(struct super_block *sb,
				  ext4_group_t block_group,
				  struct buffer_head *bh);
extern struct buffer_head *ext4_read_block_bitmap(struct super_block *sb,
						  ext4_group_t block_group);
extern unsigned ext4_free_clusters_after_init(struct super_block *sb,
					      ext4_group_t block_group,
					      struct ext4_group_desc *gdp);
ext4_fsblk_t ext4_inode_to_goal_block(struct inode *);

#if IS_ENABLED(CONFIG_UNICODE)
extern int ext4_fname_setup_ci_filename(struct inode *dir,
					const struct qstr *iname,
					struct ext4_filename *fname);

static inline void ext4_fname_free_ci_filename(struct ext4_filename *fname)
{}
#else
static inline int ext4_fname_setup_ci_filename(struct inode *dir,
					       const struct qstr *iname,
					       struct ext4_filename *fname)
{
	return 0;
}

static inline void ext4_fname_free_ci_filename(struct ext4_filename *fname)
{
}
#endif

/* ext4 encryption related stuff goes here crypto.c */
#ifdef CONFIG_FS_ENCRYPTION
extern const struct fscrypt_operations ext4_cryptops;

int ext4_fname_setup_filename(struct inode *dir, const struct qstr *iname,
			      int lookup, struct ext4_filename *fname);

int ext4_fname_prepare_lookup(struct inode *dir, struct dentry *dentry,
			      struct ext4_filename *fname);

void ext4_fname_free_filename(struct ext4_filename *fname);

int ext4_ioctl_get_encryption_pwsalt(struct file *filp, void __user *arg);

#else /* !CONFIG_FS_ENCRYPTION */
static inline int ext4_fname_setup_filename(struct inode *dir,
					    const struct qstr *iname,
					    int lookup,
					    struct ext4_filename *fname)
{
	fname->usr_fname = iname;
	fname->disk_name.name = (unsigned char *) iname->name;
	fname->disk_name.len = iname->len;

	return ext4_fname_setup_ci_filename(dir, iname, fname);
}

static inline int ext4_fname_prepare_lookup(struct inode *dir,
					    struct dentry *dentry,
					    struct ext4_filename *fname)
{
	return ext4_fname_setup_filename(dir, &dentry->d_name, 1, fname);
}

static inline void ext4_fname_free_filename(struct ext4_filename *fname)
{
	ext4_fname_free_ci_filename(fname);
}

static inline int ext4_ioctl_get_encryption_pwsalt(struct file *filp,
						   void __user *arg)
{
	return -EOPNOTSUPP;
}
#endif /* !CONFIG_FS_ENCRYPTION */

/* dir.c */
extern int __ext4_check_dir_entry(const char *, unsigned int, struct inode *,
				  struct file *,
				  struct ext4_dir_entry_2 *,
				  struct buffer_head *, char *, int,
				  unsigned int);
#define ext4_check_dir_entry(dir, filp, de, bh, buf, size, offset)
extern int ext4_htree_store_dirent(struct file *dir_file, __u32 hash,
				__u32 minor_hash,
				struct ext4_dir_entry_2 *dirent,
				struct fscrypt_str *ent_name);
extern void ext4_htree_free_dir_info(struct dir_private_info *p);
extern int ext4_find_dest_de(struct inode *dir, struct inode *inode,
			     struct buffer_head *bh,
			     void *buf, int buf_size,
			     struct ext4_filename *fname,
			     struct ext4_dir_entry_2 **dest_de);
void ext4_insert_dentry(struct inode *dir, struct inode *inode,
			struct ext4_dir_entry_2 *de,
			int buf_size,
			struct ext4_filename *fname);
static inline void ext4_update_dx_flag(struct inode *inode)
{}
static const unsigned char ext4_filetype_table[] =;

static inline  unsigned char get_dtype(struct super_block *sb, int filetype)
{}
extern int ext4_check_all_de(struct inode *dir, struct buffer_head *bh,
			     void *buf, int buf_size);

/* fsync.c */
extern int ext4_sync_file(struct file *, loff_t, loff_t, int);

/* hash.c */
extern int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
			  struct dx_hash_info *hinfo);

/* ialloc.c */
extern int ext4_mark_inode_used(struct super_block *sb, int ino);
extern struct inode *__ext4_new_inode(struct mnt_idmap *, handle_t *,
				      struct inode *, umode_t,
				      const struct qstr *qstr, __u32 goal,
				      uid_t *owner, __u32 i_flags,
				      int handle_type, unsigned int line_no,
				      int nblocks);

#define ext4_new_inode(handle, dir, mode, qstr, goal, owner, i_flags)
#define ext4_new_inode_start_handle(idmap, dir, mode, qstr, goal, owner, \
				    type, nblocks)


extern void ext4_free_inode(handle_t *, struct inode *);
extern struct inode * ext4_orphan_get(struct super_block *, unsigned long);
extern unsigned long ext4_count_free_inodes(struct super_block *);
extern unsigned long ext4_count_dirs(struct super_block *);
extern void ext4_mark_bitmap_end(int start_bit, int end_bit, char *bitmap);
extern int ext4_init_inode_table(struct super_block *sb,
				 ext4_group_t group, int barrier);
extern void ext4_end_bitmap_read(struct buffer_head *bh, int uptodate);

/* fast_commit.c */
int ext4_fc_info_show(struct seq_file *seq, void *v);
void ext4_fc_init(struct super_block *sb, journal_t *journal);
void ext4_fc_init_inode(struct inode *inode);
void ext4_fc_track_range(handle_t *handle, struct inode *inode, ext4_lblk_t start,
			 ext4_lblk_t end);
void __ext4_fc_track_unlink(handle_t *handle, struct inode *inode,
	struct dentry *dentry);
void __ext4_fc_track_link(handle_t *handle, struct inode *inode,
	struct dentry *dentry);
void ext4_fc_track_unlink(handle_t *handle, struct dentry *dentry);
void ext4_fc_track_link(handle_t *handle, struct dentry *dentry);
void __ext4_fc_track_create(handle_t *handle, struct inode *inode,
			    struct dentry *dentry);
void ext4_fc_track_create(handle_t *handle, struct dentry *dentry);
void ext4_fc_track_inode(handle_t *handle, struct inode *inode);
void ext4_fc_mark_ineligible(struct super_block *sb, int reason, handle_t *handle);
void ext4_fc_start_update(struct inode *inode);
void ext4_fc_stop_update(struct inode *inode);
void ext4_fc_del(struct inode *inode);
bool ext4_fc_replay_check_excluded(struct super_block *sb, ext4_fsblk_t block);
void ext4_fc_replay_cleanup(struct super_block *sb);
int ext4_fc_commit(journal_t *journal, tid_t commit_tid);
int __init ext4_fc_init_dentry_cache(void);
void ext4_fc_destroy_dentry_cache(void);
int ext4_fc_record_regions(struct super_block *sb, int ino,
			   ext4_lblk_t lblk, ext4_fsblk_t pblk,
			   int len, int replay);

/* mballoc.c */
extern const struct seq_operations ext4_mb_seq_groups_ops;
extern const struct seq_operations ext4_mb_seq_structs_summary_ops;
extern int ext4_seq_mb_stats_show(struct seq_file *seq, void *offset);
extern int ext4_mb_init(struct super_block *);
extern void ext4_mb_release(struct super_block *);
extern ext4_fsblk_t ext4_mb_new_blocks(handle_t *,
				struct ext4_allocation_request *, int *);
extern void ext4_discard_preallocations(struct inode *);
extern int __init ext4_init_mballoc(void);
extern void ext4_exit_mballoc(void);
extern ext4_group_t ext4_mb_prefetch(struct super_block *sb,
				     ext4_group_t group,
				     unsigned int nr, int *cnt);
extern void ext4_mb_prefetch_fini(struct super_block *sb, ext4_group_t group,
				  unsigned int nr);

extern void ext4_free_blocks(handle_t *handle, struct inode *inode,
			     struct buffer_head *bh, ext4_fsblk_t block,
			     unsigned long count, int flags);
extern int ext4_mb_alloc_groupinfo(struct super_block *sb,
				   ext4_group_t ngroups);
extern int ext4_mb_add_groupinfo(struct super_block *sb,
		ext4_group_t i, struct ext4_group_desc *desc);
extern int ext4_group_add_blocks(handle_t *handle, struct super_block *sb,
				ext4_fsblk_t block, unsigned long count);
extern int ext4_trim_fs(struct super_block *, struct fstrim_range *);
extern void ext4_process_freed_data(struct super_block *sb, tid_t commit_tid);
extern void ext4_mb_mark_bb(struct super_block *sb, ext4_fsblk_t block,
			    int len, bool state);
static inline bool ext4_mb_cr_expensive(enum criteria cr)
{}

/* inode.c */
void ext4_inode_csum_set(struct inode *inode, struct ext4_inode *raw,
			 struct ext4_inode_info *ei);
int ext4_inode_is_fast_symlink(struct inode *inode);
struct buffer_head *ext4_getblk(handle_t *, struct inode *, ext4_lblk_t, int);
struct buffer_head *ext4_bread(handle_t *, struct inode *, ext4_lblk_t, int);
int ext4_bread_batch(struct inode *inode, ext4_lblk_t block, int bh_count,
		     bool wait, struct buffer_head **bhs);
int ext4_get_block_unwritten(struct inode *inode, sector_t iblock,
			     struct buffer_head *bh_result, int create);
int ext4_get_block(struct inode *inode, sector_t iblock,
		   struct buffer_head *bh_result, int create);
int ext4_da_get_block_prep(struct inode *inode, sector_t iblock,
			   struct buffer_head *bh, int create);
int ext4_walk_page_buffers(handle_t *handle,
			   struct inode *inode,
			   struct buffer_head *head,
			   unsigned from,
			   unsigned to,
			   int *partial,
			   int (*fn)(handle_t *handle, struct inode *inode,
				     struct buffer_head *bh));
int do_journal_get_write_access(handle_t *handle, struct inode *inode,
				struct buffer_head *bh);
#define FALL_BACK_TO_NONDELALLOC
#define CONVERT_INLINE_DATA

ext4_iget_flags;

extern struct inode *__ext4_iget(struct super_block *sb, unsigned long ino,
				 ext4_iget_flags flags, const char *function,
				 unsigned int line);

#define ext4_iget(sb, ino, flags)

extern int  ext4_write_inode(struct inode *, struct writeback_control *);
extern int  ext4_setattr(struct mnt_idmap *, struct dentry *,
			 struct iattr *);
extern u32  ext4_dio_alignment(struct inode *inode);
extern int  ext4_getattr(struct mnt_idmap *, const struct path *,
			 struct kstat *, u32, unsigned int);
extern void ext4_evict_inode(struct inode *);
extern void ext4_clear_inode(struct inode *);
extern int  ext4_file_getattr(struct mnt_idmap *, const struct path *,
			      struct kstat *, u32, unsigned int);
extern void ext4_dirty_inode(struct inode *, int);
extern int ext4_change_inode_journal_flag(struct inode *, int);
extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *);
extern int ext4_get_fc_inode_loc(struct super_block *sb, unsigned long ino,
			  struct ext4_iloc *iloc);
extern int ext4_inode_attach_jinode(struct inode *inode);
extern int ext4_can_truncate(struct inode *inode);
extern int ext4_truncate(struct inode *);
extern int ext4_break_layouts(struct inode *);
extern int ext4_punch_hole(struct file *file, loff_t offset, loff_t length);
extern void ext4_set_inode_flags(struct inode *, bool init);
extern int ext4_alloc_da_blocks(struct inode *inode);
extern void ext4_set_aops(struct inode *inode);
extern int ext4_writepage_trans_blocks(struct inode *);
extern int ext4_normal_submit_inode_data_buffers(struct jbd2_inode *jinode);
extern int ext4_chunk_trans_blocks(struct inode *, int nrblocks);
extern int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode,
			     loff_t lstart, loff_t lend);
extern vm_fault_t ext4_page_mkwrite(struct vm_fault *vmf);
extern qsize_t *ext4_get_reserved_space(struct inode *inode);
extern int ext4_get_projid(struct inode *inode, kprojid_t *projid);
extern void ext4_da_release_space(struct inode *inode, int to_free);
extern void ext4_da_update_reserve_space(struct inode *inode,
					int used, int quota_claim);
extern int ext4_issue_zeroout(struct inode *inode, ext4_lblk_t lblk,
			      ext4_fsblk_t pblk, ext4_lblk_t len);

/* indirect.c */
extern int ext4_ind_map_blocks(handle_t *handle, struct inode *inode,
				struct ext4_map_blocks *map, int flags);
extern int ext4_ind_trans_blocks(struct inode *inode, int nrblocks);
extern void ext4_ind_truncate(handle_t *, struct inode *inode);
extern int ext4_ind_remove_space(handle_t *handle, struct inode *inode,
				 ext4_lblk_t start, ext4_lblk_t end);

/* ioctl.c */
extern long ext4_ioctl(struct file *, unsigned int, unsigned long);
extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long);
int ext4_fileattr_set(struct mnt_idmap *idmap,
		      struct dentry *dentry, struct fileattr *fa);
int ext4_fileattr_get(struct dentry *dentry, struct fileattr *fa);
extern void ext4_reset_inode_seed(struct inode *inode);
int ext4_update_overhead(struct super_block *sb, bool force);
int ext4_force_shutdown(struct super_block *sb, u32 flags);

/* migrate.c */
extern int ext4_ext_migrate(struct inode *);
extern int ext4_ind_migrate(struct inode *inode);

/* namei.c */
extern int ext4_init_new_dir(handle_t *handle, struct inode *dir,
			     struct inode *inode);
extern int ext4_dirblock_csum_verify(struct inode *inode,
				     struct buffer_head *bh);
extern int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash,
				__u32 start_minor_hash, __u32 *next_hash);
extern int ext4_search_dir(struct buffer_head *bh,
			   char *search_buf,
			   int buf_size,
			   struct inode *dir,
			   struct ext4_filename *fname,
			   unsigned int offset,
			   struct ext4_dir_entry_2 **res_dir);
extern int ext4_generic_delete_entry(struct inode *dir,
				     struct ext4_dir_entry_2 *de_del,
				     struct buffer_head *bh,
				     void *entry_buf,
				     int buf_size,
				     int csum_size);
extern bool ext4_empty_dir(struct inode *inode);

/* resize.c */
extern void ext4_kvfree_array_rcu(void *to_free);
extern int ext4_group_add(struct super_block *sb,
				struct ext4_new_group_data *input);
extern int ext4_group_extend(struct super_block *sb,
				struct ext4_super_block *es,
				ext4_fsblk_t n_blocks_count);
extern int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count);
extern unsigned int ext4_list_backups(struct super_block *sb,
				      unsigned int *three, unsigned int *five,
				      unsigned int *seven);

/* super.c */
extern struct buffer_head *ext4_sb_bread(struct super_block *sb,
					 sector_t block, blk_opf_t op_flags);
extern struct buffer_head *ext4_sb_bread_unmovable(struct super_block *sb,
						   sector_t block);
extern void ext4_read_bh_nowait(struct buffer_head *bh, blk_opf_t op_flags,
				bh_end_io_t *end_io);
extern int ext4_read_bh(struct buffer_head *bh, blk_opf_t op_flags,
			bh_end_io_t *end_io);
extern int ext4_read_bh_lock(struct buffer_head *bh, blk_opf_t op_flags, bool wait);
extern void ext4_sb_breadahead_unmovable(struct super_block *sb, sector_t block);
extern int ext4_seq_options_show(struct seq_file *seq, void *offset);
extern int ext4_calculate_overhead(struct super_block *sb);
extern __le32 ext4_superblock_csum(struct super_block *sb,
				   struct ext4_super_block *es);
extern void ext4_superblock_csum_set(struct super_block *sb);
extern int ext4_alloc_flex_bg_array(struct super_block *sb,
				    ext4_group_t ngroup);
extern const char *ext4_decode_error(struct super_block *sb, int errno,
				     char nbuf[16]);
extern void ext4_mark_group_bitmap_corrupted(struct super_block *sb,
					     ext4_group_t block_group,
					     unsigned int flags);
extern unsigned int ext4_num_base_meta_blocks(struct super_block *sb,
					      ext4_group_t block_group);

extern __printf(7, 8)
void __ext4_error(struct super_block *, const char *, unsigned int, bool,
		  int, __u64, const char *, ...);
extern __printf(6, 7)
void __ext4_error_inode(struct inode *, const char *, unsigned int,
			ext4_fsblk_t, int, const char *, ...);
extern __printf(5, 6)
void __ext4_error_file(struct file *, const char *, unsigned int, ext4_fsblk_t,
		     const char *, ...);
extern void __ext4_std_error(struct super_block *, const char *,
			     unsigned int, int);
extern __printf(4, 5)
void __ext4_warning(struct super_block *, const char *, unsigned int,
		    const char *, ...);
extern __printf(4, 5)
void __ext4_warning_inode(const struct inode *inode, const char *function,
			  unsigned int line, const char *fmt, ...);
extern __printf(3, 4)
void __ext4_msg(struct super_block *, const char *, const char *, ...);
extern void __dump_mmp_msg(struct super_block *, struct mmp_struct *mmp,
			   const char *, unsigned int, const char *);
extern __printf(7, 8)
void __ext4_grp_locked_error(const char *, unsigned int,
			     struct super_block *, ext4_group_t,
			     unsigned long, ext4_fsblk_t,
			     const char *, ...);

#define EXT4_ERROR_INODE(inode, fmt, a...)

#define EXT4_ERROR_INODE_ERR(inode, err, fmt, a...)

#define ext4_error_inode_block(inode, block, err, fmt, a...)

#define EXT4_ERROR_FILE(file, block, fmt, a...)

#define ext4_abort(sb, err, fmt, a...)

#ifdef CONFIG_PRINTK

#define ext4_error_inode(inode, func, line, block, fmt, ...)
#define ext4_error_inode_err(inode, func, line, block, err, fmt, ...)
#define ext4_error_file(file, func, line, block, fmt, ...)
#define ext4_error(sb, fmt, ...)
#define ext4_error_err(sb, err, fmt, ...)
#define ext4_warning(sb, fmt, ...)
#define ext4_warning_inode(inode, fmt, ...)
#define ext4_msg(sb, level, fmt, ...)
#define dump_mmp_msg(sb, mmp, msg)
#define ext4_grp_locked_error(sb, grp, ino, block, fmt, ...)

#else

#define ext4_error_inode
#define ext4_error_inode_err
#define ext4_error_file
#define ext4_error
#define ext4_error_err
#define ext4_warning
#define ext4_warning_inode
#define ext4_msg
#define dump_mmp_msg
#define ext4_grp_locked_error

#endif

extern ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
				      struct ext4_group_desc *bg);
extern ext4_fsblk_t ext4_inode_bitmap(struct super_block *sb,
				      struct ext4_group_desc *bg);
extern ext4_fsblk_t ext4_inode_table(struct super_block *sb,
				     struct ext4_group_desc *bg);
extern __u32 ext4_free_group_clusters(struct super_block *sb,
				      struct ext4_group_desc *bg);
extern __u32 ext4_free_inodes_count(struct super_block *sb,
				 struct ext4_group_desc *bg);
extern __u32 ext4_used_dirs_count(struct super_block *sb,
				struct ext4_group_desc *bg);
extern __u32 ext4_itable_unused_count(struct super_block *sb,
				   struct ext4_group_desc *bg);
extern void ext4_block_bitmap_set(struct super_block *sb,
				  struct ext4_group_desc *bg, ext4_fsblk_t blk);
extern void ext4_inode_bitmap_set(struct super_block *sb,
				  struct ext4_group_desc *bg, ext4_fsblk_t blk);
extern void ext4_inode_table_set(struct super_block *sb,
				 struct ext4_group_desc *bg, ext4_fsblk_t blk);
extern void ext4_free_group_clusters_set(struct super_block *sb,
					 struct ext4_group_desc *bg,
					 __u32 count);
extern void ext4_free_inodes_set(struct super_block *sb,
				struct ext4_group_desc *bg, __u32 count);
extern void ext4_used_dirs_set(struct super_block *sb,
				struct ext4_group_desc *bg, __u32 count);
extern void ext4_itable_unused_set(struct super_block *sb,
				   struct ext4_group_desc *bg, __u32 count);
extern int ext4_group_desc_csum_verify(struct super_block *sb, __u32 group,
				       struct ext4_group_desc *gdp);
extern void ext4_group_desc_csum_set(struct super_block *sb, __u32 group,
				     struct ext4_group_desc *gdp);
extern int ext4_register_li_request(struct super_block *sb,
				    ext4_group_t first_not_zeroed);

static inline int ext4_has_metadata_csum(struct super_block *sb)
{}

static inline int ext4_has_group_desc_csum(struct super_block *sb)
{}

#define ext4_read_incompat_64bit_val(es, name)

static inline ext4_fsblk_t ext4_blocks_count(struct ext4_super_block *es)
{}

static inline ext4_fsblk_t ext4_r_blocks_count(struct ext4_super_block *es)
{}

static inline ext4_fsblk_t ext4_free_blocks_count(struct ext4_super_block *es)
{}

static inline void ext4_blocks_count_set(struct ext4_super_block *es,
					 ext4_fsblk_t blk)
{}

static inline void ext4_free_blocks_count_set(struct ext4_super_block *es,
					      ext4_fsblk_t blk)
{}

static inline void ext4_r_blocks_count_set(struct ext4_super_block *es,
					   ext4_fsblk_t blk)
{}

static inline loff_t ext4_isize(struct super_block *sb,
				struct ext4_inode *raw_inode)
{}

static inline void ext4_isize_set(struct ext4_inode *raw_inode, loff_t i_size)
{}

/*
 * Reading s_groups_count requires using smp_rmb() afterwards.  See
 * the locking protocol documented in the comments of ext4_group_add()
 * in resize.c
 */
static inline ext4_group_t ext4_get_groups_count(struct super_block *sb)
{}

static inline ext4_group_t ext4_flex_group(struct ext4_sb_info *sbi,
					     ext4_group_t block_group)
{}

static inline unsigned int ext4_flex_bg_size(struct ext4_sb_info *sbi)
{}

#define ext4_std_error(sb, errno)

#ifdef CONFIG_SMP
/* Each CPU can accumulate percpu_counter_batch clusters in their local
 * counters. So we need to make sure we have free clusters more
 * than percpu_counter_batch  * nr_cpu_ids. Also add a window of 4 times.
 */
#define EXT4_FREECLUSTERS_WATERMARK
#else
#define EXT4_FREECLUSTERS_WATERMARK
#endif

/* Update i_disksize. Requires i_rwsem to avoid races with truncate */
static inline void ext4_update_i_disksize(struct inode *inode, loff_t newsize)
{}

/* Update i_size, i_disksize. Requires i_rwsem to avoid races with truncate */
static inline int ext4_update_inode_size(struct inode *inode, loff_t newsize)
{}

int ext4_update_disksize_before_punch(struct inode *inode, loff_t offset,
				      loff_t len);

struct ext4_group_info {};

#define EXT4_GROUP_INFO_NEED_INIT_BIT
#define EXT4_GROUP_INFO_WAS_TRIMMED_BIT
#define EXT4_GROUP_INFO_BBITMAP_CORRUPT_BIT
#define EXT4_GROUP_INFO_IBITMAP_CORRUPT_BIT
#define EXT4_GROUP_INFO_BBITMAP_CORRUPT
#define EXT4_GROUP_INFO_IBITMAP_CORRUPT
#define EXT4_GROUP_INFO_BBITMAP_READ_BIT

#define EXT4_MB_GRP_NEED_INIT(grp)
#define EXT4_MB_GRP_BBITMAP_CORRUPT(grp)
#define EXT4_MB_GRP_IBITMAP_CORRUPT(grp)

#define EXT4_MB_GRP_WAS_TRIMMED(grp)
#define EXT4_MB_GRP_SET_TRIMMED(grp)
#define EXT4_MB_GRP_CLEAR_TRIMMED(grp)
#define EXT4_MB_GRP_TEST_AND_SET_READ(grp)

#define EXT4_MAX_CONTENTION
#define EXT4_CONTENTION_THRESHOLD

static inline spinlock_t *ext4_group_lock_ptr(struct super_block *sb,
					      ext4_group_t group)
{}

/*
 * Returns true if the filesystem is busy enough that attempts to
 * access the block group locks has run into contention.
 */
static inline int ext4_fs_is_busy(struct ext4_sb_info *sbi)
{}

static inline void ext4_lock_group(struct super_block *sb, ext4_group_t group)
{}

static inline void ext4_unlock_group(struct super_block *sb,
					ext4_group_t group)
{}

#ifdef CONFIG_QUOTA
static inline bool ext4_quota_capable(struct super_block *sb)
{}

static inline bool ext4_is_quota_journalled(struct super_block *sb)
{}
int ext4_enable_quotas(struct super_block *sb);
#endif

/*
 * Block validity checking
 */
#define ext4_check_indirect_blockref(inode, bh)

#define ext4_ind_check_inode(inode)

/*
 * Inodes and files operations
 */

/* dir.c */
extern const struct file_operations ext4_dir_operations;

/* file.c */
extern const struct inode_operations ext4_file_inode_operations;
extern const struct file_operations ext4_file_operations;
extern loff_t ext4_llseek(struct file *file, loff_t offset, int origin);

/* inline.c */
extern int ext4_get_max_inline_size(struct inode *inode);
extern int ext4_find_inline_data_nolock(struct inode *inode);
extern int ext4_destroy_inline_data(handle_t *handle, struct inode *inode);

int ext4_readpage_inline(struct inode *inode, struct folio *folio);
extern int ext4_try_to_write_inline_data(struct address_space *mapping,
					 struct inode *inode,
					 loff_t pos, unsigned len,
					 struct page **pagep);
int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
			       unsigned copied, struct folio *folio);
extern int ext4_da_write_inline_data_begin(struct address_space *mapping,
					   struct inode *inode,
					   loff_t pos, unsigned len,
					   struct page **pagep,
					   void **fsdata);
extern int ext4_try_add_inline_entry(handle_t *handle,
				     struct ext4_filename *fname,
				     struct inode *dir, struct inode *inode);
extern int ext4_try_create_inline_dir(handle_t *handle,
				      struct inode *parent,
				      struct inode *inode);
extern int ext4_read_inline_dir(struct file *filp,
				struct dir_context *ctx,
				int *has_inline_data);
extern int ext4_inlinedir_to_tree(struct file *dir_file,
				  struct inode *dir, ext4_lblk_t block,
				  struct dx_hash_info *hinfo,
				  __u32 start_hash, __u32 start_minor_hash,
				  int *has_inline_data);
extern struct buffer_head *ext4_find_inline_entry(struct inode *dir,
					struct ext4_filename *fname,
					struct ext4_dir_entry_2 **res_dir,
					int *has_inline_data);
extern int ext4_delete_inline_entry(handle_t *handle,
				    struct inode *dir,
				    struct ext4_dir_entry_2 *de_del,
				    struct buffer_head *bh,
				    int *has_inline_data);
extern bool empty_inline_dir(struct inode *dir, int *has_inline_data);
extern struct buffer_head *ext4_get_first_inline_block(struct inode *inode,
					struct ext4_dir_entry_2 **parent_de,
					int *retval);
extern void *ext4_read_inline_link(struct inode *inode);

struct iomap;
extern int ext4_inline_data_iomap(struct inode *inode, struct iomap *iomap);

extern int ext4_inline_data_truncate(struct inode *inode, int *has_inline);

extern int ext4_convert_inline_data(struct inode *inode);

static inline int ext4_has_inline_data(struct inode *inode)
{}

/* namei.c */
extern const struct inode_operations ext4_dir_inode_operations;
extern const struct inode_operations ext4_special_inode_operations;
extern struct dentry *ext4_get_parent(struct dentry *child);
extern struct ext4_dir_entry_2 *ext4_init_dot_dotdot(struct inode *inode,
				 struct ext4_dir_entry_2 *de,
				 int blocksize, int csum_size,
				 unsigned int parent_ino, int dotdot_real_len);
extern void ext4_initialize_dirent_tail(struct buffer_head *bh,
					unsigned int blocksize);
extern int ext4_handle_dirty_dirblock(handle_t *handle, struct inode *inode,
				      struct buffer_head *bh);
extern int __ext4_unlink(struct inode *dir, const struct qstr *d_name,
			 struct inode *inode, struct dentry *dentry);
extern int __ext4_link(struct inode *dir, struct inode *inode,
		       struct dentry *dentry);

#define S_SHIFT
static const unsigned char ext4_type_by_mode[(S_IFMT >> S_SHIFT) + 1] =;

static inline void ext4_set_de_type(struct super_block *sb,
				struct ext4_dir_entry_2 *de,
				umode_t mode) {}

/* readpages.c */
extern int ext4_mpage_readpages(struct inode *inode,
		struct readahead_control *rac, struct folio *folio);
extern int __init ext4_init_post_read_processing(void);
extern void ext4_exit_post_read_processing(void);

/* symlink.c */
extern const struct inode_operations ext4_encrypted_symlink_inode_operations;
extern const struct inode_operations ext4_symlink_inode_operations;
extern const struct inode_operations ext4_fast_symlink_inode_operations;

/* sysfs.c */
extern void ext4_notify_error_sysfs(struct ext4_sb_info *sbi);
extern int ext4_register_sysfs(struct super_block *sb);
extern void ext4_unregister_sysfs(struct super_block *sb);
extern int __init ext4_init_sysfs(void);
extern void ext4_exit_sysfs(void);

/* block_validity */
extern void ext4_release_system_zone(struct super_block *sb);
extern int ext4_setup_system_zone(struct super_block *sb);
extern int __init ext4_init_system_zone(void);
extern void ext4_exit_system_zone(void);
extern int ext4_inode_block_valid(struct inode *inode,
				  ext4_fsblk_t start_blk,
				  unsigned int count);
extern int ext4_check_blockref(const char *, unsigned int,
			       struct inode *, __le32 *, unsigned int);
extern int ext4_sb_block_valid(struct super_block *sb, struct inode *inode,
				ext4_fsblk_t start_blk, unsigned int count);


/* extents.c */
struct ext4_ext_path;
struct ext4_extent;

/*
 * Maximum number of logical blocks in a file; ext4_extent's ee_block is
 * __le32.
 */
#define EXT_MAX_BLOCKS

extern void ext4_ext_tree_init(handle_t *handle, struct inode *inode);
extern int ext4_ext_index_trans_blocks(struct inode *inode, int extents);
extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
			       struct ext4_map_blocks *map, int flags);
extern int ext4_ext_truncate(handle_t *, struct inode *);
extern int ext4_ext_remove_space(struct inode *inode, ext4_lblk_t start,
				 ext4_lblk_t end);
extern void ext4_ext_init(struct super_block *);
extern void ext4_ext_release(struct super_block *);
extern long ext4_fallocate(struct file *file, int mode, loff_t offset,
			  loff_t len);
extern int ext4_convert_unwritten_extents(handle_t *handle, struct inode *inode,
					  loff_t offset, ssize_t len);
extern int ext4_convert_unwritten_io_end_vec(handle_t *handle,
					     ext4_io_end_t *io_end);
extern int ext4_map_blocks(handle_t *handle, struct inode *inode,
			   struct ext4_map_blocks *map, int flags);
extern int ext4_ext_calc_credits_for_single_extent(struct inode *inode,
						   int num,
						   struct ext4_ext_path *path);
extern int ext4_ext_insert_extent(handle_t *, struct inode *,
				  struct ext4_ext_path **,
				  struct ext4_extent *, int);
extern struct ext4_ext_path *ext4_find_extent(struct inode *, ext4_lblk_t,
					      struct ext4_ext_path **,
					      int flags);
extern void ext4_free_ext_path(struct ext4_ext_path *);
extern int ext4_ext_check_inode(struct inode *inode);
extern ext4_lblk_t ext4_ext_next_allocated_block(struct ext4_ext_path *path);
extern int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
			__u64 start, __u64 len);
extern int ext4_get_es_cache(struct inode *inode,
			     struct fiemap_extent_info *fieinfo,
			     __u64 start, __u64 len);
extern int ext4_ext_precache(struct inode *inode);
extern int ext4_swap_extents(handle_t *handle, struct inode *inode1,
				struct inode *inode2, ext4_lblk_t lblk1,
			     ext4_lblk_t lblk2,  ext4_lblk_t count,
			     int mark_unwritten,int *err);
extern int ext4_clu_mapped(struct inode *inode, ext4_lblk_t lclu);
extern int ext4_datasem_ensure_credits(handle_t *handle, struct inode *inode,
				       int check_cred, int restart_cred,
				       int revoke_cred);
extern void ext4_ext_replay_shrink_inode(struct inode *inode, ext4_lblk_t end);
extern int ext4_ext_replay_set_iblocks(struct inode *inode);
extern int ext4_ext_replay_update_ex(struct inode *inode, ext4_lblk_t start,
		int len, int unwritten, ext4_fsblk_t pblk);
extern int ext4_ext_clear_bb(struct inode *inode);


/* move_extent.c */
extern void ext4_double_down_write_data_sem(struct inode *first,
					    struct inode *second);
extern void ext4_double_up_write_data_sem(struct inode *orig_inode,
					  struct inode *donor_inode);
extern int ext4_move_extents(struct file *o_filp, struct file *d_filp,
			     __u64 start_orig, __u64 start_donor,
			     __u64 len, __u64 *moved_len);

/* page-io.c */
extern int __init ext4_init_pageio(void);
extern void ext4_exit_pageio(void);
extern ext4_io_end_t *ext4_init_io_end(struct inode *inode, gfp_t flags);
extern ext4_io_end_t *ext4_get_io_end(ext4_io_end_t *io_end);
extern int ext4_put_io_end(ext4_io_end_t *io_end);
extern void ext4_put_io_end_defer(ext4_io_end_t *io_end);
extern void ext4_io_submit_init(struct ext4_io_submit *io,
				struct writeback_control *wbc);
extern void ext4_end_io_rsv_work(struct work_struct *work);
extern void ext4_io_submit(struct ext4_io_submit *io);
int ext4_bio_write_folio(struct ext4_io_submit *io, struct folio *page,
		size_t len);
extern struct ext4_io_end_vec *ext4_alloc_io_end_vec(ext4_io_end_t *io_end);
extern struct ext4_io_end_vec *ext4_last_io_end_vec(ext4_io_end_t *io_end);

/* mmp.c */
extern int ext4_multi_mount_protect(struct super_block *, ext4_fsblk_t);

/* mmp.c */
extern void ext4_stop_mmpd(struct ext4_sb_info *sbi);

/* verity.c */
extern const struct fsverity_operations ext4_verityops;

/* orphan.c */
extern int ext4_orphan_add(handle_t *, struct inode *);
extern int ext4_orphan_del(handle_t *, struct inode *);
extern void ext4_orphan_cleanup(struct super_block *sb,
				struct ext4_super_block *es);
extern void ext4_release_orphan_info(struct super_block *sb);
extern int ext4_init_orphan_info(struct super_block *sb);
extern int ext4_orphan_file_empty(struct super_block *sb);
extern void ext4_orphan_file_block_trigger(
				struct jbd2_buffer_trigger_type *triggers,
				struct buffer_head *bh,
				void *data, size_t size);

/*
 * Add new method to test whether block and inode bitmaps are properly
 * initialized. With uninit_bg reading the block from disk is not enough
 * to mark the bitmap uptodate. We need to also zero-out the bitmap
 */
#define BH_BITMAP_UPTODATE

static inline int bitmap_uptodate(struct buffer_head *bh)
{}
static inline void set_bitmap_uptodate(struct buffer_head *bh)
{}

/* For ioend & aio unwritten conversion wait queues */
#define EXT4_WQ_HASH_SZ
#define ext4_ioend_wq(v)
extern wait_queue_head_t ext4__ioend_wq[EXT4_WQ_HASH_SZ];

extern int ext4_resize_begin(struct super_block *sb);
extern int ext4_resize_end(struct super_block *sb, bool update_backups);

static inline void ext4_set_io_unwritten_flag(struct inode *inode,
					      struct ext4_io_end *io_end)
{}

static inline void ext4_clear_io_unwritten_flag(ext4_io_end_t *io_end)
{}

extern const struct iomap_ops ext4_iomap_ops;
extern const struct iomap_ops ext4_iomap_overwrite_ops;
extern const struct iomap_ops ext4_iomap_report_ops;

static inline int ext4_buffer_uptodate(struct buffer_head *bh)
{}

#endif	/* __KERNEL__ */

#define EFSBADCRC
#define EFSCORRUPTED

#endif	/* _EXT4_H */