linux/fs/ocfs2/ocfs2_fs.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * ocfs2_fs.h
 *
 * On-disk structures for OCFS2.
 *
 * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
 */

#ifndef _OCFS2_FS_H
#define _OCFS2_FS_H

#include <linux/magic.h>

/* Version */
#define OCFS2_MAJOR_REV_LEVEL
#define OCFS2_MINOR_REV_LEVEL

/*
 * An OCFS2 volume starts this way:
 * Sector 0: Valid ocfs1_vol_disk_hdr that cleanly fails to mount OCFS.
 * Sector 1: Valid ocfs1_vol_label that cleanly fails to mount OCFS.
 * Block OCFS2_SUPER_BLOCK_BLKNO: OCFS2 superblock.
 *
 * All other structures are found from the superblock information.
 *
 * OCFS2_SUPER_BLOCK_BLKNO is in blocks, not sectors.  eg, for a
 * blocksize of 2K, it is 4096 bytes into disk.
 */
#define OCFS2_SUPER_BLOCK_BLKNO

/*
 * Cluster size limits. The maximum is kept arbitrarily at 1 MB, and could
 * grow if needed.
 */
#define OCFS2_MIN_CLUSTERSIZE
#define OCFS2_MAX_CLUSTERSIZE

/*
 * Blocks cannot be bigger than clusters, so the maximum blocksize is the
 * minimum cluster size.
 */
#define OCFS2_MIN_BLOCKSIZE
#define OCFS2_MAX_BLOCKSIZE

/* Object signatures */
#define OCFS2_SUPER_BLOCK_SIGNATURE
#define OCFS2_INODE_SIGNATURE
#define OCFS2_EXTENT_BLOCK_SIGNATURE
#define OCFS2_GROUP_DESC_SIGNATURE
#define OCFS2_XATTR_BLOCK_SIGNATURE
#define OCFS2_DIR_TRAILER_SIGNATURE
#define OCFS2_DX_ROOT_SIGNATURE
#define OCFS2_DX_LEAF_SIGNATURE
#define OCFS2_REFCOUNT_BLOCK_SIGNATURE

/* Compatibility flags */
#define OCFS2_HAS_COMPAT_FEATURE(sb,mask)
#define OCFS2_HAS_RO_COMPAT_FEATURE(sb,mask)
#define OCFS2_HAS_INCOMPAT_FEATURE(sb,mask)
#define OCFS2_SET_COMPAT_FEATURE(sb,mask)
#define OCFS2_SET_RO_COMPAT_FEATURE(sb,mask)
#define OCFS2_SET_INCOMPAT_FEATURE(sb,mask)
#define OCFS2_CLEAR_COMPAT_FEATURE(sb,mask)
#define OCFS2_CLEAR_RO_COMPAT_FEATURE(sb,mask)
#define OCFS2_CLEAR_INCOMPAT_FEATURE(sb,mask)

#define OCFS2_FEATURE_COMPAT_SUPP
#define OCFS2_FEATURE_INCOMPAT_SUPP
#define OCFS2_FEATURE_RO_COMPAT_SUPP

/*
 * Heartbeat-only devices are missing journals and other files.  The
 * filesystem driver can't load them, but the library can.  Never put
 * this in OCFS2_FEATURE_INCOMPAT_SUPP, *ever*.
 */
#define OCFS2_FEATURE_INCOMPAT_HEARTBEAT_DEV

/*
 * tunefs sets this incompat flag before starting the resize and clears it
 * at the end. This flag protects users from inadvertently mounting the fs
 * after an aborted run without fsck-ing.
 */
#define OCFS2_FEATURE_INCOMPAT_RESIZE_INPROG

/* Used to denote a non-clustered volume */
#define OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT

/* Support for sparse allocation in b-trees */
#define OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC

/*
 * Tunefs sets this incompat flag before starting an operation which
 * would require cleanup on abort. This is done to protect users from
 * inadvertently mounting the fs after an aborted run without
 * fsck-ing.
 *
 * s_tunefs_flags on the super block describes precisely which
 * operations were in progress.
 */
#define OCFS2_FEATURE_INCOMPAT_TUNEFS_INPROG

/* Support for data packed into inode blocks */
#define OCFS2_FEATURE_INCOMPAT_INLINE_DATA

