linux/fs/ocfs2/ocfs2.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * ocfs2.h
 *
 * Defines macros and structures used in OCFS2
 *
 * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
 */

#ifndef OCFS2_H
#define OCFS2_H

#include <linux/spinlock.h>
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/list.h>
#include <linux/llist.h>
#include <linux/rbtree.h>
#include <linux/workqueue.h>
#include <linux/kref.h>
#include <linux/mutex.h>
#include <linux/lockdep.h>
#include <linux/jbd2.h>

/* For union ocfs2_dlm_lksb */
#include "stackglue.h"

#include "ocfs2_fs.h"
#include "ocfs2_lockid.h"
#include "ocfs2_ioctl.h"

/* For struct ocfs2_blockcheck_stats */
#include "blockcheck.h"

#include "reservations.h"

#include "filecheck.h"

/* Caching of metadata buffers */

/* Most user visible OCFS2 inodes will have very few pieces of
 * metadata, but larger files (including bitmaps, etc) must be taken
 * into account when designing an access scheme. We allow a small
 * amount of inlined blocks to be stored on an array and grow the
 * structure into a rb tree when necessary. */
#define OCFS2_CACHE_INFO_MAX_ARRAY

/* Flags for ocfs2_caching_info */

enum ocfs2_caching_info_flags {};

struct ocfs2_caching_operations;
struct ocfs2_caching_info {};
/*
 * Need this prototype here instead of in uptodate.h because journal.h
 * uses it.
 */
struct super_block *ocfs2_metadata_cache_get_super(struct ocfs2_caching_info *ci);

/* this limits us to 256 nodes
 * if we need more, we can do a kmalloc for the map */
#define OCFS2_NODE_MAP_MAX_NODES
struct ocfs2_node_map {};

enum ocfs2_ast_action {};

/* actions for an unlockast function to take. */
enum ocfs2_unlock_action {};

/* ocfs2_lock_res->l_flags flags. */
#define OCFS2_LOCK_ATTACHED
#define OCFS2_LOCK_BUSY
#define OCFS2_LOCK_BLOCKED
#define OCFS2_LOCK_LOCAL
#define OCFS2_LOCK_NEEDS_REFRESH
#define OCFS2_LOCK_REFRESHING
#define OCFS2_LOCK_INITIALIZED
#define OCFS2_LOCK_FREEING
#define OCFS2_LOCK_QUEUED
#define OCFS2_LOCK_NOCACHE
#define OCFS2_LOCK_PENDING
#define OCFS2_LOCK_UPCONVERT_FINISHING

#define OCFS2_LOCK_NONBLOCK_FINISHED

struct ocfs2_lock_res_ops;

ocfs2_lock_callback;

#ifdef CONFIG_OCFS2_FS_STATS
struct ocfs2_lock_stats {};
#endif

struct ocfs2_lock_res {};

enum ocfs2_orphan_reco_type {};

enum ocfs2_orphan_scan_state {};

struct ocfs2_orphan_scan {};

struct ocfs2_dlm_debug {};

enum ocfs2_vol_state
{};

struct ocfs2_alloc_stats
{};

enum ocfs2_local_alloc_state
{};

enum ocfs2_mount_options
{};

#define OCFS2_OSB_SOFT_RO
#define OCFS2_OSB_HARD_RO
#define OCFS2_OSB_ERROR_FS
#define OCFS2_DEFAULT_ATIME_QUANTUM

struct ocfs2_triggers {};

enum ocfs2_journal_trigger_type {};

#define OCFS2_JOURNAL_TRIGGER_COUNT

void ocfs2_initialize_journal_triggers(struct super_block *sb,
				       struct ocfs2_triggers triggers[]);

struct ocfs2_journal;
struct ocfs2_slot_info;
struct ocfs2_recovery_map;
struct ocfs2_replay_map;
struct ocfs2_quota_recovery;
struct ocfs2_super
{};

#define OCFS2_SB(sb)

/* Useful typedef for passing around journal access functions */
ocfs2_journal_access_func;

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

static inline int ocfs2_sparse_alloc(struct ocfs2_super *osb)
{}

static inline int ocfs2_writes_unwritten_extents(struct ocfs2_super *osb)
{}

static inline int ocfs2_supports_append_dio(struct ocfs2_super *osb)
{}


static inline int ocfs2_supports_inline_data(struct ocfs2_super *osb)
{}

static inline int ocfs2_supports_xattr(struct ocfs2_super *osb)
{}

static inline int ocfs2_meta_ecc(struct ocfs2_super *osb)
{}

static inline int ocfs2_supports_indexed_dirs(struct ocfs2_super *osb)
{}

static inline int ocfs2_supports_discontig_bg(struct ocfs2_super *osb)
{}

static inline unsigned int ocfs2_link_max(struct ocfs2_super *osb)
{}

static inline unsigned int ocfs2_read_links_count(struct ocfs2_dinode *di)
{}

