#ifndef _OCFS2_FS_H
#define _OCFS2_FS_H
#include <linux/magic.h>
#define OCFS2_MAJOR_REV_LEVEL …
#define OCFS2_MINOR_REV_LEVEL …
#define OCFS2_SUPER_BLOCK_BLKNO …
#define OCFS2_MIN_CLUSTERSIZE …
#define OCFS2_MAX_CLUSTERSIZE …
#define OCFS2_MIN_BLOCKSIZE …
#define OCFS2_MAX_BLOCKSIZE …
#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 …
#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 …
#define OCFS2_FEATURE_INCOMPAT_HEARTBEAT_DEV …
#define OCFS2_FEATURE_INCOMPAT_RESIZE_INPROG …
#define OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT …
#define OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC …
#define OCFS2_FEATURE_INCOMPAT_TUNEFS_INPROG …
#define OCFS2_FEATURE_INCOMPAT_INLINE_DATA …
#define OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK …
#define OCFS2_FEATURE_INCOMPAT_EXTENDED_SLOT_MAP …
#define OCFS2_FEATURE_INCOMPAT_XATTR …
#define OCFS2_FEATURE_INCOMPAT_INDEXED_DIRS …
#define OCFS2_FEATURE_INCOMPAT_META_ECC …
#define OCFS2_FEATURE_INCOMPAT_REFCOUNT_TREE …
#define OCFS2_FEATURE_INCOMPAT_DISCONTIG_BG …
#define OCFS2_FEATURE_INCOMPAT_CLUSTERINFO …
#define OCFS2_FEATURE_INCOMPAT_APPEND_DIO …
#define OCFS2_FEATURE_COMPAT_BACKUP_SB …
#define OCFS2_FEATURE_COMPAT_JBD2_SB …
#define OCFS2_FEATURE_RO_COMPAT_UNWRITTEN …
#define OCFS2_FEATURE_RO_COMPAT_USRQUOTA …
#define OCFS2_FEATURE_RO_COMPAT_GRPQUOTA …
#define OCFS2_BACKUP_SB_START …
#define OCFS2_MAX_BACKUP_SUPERBLOCKS …
#define OCFS2_TUNEFS_INPROG_REMOVE_SLOT …
#define OCFS2_VALID_FL …
#define OCFS2_UNUSED2_FL …
#define OCFS2_ORPHANED_FL …
#define OCFS2_UNUSED3_FL …
#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 …
#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 …
#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 …
#define OCFS2_DIRTY_FL …
#define OCFS2_COMPRBLK_FL …
#define OCFS2_NOCOMP_FL …
#define OCFS2_ECOMPR_FL …
#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 …
#define OCFS2_EXT_UNWRITTEN …
#define OCFS2_EXT_REFCOUNTED …
#define OCFS2_JOURNAL_DIRTY_FL …
#define OCFS2_ERROR_FS …
#define OCFS2_MAX_FILENAME_LEN …
#define OCFS2_MAX_SLOTS …
#define OCFS2_INVALID_SLOT …
#define OCFS2_VOL_UUID_LEN …
#define OCFS2_MAX_VOL_LABEL_LEN …
#define OCFS2_STACK_LABEL_LEN …
#define OCFS2_CLUSTER_NAME_LEN …
#define OCFS2_CLASSIC_CLUSTER_STACK …
#define OCFS2_MIN_JOURNAL_SIZE …
#define OCFS2_MIN_XATTR_INLINE_SIZE …
#define OCFS2_CLUSTER_O2CB_GLOBAL_HEARTBEAT …
struct ocfs2_system_inode_info { … };
enum { … };
#define NUM_GLOBAL_SYSTEM_INODES …
#define NUM_LOCAL_SYSTEM_INODES …
static struct ocfs2_system_inode_info ocfs2_system_inodes[NUM_SYSTEM_INODES] = …;
#define OCFS2_HB_NONE …
#define OCFS2_HB_LOCAL …
#define OCFS2_HB_GLOBAL …
#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 …
#define OCFS2_RAW_SB(dinode) …
struct ocfs2_block_check { … };
struct ocfs2_extent_rec { … };
struct ocfs2_chain_rec { … };
struct ocfs2_truncate_rec { … };
struct ocfs2_extent_list { … };
struct ocfs2_chain_list { … };
struct ocfs2_truncate_log { … };
struct ocfs2_extent_block
{ … };
struct ocfs2_slot_map { … };
struct ocfs2_extended_slot { … };
struct ocfs2_slot_map_extended { … };
struct ocfs2_cluster_info { … };
struct ocfs2_super_block { … };
struct ocfs2_local_alloc
{ … };
struct ocfs2_inline_data
{ … };
struct ocfs2_dinode { … };
struct ocfs2_dir_entry { … } __attribute__ ((packed));
struct ocfs2_dir_block_trailer { … };
struct ocfs2_dx_entry { … };
struct ocfs2_dx_entry_list { … };
#define OCFS2_DX_FLAG_INLINE …
struct ocfs2_dx_root_block { … };
struct ocfs2_dx_leaf { … };
#define OCFS2_MAX_BG_BITMAP_SIZE …
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 { … };
struct ocfs2_xattr_entry { … };
struct ocfs2_xattr_header { … };
struct ocfs2_xattr_value_root { … };
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 …
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)
{ … }
#define OCFS2_GLOBAL_QMAGICS …
#define OCFS2_GLOBAL_QVERSIONS …
#define OCFS2_QBLK_RESERVED_SPACE …
struct ocfs2_disk_dqheader { … };
#define OCFS2_GLOBAL_INFO_OFF …
struct ocfs2_global_disk_dqinfo { … };
struct ocfs2_global_disk_dqblk { … };
#define OCFS2_LOCAL_QMAGICS …
#define OCFS2_LOCAL_QVERSIONS …
#define OLQF_CLEAN …
#define OCFS2_LOCAL_INFO_OFF …
struct ocfs2_local_disk_dqinfo { … };
struct ocfs2_local_disk_chunk { … };
struct ocfs2_local_disk_dqblk { … };
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);
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
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