/*
 * Support for alternate, userspace cluster stacks.  If set, the superblock
 * field s_cluster_info contains a tag for the alternate stack in use as
 * well as the name of the cluster being joined.
 * mount.ocfs2 must pass in a matching stack name.
 *
 * If not set, the classic stack will be used.  This is compatbile with
 * all older versions.
 */
#define OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK

/* Support for the extended slot map */
#define OCFS2_FEATURE_INCOMPAT_EXTENDED_SLOT_MAP

/* Support for extended attributes */
#define OCFS2_FEATURE_INCOMPAT_XATTR

/* Support for indexed directores */
#define OCFS2_FEATURE_INCOMPAT_INDEXED_DIRS

/* Metadata checksum and error correction */
#define OCFS2_FEATURE_INCOMPAT_META_ECC

/* Refcount tree support */
#define OCFS2_FEATURE_INCOMPAT_REFCOUNT_TREE

/* Discontiguous block groups */
#define OCFS2_FEATURE_INCOMPAT_DISCONTIG_BG

/*
 * Incompat bit to indicate useable clusterinfo with stackflags for all
 * cluster stacks (userspace adnd o2cb). If this bit is set,
 * INCOMPAT_USERSPACE_STACK becomes superfluous and thus should not be set.
 */
#define OCFS2_FEATURE_INCOMPAT_CLUSTERINFO

/*
 * Append Direct IO support
 */
#define OCFS2_FEATURE_INCOMPAT_APPEND_DIO

/*
 * backup superblock flag is used to indicate that this volume
 * has backup superblocks.
 */
#define OCFS2_FEATURE_COMPAT_BACKUP_SB

/*
 * The filesystem will correctly handle journal feature bits.
 */
#define OCFS2_FEATURE_COMPAT_JBD2_SB

/*
 * Unwritten extents support.
 */
#define OCFS2_FEATURE_RO_COMPAT_UNWRITTEN

/*
 * Maintain quota information for this filesystem
 */
#define OCFS2_FEATURE_RO_COMPAT_USRQUOTA
#define OCFS2_FEATURE_RO_COMPAT_GRPQUOTA


/* The byte offset of the first backup block will be 1G.
 * The following will be 4G, 16G, 64G, 256G and 1T.
 */
#define OCFS2_BACKUP_SB_START

/* the max backup superblock nums */
#define OCFS2_MAX_BACKUP_SUPERBLOCKS

/*
 * Flags on ocfs2_super_block.s_tunefs_flags
 */
#define OCFS2_TUNEFS_INPROG_REMOVE_SLOT

/*
 * Flags on ocfs2_dinode.i_flags
 */
#define OCFS2_VALID_FL
#define OCFS2_UNUSED2_FL
#define OCFS2_ORPHANED_FL
#define OCFS2_UNUSED3_FL
/* System inode flags */
#define OCFS2_SYSTEM_FL
#define OCFS2_SUPER_BLOCK_FL
#define OCFS2_LOCAL_ALLOC_FL
#define OCFS2_BITMAP_FL
#define OCFS2_JOURNAL_FL
#define OCFS2_HEARTBEAT_FL
#define OCFS2_CHAIN_FL
#define OCFS2_DEALLOC_FL
#define OCFS2_QUOTA_FL
#define OCFS2_DIO_ORPHANED_FL

/*
 * Flags on ocfs2_dinode.i_dyn_features
 *
 * These can change much more often than i_flags. When adding flags,
 * keep in mind that i_dyn_features is only 16 bits wide.
 */
#define OCFS2_INLINE_DATA_FL
#define OCFS2_HAS_XATTR_FL
#define OCFS2_INLINE_XATTR_FL
#define OCFS2_INDEXED_DIR_FL
#define OCFS2_HAS_REFCOUNT_FL

/* Inode attributes, keep in sync with EXT2 */
#define OCFS2_SECRM_FL
#define OCFS2_UNRM_FL
#define OCFS2_COMPR_FL
#define OCFS2_SYNC_FL
#define OCFS2_IMMUTABLE_FL
#define OCFS2_APPEND_FL
#define OCFS2_NODUMP_FL
#define OCFS2_NOATIME_FL
/* Reserved for compression usage... */
#define OCFS2_DIRTY_FL
#define OCFS2_COMPRBLK_FL
#define OCFS2_NOCOMP_FL
#define OCFS2_ECOMPR_FL
/* End compression flags --- maybe not all used */
#define OCFS2_BTREE_FL
#define OCFS2_INDEX_FL
#define OCFS2_IMAGIC_FL
#define OCFS2_JOURNAL_DATA_FL
#define OCFS2_NOTAIL_FL
#define OCFS2_DIRSYNC_FL
#define OCFS2_TOPDIR_FL
#define OCFS2_RESERVED_FL