static inline void ocfs2_set_links_count(struct ocfs2_dinode *di, u32 nlink)
{}

static inline void ocfs2_add_links_count(struct ocfs2_dinode *di, int n)
{}

static inline int ocfs2_refcount_tree(struct ocfs2_super *osb)
{}

/* set / clear functions because cluster events can make these happen
 * in parallel so we want the transitions to be atomic. this also
 * means that any future flags osb_flags must be protected by spinlock
 * too! */
static inline void ocfs2_set_osb_flag(struct ocfs2_super *osb,
				      unsigned long flag)
{}

static inline void ocfs2_set_ro_flag(struct ocfs2_super *osb,
				     int hard)
{}

static inline int ocfs2_is_hard_readonly(struct ocfs2_super *osb)
{}

static inline int ocfs2_is_soft_readonly(struct ocfs2_super *osb)
{}

static inline int ocfs2_clusterinfo_valid(struct ocfs2_super *osb)
{}

static inline int ocfs2_userspace_stack(struct ocfs2_super *osb)
{}

static inline int ocfs2_o2cb_stack(struct ocfs2_super *osb)
{}

static inline int ocfs2_cluster_o2cb_global_heartbeat(struct ocfs2_super *osb)
{}

static inline int ocfs2_mount_local(struct ocfs2_super *osb)
{}

static inline int ocfs2_uses_extended_slot_map(struct ocfs2_super *osb)
{}


#define OCFS2_IS_VALID_DINODE(ptr)

#define OCFS2_IS_VALID_EXTENT_BLOCK(ptr)

#define OCFS2_IS_VALID_GROUP_DESC(ptr)


#define OCFS2_IS_VALID_XATTR_BLOCK(ptr)

#define OCFS2_IS_VALID_DIR_TRAILER(ptr)

#define OCFS2_IS_VALID_DX_ROOT(ptr)

#define OCFS2_IS_VALID_DX_LEAF(ptr)

#define OCFS2_IS_VALID_REFCOUNT_BLOCK(ptr)

static inline unsigned long ino_from_blkno(struct super_block *sb,
					   u64 blkno)
{}

static inline u64 ocfs2_clusters_to_blocks(struct super_block *sb,
					   u32 clusters)
{}

static inline u32 ocfs2_clusters_for_blocks(struct super_block *sb,
		u64 blocks)
{}

static inline u32 ocfs2_blocks_to_clusters(struct super_block *sb,
					   u64 blocks)
{}

static inline unsigned int ocfs2_clusters_for_bytes(struct super_block *sb,
						    u64 bytes)
{}

static inline unsigned int ocfs2_bytes_to_clusters(struct super_block *sb,
		u64 bytes)
{}

static inline u64 ocfs2_blocks_for_bytes(struct super_block *sb,
					 u64 bytes)
{}

static inline u64 ocfs2_clusters_to_bytes(struct super_block *sb,
					  u32 clusters)
{}

static inline u64 ocfs2_block_to_cluster_start(struct super_block *sb,
					       u64 blocks)
{}

static inline u64 ocfs2_align_bytes_to_clusters(struct super_block *sb,
						u64 bytes)
{}

static inline u64 ocfs2_align_bytes_to_blocks(struct super_block *sb,
					      u64 bytes)
{}

static inline unsigned long ocfs2_align_bytes_to_sectors(u64 bytes)
{}

static inline unsigned int ocfs2_page_index_to_clusters(struct super_block *sb,
							unsigned long pg_index)
{}

/*
 * Find the 1st page index which covers the given clusters.
 */
static inline pgoff_t ocfs2_align_clusters_to_page_index(struct super_block *sb,
							u32 clusters)
{}

static inline unsigned int ocfs2_pages_per_cluster(struct super_block *sb)
{}

static inline unsigned int ocfs2_megabytes_to_clusters(struct super_block *sb,
						       unsigned int megs)
{}

static inline unsigned int ocfs2_clusters_to_megabytes(struct super_block *sb,
						       unsigned int clusters)
{}

static inline void _ocfs2_set_bit(unsigned int bit, unsigned long *bitmap)
{}
#define ocfs2_set_bit(bit, addr)

static inline void _ocfs2_clear_bit(unsigned int bit, unsigned long *bitmap)
{}
#define ocfs2_clear_bit(bit, addr)

#define ocfs2_test_bit
#define ocfs2_find_next_zero_bit
#define ocfs2_find_next_bit

static inline void *correct_addr_and_bit_unaligned(int *bit, void *addr)
{}

static inline void ocfs2_set_bit_unaligned(int bit, void *bitmap)
{}

static inline void ocfs2_clear_bit_unaligned(int bit, void *bitmap)
{}

static inline int ocfs2_test_bit_unaligned(int bit, void *bitmap)
{}

static inline int ocfs2_find_next_zero_bit_unaligned(void *bitmap, int max,
							int start)
{}

#endif  /* OCFS2_H */