#define OCFS2_FL_VISIBLE
#define OCFS2_FL_MODIFIABLE

/*
 * Extent record flags (e_node.leaf.flags)
 */
#define OCFS2_EXT_UNWRITTEN
#define OCFS2_EXT_REFCOUNTED

/*
 * Journal Flags (ocfs2_dinode.id1.journal1.i_flags)
 */
#define OCFS2_JOURNAL_DIRTY_FL

/*
 * superblock s_state flags
 */
#define OCFS2_ERROR_FS

/* Limit of space in ocfs2_dir_entry */
#define OCFS2_MAX_FILENAME_LEN

/* Maximum slots on an ocfs2 file system */
#define OCFS2_MAX_SLOTS

/* Slot map indicator for an empty slot */
#define OCFS2_INVALID_SLOT

#define OCFS2_VOL_UUID_LEN
#define OCFS2_MAX_VOL_LABEL_LEN

/* The cluster stack fields */
#define OCFS2_STACK_LABEL_LEN
#define OCFS2_CLUSTER_NAME_LEN

/* Classic (historically speaking) cluster stack */
#define OCFS2_CLASSIC_CLUSTER_STACK

/* Journal limits (in bytes) */
#define OCFS2_MIN_JOURNAL_SIZE

/*
 * Inline extended attribute size (in bytes)
 * The value chosen should be aligned to 16 byte boundaries.
 */
#define OCFS2_MIN_XATTR_INLINE_SIZE

/*
 * Cluster info flags (ocfs2_cluster_info.ci_stackflags)
 */
#define OCFS2_CLUSTER_O2CB_GLOBAL_HEARTBEAT

struct ocfs2_system_inode_info {};

/* System file index */
enum {};
#define NUM_GLOBAL_SYSTEM_INODES
#define NUM_LOCAL_SYSTEM_INODES

static struct ocfs2_system_inode_info ocfs2_system_inodes[NUM_SYSTEM_INODES] =;

/* Parameter passed from mount.ocfs2 to module */
#define OCFS2_HB_NONE
#define OCFS2_HB_LOCAL
#define OCFS2_HB_GLOBAL

/*
 * OCFS2_DIR_PAD defines the directory entries boundaries
 *
 * NOTE: It must be a multiple of 4
 */
#define OCFS2_DIR_PAD
#define OCFS2_DIR_ROUND
#define OCFS2_DIR_MEMBER_LEN
#define OCFS2_DIR_REC_LEN(name_len)
#define OCFS2_DIR_MIN_REC_LEN

#define OCFS2_LINK_MAX
#define OCFS2_DX_LINK_MAX
#define OCFS2_LINKS_HI_SHIFT
#define OCFS2_DX_ENTRIES_MAX


/*
 * Convenience casts
 */
#define OCFS2_RAW_SB(dinode)

/*
 * Block checking structure.  This is used in metadata to validate the
 * contents.  If OCFS2_FEATURE_INCOMPAT_META_ECC is not set, it is all
 * zeros.
 */
struct ocfs2_block_check {};

/*
 * On disk extent record for OCFS2
 * It describes a range of clusters on disk.
 *
 * Length fields are divided into interior and leaf node versions.
 * This leaves room for a flags field (OCFS2_EXT_*) in the leaf nodes.
 */
struct ocfs2_extent_rec {};

struct ocfs2_chain_rec {};

struct ocfs2_truncate_rec {};

/*
 * On disk extent list for OCFS2 (node in the tree).  Note that this
 * is contained inside ocfs2_dinode or ocfs2_extent_block, so the
 * offsets are relative to ocfs2_dinode.id2.i_list or
 * ocfs2_extent_block.h_list, respectively.
 */
struct ocfs2_extent_list {};

/*
 * On disk allocation chain list for OCFS2.  Note that this is
 * contained inside ocfs2_dinode, so the offsets are relative to
 * ocfs2_dinode.id2.i_chain.
 */
struct ocfs2_chain_list {};

/*
 * On disk deallocation log for OCFS2.  Note that this is
 * contained inside ocfs2_dinode, so the offsets are relative to
 * ocfs2_dinode.id2.i_dealloc.
 */
struct ocfs2_truncate_log {};

/*
 * On disk extent block (indirect block) for OCFS2
 */
struct ocfs2_extent_block
{};

/*
 * On disk slot map for OCFS2.  This defines the contents of the "slot_map"
 * system file.  A slot is valid if it contains a node number >= 0.  The
 * value -1 (0xFFFF) is OCFS2_INVALID_SLOT.  This marks a slot empty.
 */
struct ocfs2_slot_map {};

struct ocfs2_extended_slot {};

/*
 * The extended slot map, used when OCFS2_FEATURE_INCOMPAT_EXTENDED_SLOT_MAP
 * is set.  It separates out the valid marker from the node number, and
 * has room to grow.  Unlike the old slot map, this format is defined by
 * i_size.
 */
struct ocfs2_slot_map_extended {};

/*
 * ci_stackflags is only valid if the incompat bit
 * OCFS2_FEATURE_INCOMPAT_CLUSTERINFO is set.
 */
struct ocfs2_cluster_info {};

/*
 * On disk superblock for OCFS2
 * Note that it is contained inside an ocfs2_dinode, so all offsets
 * are relative to the start of ocfs2_dinode.id2.
 */
struct ocfs2_super_block {};

/*
 * Local allocation bitmap for OCFS2 slots
 * Note that it exists inside an ocfs2_dinode, so all offsets are
 * relative to the start of ocfs2_dinode.id2.
 */
struct ocfs2_local_alloc
{};

/*
 * Data-in-inode header. This is only used if i_dyn_features has
 * OCFS2_INLINE_DATA_FL set.
 */
struct ocfs2_inline_data
{};

/*
 * On disk inode for OCFS2
 */
struct ocfs2_dinode {};

/*
 * On-disk directory entry structure for OCFS2
 *
 * Packed as this structure could be accessed unaligned on 64-bit platforms
 */
struct ocfs2_dir_entry {} __attribute__ ((packed));

/*
 * Per-block record for the unindexed directory btree. This is carefully
 * crafted so that the rec_len and name_len records of an ocfs2_dir_entry are
 * mirrored. That way, the directory manipulation code needs a minimal amount
 * of update.
 *
 * NOTE: Keep this structure aligned to a multiple of 4 bytes.
 */
struct ocfs2_dir_block_trailer {};

 /*
 * A directory entry in the indexed tree. We don't store the full name here,
 * but instead provide a pointer to the full dirent in the unindexed tree.
 *
 * We also store name_len here so as to reduce the number of leaf blocks we
 * need to search in case of collisions.
 */
struct ocfs2_dx_entry {};

struct ocfs2_dx_entry_list {};

#define OCFS2_DX_FLAG_INLINE

/*
 * A directory indexing block. Each indexed directory has one of these,
 * pointed to by ocfs2_dinode.
 *
 * This block stores an indexed btree root, and a set of free space
 * start-of-list pointers.
 */
struct ocfs2_dx_root_block {};

/*
 * The header of a leaf block in the indexed tree.
 */
struct ocfs2_dx_leaf {};

/*
 * Largest bitmap for a block (suballocator) group in bytes.  This limit
 * does not affect cluster groups (global allocator).  Cluster group
 * bitmaps run to the end of the block.
 */
#define OCFS2_MAX_BG_BITMAP_SIZE

/*
 * On disk allocator group structure for OCFS2
 */
struct ocfs2_group_desc
{};

struct ocfs2_refcount_rec {};
#define OCFS2_32BIT_POS_MASK

#define OCFS2_REFCOUNT_LEAF_FL
#define OCFS2_REFCOUNT_TREE_FL

struct ocfs2_refcount_list {};


struct ocfs2_refcount_block {};

/*
 * On disk extended attribute structure for OCFS2.
 */

/*
 * ocfs2_xattr_entry indicates one extend attribute.
 *
 * Note that it can be stored in inode, one block or one xattr bucket.
 */
struct ocfs2_xattr_entry {};

/*
 * On disk structure for xattr header.
 *
 * One ocfs2_xattr_header describes how many ocfs2_xattr_entry records in
 * the local xattr storage.
 */
struct ocfs2_xattr_header {};

/*
 * On disk structure for xattr value root.
 *
 * When an xattr's value is large enough, it is stored in an external
 * b-tree like file data.  The xattr value root points to this structure.
 */
struct ocfs2_xattr_value_root {};

/*
 * On disk structure for xattr tree root.
 *
 * It is used when there are too many extended attributes for one file. These
 * attributes will be organized and stored in an indexed-btree.
 */
struct ocfs2_xattr_tree_root {};

#define OCFS2_XATTR_INDEXED
#define OCFS2_HASH_SHIFT
#define OCFS2_XATTR_ROUND
#define OCFS2_XATTR_SIZE(size)

#define OCFS2_XATTR_BUCKET_SIZE
#define OCFS2_XATTR_MAX_BLOCKS_PER_BUCKET

/*
 * On disk structure for xattr block.
 */
struct ocfs2_xattr_block {};

#define OCFS2_XATTR_ENTRY_LOCAL
#define OCFS2_XATTR_TYPE_MASK
static inline void ocfs2_xattr_set_local(struct ocfs2_xattr_entry *xe,
					 int local)
{}

static inline int ocfs2_xattr_is_local(struct ocfs2_xattr_entry *xe)
{}

static inline void ocfs2_xattr_set_type(struct ocfs2_xattr_entry *xe, int type)
{}

static inline int ocfs2_xattr_get_type(struct ocfs2_xattr_entry *xe)
{}

/*
 *  On disk structures for global quota file
 */

/* Magic numbers and known versions for global quota files */
#define OCFS2_GLOBAL_QMAGICS

#define OCFS2_GLOBAL_QVERSIONS


/* Each block of each quota file has a certain fixed number of bytes reserved
 * for OCFS2 internal use at its end. OCFS2 can use it for things like
 * checksums, etc. */
#define OCFS2_QBLK_RESERVED_SPACE

/* Generic header of all quota files */
struct ocfs2_disk_dqheader {};

#define OCFS2_GLOBAL_INFO_OFF

/* Information header of global quota file (immediately follows the generic
 * header) */
struct ocfs2_global_disk_dqinfo {};

/* Structure with global user / group information. We reserve some space
 * for future use. */
struct ocfs2_global_disk_dqblk {};

/*
 *  On-disk structures for local quota file
 */

/* Magic numbers and known versions for local quota files */
#define OCFS2_LOCAL_QMAGICS

#define OCFS2_LOCAL_QVERSIONS

/* Quota flags in dqinfo header */
#define OLQF_CLEAN

#define OCFS2_LOCAL_INFO_OFF

/* Information header of local quota file (immediately follows the generic
 * header) */
struct ocfs2_local_disk_dqinfo {};

/* Header of one chunk of a quota file */
struct ocfs2_local_disk_chunk {};

/* One entry in local quota file */
struct ocfs2_local_disk_dqblk {};


/*
 * The quota trailer lives at the end of each quota block.
 */

struct ocfs2_disk_dqtrailer {};

static inline struct ocfs2_disk_dqtrailer *ocfs2_block_dqtrailer(int blocksize,
								 void *buf)
{}

#ifdef __KERNEL__
static inline int ocfs2_fast_symlink_chars(struct super_block *sb)
{}

static inline int ocfs2_max_inline_data_with_xattr(struct super_block *sb,
						   struct ocfs2_dinode *di)
{}

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

static inline int ocfs2_extent_recs_per_inode_with_xattr(
						struct super_block *sb,
						struct ocfs2_dinode *di)
{}

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

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

static inline u16 ocfs2_extent_recs_per_eb(struct super_block *sb)
{}

static inline u16 ocfs2_extent_recs_per_gd(struct super_block *sb)
{}

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

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

static inline u16 ocfs2_local_alloc_size(struct super_block *sb)
{}

static inline int ocfs2_group_bitmap_size(struct super_block *sb,
					  int suballocator,
					  u32 feature_incompat)
{}

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

static inline u64 ocfs2_backup_super_blkno(struct super_block *sb, int index)
{}

static inline u16 ocfs2_xattr_recs_per_xb(struct super_block *sb)
{}

static inline u16 ocfs2_extent_recs_per_rb(struct super_block *sb)
{}

static inline u16 ocfs2_refcount_recs_per_rb(struct super_block *sb)
{}

static inline u32
ocfs2_get_ref_rec_low_cpos(const struct ocfs2_refcount_rec *rec)
{}
#else
static inline int ocfs2_fast_symlink_chars(int blocksize)
{
	return blocksize - offsetof(struct ocfs2_dinode, id2.i_symlink);
}

static inline int ocfs2_max_inline_data_with_xattr(int blocksize,
						   struct ocfs2_dinode *di)
{
	if (di && (di->i_dyn_features & OCFS2_INLINE_XATTR_FL))
		return blocksize -
			offsetof(struct ocfs2_dinode, id2.i_data.id_data) -
			di->i_xattr_inline_size;
	else
		return blocksize -
			offsetof(struct ocfs2_dinode, id2.i_data.id_data);
}

static inline int ocfs2_extent_recs_per_inode(int blocksize)
{
	int size;

	size = blocksize -
		offsetof(struct ocfs2_dinode, id2.i_list.l_recs);

	return size / sizeof(struct ocfs2_extent_rec);
}

static inline int ocfs2_chain_recs_per_inode(int blocksize)
{
	int size;

	size = blocksize -
		offsetof(struct ocfs2_dinode, id2.i_chain.cl_recs);

	return size / sizeof(struct ocfs2_chain_rec);
}

static inline int ocfs2_extent_recs_per_eb(int blocksize)
{
	int size;

	size = blocksize -
		offsetof(struct ocfs2_extent_block, h_list.l_recs);

	return size / sizeof(struct ocfs2_extent_rec);
}

static inline int ocfs2_extent_recs_per_gd(int blocksize)
{
	int size;

	size = blocksize -
		offsetof(struct ocfs2_group_desc, bg_list.l_recs);

	return size / sizeof(struct ocfs2_extent_rec);
}

static inline int ocfs2_local_alloc_size(int blocksize)
{
	int size;

	size = blocksize -
		offsetof(struct ocfs2_dinode, id2.i_lab.la_bitmap);

	return size;
}

static inline int ocfs2_group_bitmap_size(int blocksize,
					  int suballocator,
					  uint32_t feature_incompat)
{
	int size = sb->s_blocksize -
		offsetof(struct ocfs2_group_desc, bg_bitmap);

	/*
	 * The cluster allocator uses the entire block.  Suballocators have
	 * never used more than OCFS2_MAX_BG_BITMAP_SIZE.  Unfortunately, older
	 * code expects bg_size set to the maximum.  Thus we must keep
	 * bg_size as-is unless discontig_bg is enabled.
	 */
	if (suballocator &&
	    (feature_incompat & OCFS2_FEATURE_INCOMPAT_DISCONTIG_BG))
		size = OCFS2_MAX_BG_BITMAP_SIZE;

	return size;
}

static inline int ocfs2_truncate_recs_per_inode(int blocksize)
{
	int size;

	size = blocksize -
		offsetof(struct ocfs2_dinode, id2.i_dealloc.tl_recs);

	return size / sizeof(struct ocfs2_truncate_rec);
}

static inline uint64_t ocfs2_backup_super_blkno(int blocksize, int index)
{
	uint64_t offset = OCFS2_BACKUP_SB_START;

	if (index >= 0 && index < OCFS2_MAX_BACKUP_SUPERBLOCKS) {
		offset <<= (2 * index);
		offset /= blocksize;
		return offset;
	}

	return 0;
}

static inline int ocfs2_xattr_recs_per_xb(int blocksize)
{
	int size;

	size = blocksize -
		offsetof(struct ocfs2_xattr_block,
			 xb_attrs.xb_root.xt_list.l_recs);

	return size / sizeof(struct ocfs2_extent_rec);
}
#endif  /* __KERNEL__ */


static inline int ocfs2_system_inode_is_global(int type)
{}

static inline int ocfs2_sprintf_system_inode_name(char *buf, int len,
						  int type, int slot)
{}

static inline void ocfs2_set_de_type(struct ocfs2_dir_entry *de,
				    umode_t mode)
{}

static inline int ocfs2_gd_is_discontig(struct ocfs2_group_desc *gd)
{}
#endif  /* _OCFS2_FS_H */